Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pending qa-docs 0.1 dev and new changes #2649

Merged
merged 119 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
c06c504
add: Add `--no-logging` parameter to `qa-docs` tool. #1864
Oct 20, 2021
cb76388
refac: Change the `path` field within `qa-docs` schema. #2075
Oct 20, 2021
ac230dd
add: Add new tags to `schema.yaml`. #2075
Oct 20, 2021
df873bb
refac: Change how `qa-docs` manage the `inputs` field. #2075
Oct 20, 2021
75fdcc3
refac: Refac `path` error raise. #2075
Oct 20, 2021
82551fb
doc: Update README and delete diagram from repo. #2075
Oct 21, 2021
6baee2b
add: Add new fim tags to `qa-docs` `schema.yaml`.
Oct 22, 2021
dd3bfae
fix: Fix npm command for windows. #2075
Oct 25, 2021
2bb06f1
refac: Add output location to `qa-docs` logging. #2075
Oct 26, 2021
81b6ccd
refac: Few error messages has been changed. Also, type validation add…
Oct 26, 2021
3dae6f4
refac: Redirect stdout so `--collect-only` does not print anything #2075
Oct 26, 2021
64c1e9b
add: Add new predefined values tags to `schema.yaml`. #2075
Oct 26, 2021
e346400
refac: Log each incompatible `qa-docs` possibility run. #2075
Oct 26, 2021
cb75b53
style: Fix style in `doc_generator.py` and `utils.py`.
Oct 26, 2021
c4b0f87
add: Add incompatible parameters check with -o option.
Oct 26, 2021
e7bf590
fix: Fix string format because it was throwing ES error. #2137
Oct 28, 2021
226be19
doc: Fix the error cases comments. #2137
Oct 28, 2021
73b5a8e
Merge pull request #2142 from wazuh/2137-index-problem
Oct 28, 2021
5fdb0ba
add: Add new predefined tag values to `schema.yaml`. #2075
Oct 29, 2021
f7aad4d
add: Add new predefined tag values to `schema.yaml`. #2075
Oct 29, 2021
e98eb5f
add: Add qa-docs dockerfiles to `setup.py`. #2145
Oct 29, 2021
c872b51
refac: Update `qa-docs` dockerfile and entrypoint. #2145
Oct 29, 2021
557ab9d
rm: Remove old script to deploy `search-ui`. #2145
Oct 29, 2021
7a4bbfa
add: Add to `qa-docs` the option to run using a docker container. #2145
Oct 29, 2021
c2c2c97
add: Add new `os_version` value to `schema.yaml`.
Oct 29, 2021
db65ea0
fix: Add missing comma in `setup.py`.
Oct 29, 2021
3f01bab
refac: Remove a useless commented line.
Oct 29, 2021
217216f
add: Add new parameter validations to `qa-docs`. #2145
Oct 29, 2021
98efbbd
Fix: Halt entrypoint when the validation fails. #2145
Oct 29, 2021
36e154f
fix: Fix moving `qa-docs` output to shared volume. #2145
Nov 2, 2021
be3d92a
refac: Name docker container as `qa_docs_container`. #2145
Nov 2, 2021
c1c8ff9
doc: Add missing doc to `qa_docs_docker_run`.
Nov 2, 2021
4cab2fb
add: Add `--check-documentation` flag that allows `qa-docs` tool to c…
Nov 2, 2021
2a08267
fix: Fix `--check-documentation` flag when the test is not documented…
Nov 2, 2021
32ae196
Merge remote-tracking branch 'origin/1864-qa-docs-fixes' into 2145-do…
Nov 2, 2021
2d973f1
refac: Change default output path and `-o` now supports `--types`, `-…
Nov 3, 2021
302e590
add: Add generated documentation format selection. #2075
Nov 3, 2021
ce73ed5
refac: Improve the `qa_docs`, `doc_generator` and `index_data` loggin…
Nov 3, 2021
b5cb34b
Merge pull request #2157 from wazuh/2145-docker-shared-dir
Nov 3, 2021
e2a640b
refac: Improve ElasticSearch connection exception handling. #2075
Nov 3, 2021
8ea7a84
style: Fix `index_data` style.
Nov 3, 2021
e655f0d
refac: Change ElasticSearch error message.
Nov 3, 2021
9fa79dc
add: Now `-o` modify the shared volume when running with `--docker-ru…
Nov 3, 2021
caecec3
add: Add new parameters checks for `--qa-branch` and `--docker-run`. …
Nov 3, 2021
bfc28f8
add: Add a line to `elasticsearch.yml` to remove security warning.
Nov 3, 2021
7eeea2a
rm: Remove `qa-docs` `requirements.txt`.
Nov 3, 2021
7cb54d1
refac: Remove `-I` and use `--tests-path` in `qa-docs` tool. #2075
Nov 4, 2021
51d7c58
style: fix `code_parser` and `qa_docs` style.
Nov 4, 2021
7a00983
add: Add set logging level option.
Nov 8, 2021
3f8ba72
style: Fix `qa-docs` and `code_parser` style.
Nov 8, 2021
e7e517a
add: Add new `qa-docs` tags.
Nov 8, 2021
d0488db
doc: Update `qa-docs` `README.md`.
Nov 9, 2021
7fae5f8
fix: Fix logging level parameter description.
Nov 10, 2021
ac25a6b
refac: Remove deprecated requirements installation.
Nov 10, 2021
36aeef2
refac: Now when using `-o` option an `custom-path/output` folder is g…
Nov 18, 2021
3a26ba6
Merge branch 'master' of github.com:wazuh/wazuh-qa into 2588-framewor…
Feb 22, 2022
5ebac90
refac: Change some parameters names. #2588
Feb 23, 2022
7c3449c
refac: Adapt `-m` parameter to the framework changes. #2588
Feb 24, 2022
60bc075
Merge pull request #2605 from wazuh/2588-framework-rework-qa-docs
Feb 24, 2022
a31f010
doc: Update active response documentation with new schema changes. #2591
Mar 3, 2022
081dd96
doc: Update agentd documentation with new schema changes. #2591
Mar 3, 2022
85b15c6
doc: Update analysisd documentation with new schema changes. #2591
Mar 3, 2022
f8e09f6
doc: Update api documentation with new schema changes. #2591
Mar 3, 2022
cfb762c
doc: Update authd documentation with new schema changes. #2591
Mar 3, 2022
1980e75
doc: Update enrollment documentation with new schema changes. #2591
Mar 3, 2022
65c8e99
doc: Update audit and ambiguous_confs suites documentation from fim w…
Mar 3, 2022
f2f4ad1
doc: Update files_basic_usage suite documentation from fim with new s…
Mar 3, 2022
03b5f16
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
76c8927
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
25c6485
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
cb5a4db
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
292f706
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
ecbb14f
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
31b62d1
doc: Update suites documentation from fim with new schema changes. #2591
Mar 3, 2022
44be567
doc: Update synchronization suite documentation from fim with new sch…
Mar 3, 2022
e53aa82
doc: Update suites documentation from gcloud with new schema changes.…
Mar 4, 2022
842a004
doc: Update suites documentation from github and logcollector with ne…
Mar 4, 2022
fcd9747
doc: Update suites documentation from logcollector with new schema ch…
Mar 4, 2022
711be25
doc: Update suites documentation from logtest with new schema changes…
Mar 4, 2022
5c1a7fc
doc: Update suites documentation from office365 and remoted with new …
Mar 4, 2022
1dd9ba7
doc: Update suites documentation from remoted with new schema changes…
Mar 4, 2022
6b2a0d1
doc: Update suites documentation from remoted, rids, and rootcheck wi…
Mar 4, 2022
8b5b6ab
doc: Update some vulnerability_detector suites documentation with new…
Mar 4, 2022
d47c1d7
doc: Update wazuh_db and wpk documentation with new schema changes. #…
Mar 4, 2022
3176531
refac: Update qa-docs schema.yaml #2591
Mar 4, 2022
65a8ce5
refac: Update qa-docs behavior with news parameters and schema. #2591
Mar 4, 2022
46ff391
Merge pull request #2633 from wazuh/2591-update-doc
Mar 4, 2022
366ce03
refac: Update qa-docs -e option with new changes. #2589
Mar 7, 2022
1328622
refac: Update how qa-ctl uses qa-docs. #2589
Mar 7, 2022
7b03878
fix: Care about having the same length only when `-r` flag is activat…
Mar 7, 2022
0b78c51
refac: Update docker behavior and fix modules path issue. #2600
Mar 7, 2022
e11af13
refac: Update incompatible parameters. #2600
Mar 7, 2022
41617b1
refac: Update copyright, changelog and readme. #2600
Mar 7, 2022
6ee12f4
refac: Update qa-ctl changelog. #2589
Mar 7, 2022
b489c16
doc: Fix qa-docs readme.
Mar 7, 2022
4623ff4
fix: Add qa-ctl v0.3 missing changes.
Mar 8, 2022
5c8ec5b
refac: Update suite as optional and change tool script.
Mar 8, 2022
c047c52
fix: Fix qa-ctl v0.3.1 changelog
Mar 8, 2022
a8b91e6
refac: Split test module checks in different methods
Mar 8, 2022
f1275c9
fix: Remove blank spaces in method documentation.
Mar 8, 2022
c853604
Merge pull request #2640 from wazuh/2589-update-qa-ctl
jmv74211 Mar 8, 2022
f3298ca
Merge branch '2601-qa-docs-framework-changes' of github.com:wazuh/waz…
Mar 8, 2022
1bf965a
refac: Update qa-docs changelog
Mar 8, 2022
2f1962e
refac: Remove branch checkout in dockerfile
Mar 8, 2022
02dbab0
fix: Remove conflict selection
Mar 8, 2022
4305ed9
Merge branch '2601-qa-docs-framework-changes' into 2600-test-qa-docs
Mar 8, 2022
0c147ed
Merge pull request #2647 from wazuh/2600-test-qa-docs
Mar 8, 2022
6cd9544
Merge branch 'master' of github.com:wazuh/wazuh-qa into 2601-qa-docs-…
Mar 9, 2022
3826762
fix: resolve missing conflicts in vuldet
Mar 9, 2022
71e4587
fix: Push missing resolved conflicts
Mar 9, 2022
12e3f69
fix: Change the run method help message
Mar 9, 2022
00a47d0
add: Add new added changes into the repo changelog
Mar 9, 2022
57889c3
rm: Remove deprecated test
Mar 9, 2022
494fbd6
doc: Update missing doc in vuldet modules
Mar 9, 2022
bf9b96b
doc: Fix missing `:` in parameters section
Mar 9, 2022
966578f
refac: Update documentation tags in schema.yaml
Mar 9, 2022
5339c12
doc: Fix missing `:` in parameters section
Mar 9, 2022
0473424
fix: Fix test doc directory when validating the test os
Mar 10, 2022
aad4e31
refac: Update qa-ctl version
Mar 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Release report: TBD

### Added

- Add `qa-docs` `v0.1`([#2649](https:/wazuh/wazuh-qa/pull/2649))
- Add `qa-ctl` `v0.3.1`([#2649](https:/wazuh/wazuh-qa/pull/2649))
- Add test fim with file currently open ([#2300](https:/wazuh/wazuh-qa/pull/2300))
- Test manager sends AR log format as expected ([#2347](https:/wazuh/wazuh-qa/pull/2347))
- Syscollector deltas IT ([#2146](https:/wazuh/wazuh-qa/pull/2146))
Expand Down
3 changes: 2 additions & 1 deletion deps/wazuh_testing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
'data/sslmanager.cert',
'tools/macos_log/log_generator.m',
'qa_docs/schema.yaml',
'qa_docs/VERSION.json'
'qa_docs/VERSION.json',
'qa_docs/dockerfiles/*',
'qa_ctl/deployment/dockerfiles/*',
'qa_ctl/deployment/dockerfiles/qa_ctl/*',
'qa_ctl/deployment/vagrantfile_template.txt',
Expand Down
13 changes: 12 additions & 1 deletion deps/wazuh_testing/wazuh_testing/qa_ctl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Change Log
All notable changes to this tool will be documented in this file.

## [v0.3.1] - 2022-03-07

### Added

- Added new parameters related to the run method. ([#2640](https:/wazuh/wazuh-qa/pull/2640))


### Changed

- Changed how the tool uses `qa-docs`. ([#2640](https:/wazuh/wazuh-qa/pull/2640))


## [v0.3] - 2021-12-10

### Added
Expand All @@ -13,7 +25,6 @@ All notable changes to this tool will be documented in this file.

- Improved modularization of functions for reading data from ansible instances.


### Fixed

- Fixed some typos in qa-ctl logs.
Expand Down
2 changes: 1 addition & 1 deletion deps/wazuh_testing/wazuh_testing/qa_ctl/VERSION.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.3",
"version": "0.3.1",
"revision": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class QACTLConfigGenerator:
wazuh package version will be taken from the documetation test information

Attributes:
tests (list): list with all the test that the user desires to run.
test_modules_data (dict): dict with all the tests that the user desires to run.
wazuh_version (string): version of the wazuh packages that the user desires to install.
This parameter is set to None by default. In case that version parameter is not given, the
wazuh package version will be taken from the documetation test information
Expand Down Expand Up @@ -131,9 +131,9 @@ class QACTLConfigGenerator:
}
}

def __init__(self, tests=None, wazuh_version=None, qa_branch='master',
def __init__(self, test_modules_data=None, wazuh_version=None, qa_branch='master',
qa_files_path=join(gettempdir(), 'wazuh_qa_ctl', 'wazuh-qa'), systems=None):
self.tests = tests
self.test_modules_data = test_modules_data
self.wazuh_version = wazuh_version
self.systems = systems
self.qactl_used_ips_file = join(gettempdir(), 'wazuh_qa_ctl', 'qactl_used_ips.txt')
Expand All @@ -146,7 +146,7 @@ def __init__(self, tests=None, wazuh_version=None, qa_branch='master',
# Create qa-ctl temporarily files path
file.recursive_directory_creation(join(gettempdir(), 'wazuh_qa_ctl'))

def __get_test_info(self, test_name):
def __get_module_info(self, type, component, suite, module):
"""Get information from a documented test.

Args:
Expand All @@ -155,9 +155,10 @@ def __get_test_info(self, test_name):
Returns:
dict : return the info of the named test in dict format.
"""
qa_docs_command = f"qa-docs -t {test_name} -o {join(gettempdir(), 'wazuh_qa_ctl')} -I " \
f"{join(self.qa_files_path, 'tests')} --no-logging"
test_data_file_path = f"{join(gettempdir(), 'wazuh_qa_ctl', test_name)}.json"
suite_command = f"-s {suite}" if suite else ''
qa_docs_command = f"qa-docs -p {join(self.qa_files_path, 'tests')} -o {join(gettempdir(), 'wazuh_qa_ctl')} " \
f"-t {type} -c {component} {suite_command} -m {module} --no-logging"
test_data_file_path = f"{join(gettempdir(), 'wazuh_qa_ctl', 'output', module)}.json"

run_local_command_returning_output(qa_docs_command)

Expand All @@ -170,7 +171,7 @@ def __get_test_info(self, test_name):
QACTLConfigGenerator.LOGGER.error, QACTL_LOGGER)

# Add test name extra info
info['test_name'] = test_name
info['test_name'] = module

# Delete test data file
file.delete_file(test_data_file_path)
Expand All @@ -183,7 +184,17 @@ def __get_all_tests_info(self):
Returns:
dict object : dict containing all the information of the tests given from their documentation.
"""
tests_info = [self.__get_test_info(test) for test in self.tests]
tests_info = []
if self.test_modules_data['suites']:
for type, component, suite, module in zip(self.test_modules_data['types'],
self.test_modules_data['components'],
self.test_modules_data['suites'],
self.test_modules_data['modules']):
tests_info.append(self.__get_module_info(type, component, suite, module))
else:
for type, component, module in zip(self.test_modules_data['types'], self.test_modules_data['components'],
self.test_modules_data['modules']):
tests_info.append(self.__get_module_info(type, component, '', module))

return tests_info

Expand Down Expand Up @@ -343,25 +354,25 @@ def __get_package_url(self, instance):

return package_url

def __add_deployment_config_block(self, test_name, os_version, components, os_platform):
def __add_deployment_config_block(self, test_name, os_version, targets, os_platform):
"""Add a configuration block to deploy a test environment in qa-ctl.

Args:
test_name (string): Test name.
os_version (string): Host vendor to deploy (e.g: CentOS 8).
components (string): Test target (manager or agent).
targets (string): Test target (manager or agent).
os_platform (string): host system (e.g: linux).
"""
# Process deployment data
host_number = len(self.config['deployment'].keys()) + 1
vm_name = f"{test_name}_{get_current_timestamp()}".replace('.', '_')
self.config['deployment'][f"host_{host_number}"] = {
'provider': {
'vagrant': self.__add_instance(os_version, vm_name, components, os_platform)
'vagrant': self.__add_instance(os_version, vm_name, targets, os_platform)
}
}
# Add manager if the target is an agent
if components == 'agent':
if targets == 'agent':
host_number += 1
self.config['deployment'][f"host_{host_number}"] = {
'provider': {
Expand Down Expand Up @@ -397,10 +408,10 @@ def __process_deployment_data(self, tests_info):
raise QAValueError(f"No valid system was found for {test['name']} test",
QACTLConfigGenerator.LOGGER.error, QACTL_LOGGER)

components = 'manager' if 'manager' in test['components'] else 'agent'
targets = 'manager' if 'manager' in test['targets'] else 'agent'
os_platform = 'windows' if 'Windows' in os_version else 'linux'

self.__add_deployment_config_block(test['test_name'], os_version, components, os_platform)
self.__add_deployment_config_block(test['test_name'], os_version, targets, os_platform)

# If system parameter is specified and have values
elif isinstance(self.systems, list) and len(self.systems) > 0:
Expand All @@ -409,9 +420,9 @@ def __process_deployment_data(self, tests_info):
if self.__validate_test_info(test):
version = self.SYSTEMS[system]['os_version']
platform = self.SYSTEMS[system]['os_platform']
component = 'manager' if 'manager' in test['components'] and platform == 'linux' else 'agent'
targets = 'manager' if 'manager' in test['targets'] and platform == 'linux' else 'agent'

self.__add_deployment_config_block(test['test_name'], version, component, platform)
self.__add_deployment_config_block(test['test_name'], version, targets, platform)
else:
raise QAValueError('Unable to process systems in the automatically generated configuration',
QACTLConfigGenerator.LOGGER.error, QACTL_LOGGER)
Expand Down Expand Up @@ -521,9 +532,8 @@ def __set_testing_config(self, tests_info):
system = QACTLConfigGenerator.BOX_INFO[vm_box]['system']

system = 'linux' if system == 'deb' or system == 'rpm' else system
modules = copy.deepcopy(test['modules'])
modules = copy.deepcopy(test['components'])
component = self.config['provision']['hosts'][instance]['wazuh_deployment']['target']

# Cut out the full path, and convert it to relative path (tests/integration....)
test_path = re.sub(r".*wazuh-qa.*(tests.*)", r"\1", test['path'])
# Convert test path string to the corresponding according to the system
Expand Down
17 changes: 12 additions & 5 deletions deps/wazuh_testing/wazuh_testing/qa_docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@
- Added TestCaseParser module to DocGenerator. ([#1651](https:/wazuh/wazuh-qa/pull/1651))
- Implemented the DocGenerator main module and test search. ([#1623](https:/wazuh/wazuh-qa/pull/1623)
- Added Config to DocGenerator. ([#1619](https:/wazuh/wazuh-qa/pull/1619))
- Implemented a sanity check module for DocGenerator. ([#1649])(https:/wazuh/wazuh-qa/pull/1649)
- Implemented a sanity check module for DocGenerator. ([#1649](https:/wazuh/wazuh-qa/pull/1649))
- Added DocGenerator code to master branch. ([#1762](https:/wazuh/wazuh-qa/pull/1762))
- Tool added to wazuh-testing framework. ([#1854](https:/wazuh/wazuh-qa/pull/1854))
- Added single test parse. ([#1854](https:/wazuh/wazuh-qa/pull/1854))
- Integrate qa-docs into wazuh-qa framework. ([#1854](https:/wazuh/wazuh-qa/pull/1854))
- Added custom qa-docs logger. ([#1896])(https:/wazuh/wazuh-qa/pull/1896)
- Created qa-docs code documentation. ([#1907])(https:/wazuh/wazuh-qa/pull/1907)
- Automatized the SearchUI dependencies installation if necessary. ([#1968])(https:/wazuh/wazuh-qa/pull/1968)
- Added qa-docs docker deployment. ([#1983])(https:/wazuh/wazuh-qa/pull/1983)
- Added custom qa-docs logger. ([#1896](https:/wazuh/wazuh-qa/pull/1896))
- Created qa-docs code documentation. ([#1907](https:/wazuh/wazuh-qa/pull/1907))
- Automatized the SearchUI dependencies installation if necessary. ([#1968](https:/wazuh/wazuh-qa/pull/1968))
- Added qa-docs docker deployment. ([#1983](https:/wazuh/wazuh-qa/pull/1983))
- Added output format selection.

### Changed

- Changed the docker deployment.
- Adapted the tool to framework changes. ([#2605](https:/wazuh/wazuh-qa/pull/2605))
- Changed the schema because of framework changes. ([#2590](https:/wazuh/wazuh-qa/issues/2590))
Loading