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 qa-ctl v0.2 #2299

Merged
merged 201 commits into from
Dec 16, 2021
Merged

Add qa-ctl v0.2 #2299

merged 201 commits into from
Dec 16, 2021

Conversation

jmv74211
Copy link
Contributor

@jmv74211 jmv74211 commented Dec 3, 2021

Related issue
close #2173

This PR adds a new 0.2 version of qa-ctl, plus all the necessary changes to qa-docs to be able to parse the test documentation schema.

The new changes introduced in this new version are as follows (you can find the changelog of qa-ctl 0.2 here):

General improvements

New issues

Add Windows tests support

Documentation


Checks

Linux

  • Automatic mode
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release
  • Automatic mode with debug level 1
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -d
  • Automatic mode with debug level 2
    qa-ctl -r test_general_setting_enabled --qa-branch 2173-qa-ctl-v2-release -dd
  • Automatic mode with persistent environment
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -p
  • Manual mode skipping deployment and provisioning
    qa-ctl -c config.yaml --qa-branch 2173-qa-ctl-v2-release --skip-deployment --skip-provisioning
  • Manual mode with several instances and testing (Check parallelism).
    qa-ctl -c config.yaml --qa-branch 2173-qa-ctl-v2-release
  • Automatic mode with custom Wazuh version
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -v 4.2.0
  • Dry-run mode
    qa-ctl -r test_general_settings_enabled --dry-run
  • Launch a Windows test
    qa-ctl -r test_registry_restrict --qa-branch 2173-qa-ctl-v2-release
  • Launch a test in centos and windows (multiple systems)
    qa-ctl -r test_basic_usage_move_file --qa-branch 2173-qa-ctl-v2-release --os centos windows

Note: For each of the above checks it is necessary to verify that the expected result is generated, the artifacts are correct and the logs show an execution according to the parameters entered.

Windows

  • Automatic mode
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release
  • Automatic mode with debug level 1
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -d
  • Automatic mode with debug level 2
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -dd
  • Automatic mode with persistent environment
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -p
  • Manual mode skipping deployment and provisioning
    qa-ctl -c config.yaml --qa-branch 2173-qa-ctl-v2-release --skip-deployment --skip-provisioning
  • Manual mode with several instances and testing (Check parallelism).
    qa-ctl -c config.yaml --qa-branch 2173-qa-ctl-v2-release
  • Automatic mode with custom Wazuh version
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -v 4.2.0
  • Dry-run mode
    qa-ctl -r test_general_settings_enabled --dry-run
  • Launch a Windows test
    qa-ctl -r test_registry_restrict --qa-branch 2173-qa-ctl-v2-release
  • Launch a test in centos and windows (multiple systems)
    qa-ctl -r test_basic_usage_move_file --qa-branch 2173-qa-ctl-v2-release --os centos windows

Generic tests

  • Run test_cors
    qa-ctl -r test_cors --qa-branch 2173-qa-ctl-v2-release
  • Run test_execd_restart
    qa-ctl -r test_execd_restart --qa-branch 2173-qa-ctl-v2-release
  • Run test_cache
    qa-ctl -r test_cache --qa-branch 2173-qa-ctl-v2-release
  • Run test_execd_firewall_drop
    qa-ctl -r test_execd_firewall_drop --qa-branch 2173-qa-ctl-v2-release
  • Run test_basic_usage_baseline_generation
    qa-ctl -r test_basic_usage_baseline_generation --qa-branch 2173-qa-ctl-v2-release
  • Run test_agentd_reconnection
    qa-ctl -r test_agentd_reconnection --qa-branch 2173-qa-ctl-v2-release
  • Run test_duplicate_entries
    qa-ctl -r test_duplicate_entries --qa-branch 2173-qa-ctl-v2-release
  • Run test_basic_usage_create_scheduled
    qa-ctl -r test_basic_usage_create_scheduled --qa-branch 2173-qa-ctl-v2-release
  • Run test_ignore
    qa-ctl -r test_ignore --qa-branch 2173-qa-ctl-v2-release

Invalid qa-ctl script parameters

  • Automatic and manual mode together
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release -c config.yaml
  • --version parameter can be only run in automatic mode
    qa-ctl -c config.yaml --qa-branch 2173-qa-ctl-v2-release -v 4.2.2
  • --dry-run parameter can only be used in automatic mode
    qa-ctl -c config.yaml --qa-branch 2173-qa-ctl-v2-release --dry-run
  • --skip-deployment parameter can only be used in manual mode
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release --skip-deployment
  • --skip-provisioning parameter can only be used in manual mode
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release --skip-provisioning
  • --skip-testing parameter can only be used in manual mode
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release --skip-testing
  • Bad --version format parameter.
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release --version 4.2
  • Bad --version release parameter.
    qa-ctl -r test_general_settings_enabled --qa-branch 2173-qa-ctl-v2-release --version 4.1.10
  • Bad --qa-branch parameter. It does not exists on remote repository.
    qa-ctl -r test_general_settings_enabled --qa-branch bad-branch
  • Bad test name. It does not exists on remote repository.
    qa-ctl -r bad_test_name --qa-branch 2173-qa-ctl-v2-release
  • Run a test in auto mode that is not documented
    qa-ctl -r test_wpk_manager --qa-branch 2173-qa-ctl-v2-release
  • Run a manager test in Windows system
    qa-ctl -r test_wpk_manager --qa-branch 2173-qa-ctl-v2-release --os windows

Luis Gonzalez added 30 commits September 13, 2021 11:11
Using a test name, it is searched recursively and print if it exists or not. Also, setup.py is updated.
Also, QADOCS logger added. Now we have to migrate from older logger to `qadocs_logger`.
Now it has to be used in all `qa-docs` modules.
…er in `Sanity` module. #1879

Also, sanity new lines style and `qa-docs` paths within wazuh framework fixed.
It only loads the config file within a Config instance.
Also added `qa_docs` script copyright.
Also, copyright has been added and doc improved.
It passes pep': pycodestyle --max-line-length=120 --show-source --show-pep8
Also, few incorrect sentences have been corrected because they may create doubts when a user would be read them.
It passes `pycodestyle --max-line-length=120 --show-source --show-pep8`.
Fernando and others added 23 commits November 2, 2021 11:30
…heck if test(s) are documentated following the `qa-docs` schema. #1864
Add test documentation validation when running `qa-ctl` in automatic mode
QA-CTL: Remove pytest error traceback test results
Add `--os` parameter validation according to the specified tests in the qa-ctl tool
…lidator

QA-CTL: Update JSON schema validator file
In addition, it has been standardize the qa-ctl script according to the PEP-8 standard.
Now the test section is generated correctly when running tests for several systems
@jmv74211 jmv74211 requested a review from snaow December 3, 2021 11:50
@jmv74211 jmv74211 self-assigned this Dec 3, 2021
@snaow
Copy link
Contributor

snaow commented Dec 16, 2021

Great job, another small step helping to the creation of a consistent and robust QA Framework for Wazuh products.

@snaow snaow merged commit 1ea31af into master Dec 16, 2021
@snaow snaow deleted the 2173-qa-ctl-v2-release branch December 16, 2021 15:29
@snaow snaow mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prepare qa-ctl tool release v0.2
3 participants