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

Fixed the way the API integration tests check that apid is running #9399

Merged
merged 2 commits into from
Aug 2, 2021

Conversation

noise-kngdm
Copy link
Contributor

Related issue
Closes #9245

Description

Hello team,
this PR modifies the way the API integration tests check how apid is running in order to avoid a race condition which made them fail sometimes in the testing environment.

Tests performed

Unit tests

============================= test session starts ==============================
platform linux -- Python 3.9.6, pytest-5.0.0, py-1.10.0, pluggy-0.13.1
rootdir: /home/gonzz/git/wazuh
collected 1815 items

framework/wazuh/core/cluster/tests/test_cluster.py ...................   [  1%]
framework/wazuh/core/cluster/tests/test_common.py .......                [  1%]
framework/wazuh/core/cluster/tests/test_control.py sssss                 [  1%]
framework/wazuh/core/cluster/tests/test_local_client.py .                [  1%]
framework/wazuh/core/cluster/tests/test_utils.py .......                 [  2%]
framework/wazuh/core/cluster/tests/test_worker.py ............sss.s      [  3%]
framework/wazuh/core/cluster/dapi/tests/test_dapi.py ................... [  4%]
....                                                                     [  4%]
framework/wazuh/core/tests/test_active_response.py ..............        [  5%]
framework/wazuh/core/tests/test_agent.py ............................... [  6%]
........................................................................ [ 10%]
...............................................................          [ 14%]
framework/wazuh/core/tests/test_cdb_list.py ............................ [ 15%]
..........                                                               [ 16%]
framework/wazuh/core/tests/test_common.py .......                        [ 16%]
framework/wazuh/core/tests/test_configuration.py ....................... [ 18%]
.............                                                            [ 18%]
framework/wazuh/core/tests/test_decoder.py ................              [ 19%]
framework/wazuh/core/tests/test_input_validator.py ...                   [ 19%]
framework/wazuh/core/tests/test_logtest.py ..                            [ 19%]
framework/wazuh/core/tests/test_manager.py ...............               [ 20%]
framework/wazuh/core/tests/test_mitre.py .............                   [ 21%]
framework/wazuh/core/tests/test_pyDaemonModule.py .....                  [ 21%]
framework/wazuh/core/tests/test_results.py ............................. [ 23%]
...........                                                              [ 23%]
framework/wazuh/core/tests/test_rootcheck.py ..........                  [ 24%]
framework/wazuh/core/tests/test_rule.py ......................           [ 25%]
framework/wazuh/core/tests/test_stats.py ....                            [ 25%]
framework/wazuh/core/tests/test_syscollector.py ...                      [ 26%]
framework/wazuh/core/tests/test_utils.py ............................... [ 27%]
........................................................................ [ 31%]
........................................................................ [ 35%]
.....................................................                    [ 38%]
framework/wazuh/core/tests/test_vulnerability.py .                       [ 38%]
framework/wazuh/core/tests/test_wazuh_queue.py ..................        [ 39%]
framework/wazuh/core/tests/test_wazuh_socket.py ....................     [ 40%]
framework/wazuh/core/tests/test_wdb.py ......................            [ 41%]
framework/wazuh/tests/test_active_response.py ............               [ 42%]
framework/wazuh/tests/test_agent.py .................................... [ 44%]
........................................................................ [ 48%]
.                                                                        [ 48%]
framework/wazuh/tests/test_cdb_list.py ................................. [ 50%]
....................                                                     [ 51%]
framework/wazuh/tests/test_ciscat.py .................................   [ 53%]
framework/wazuh/tests/test_cluster.py .....ss                            [ 53%]
framework/wazuh/tests/test_decoder.py .................................. [ 55%]
.                                                                        [ 55%]
framework/wazuh/tests/test_group.py ........                             [ 56%]
framework/wazuh/tests/test_logtest.py ......                             [ 56%]
framework/wazuh/tests/test_manager.py .................................. [ 58%]
..                                                                       [ 58%]
framework/wazuh/tests/test_mitre.py .......                              [ 58%]
framework/wazuh/tests/test_rootcheck.py ................................ [ 60%]
..................                                                       [ 61%]
framework/wazuh/tests/test_rule.py ..................................... [ 63%]
...................                                                      [ 64%]
framework/wazuh/tests/test_sca.py .......                                [ 65%]
framework/wazuh/tests/test_security.py ................................. [ 66%]
...........................................                              [ 69%]
framework/wazuh/tests/test_stats.py ................                     [ 70%]
framework/wazuh/tests/test_syscheck.py .......................           [ 71%]
framework/wazuh/tests/test_syscollector.py ............                  [ 72%]
framework/wazuh/tests/test_task.py ............................          [ 73%]
framework/wazuh/tests/test_vulnerability.py ..........................   [ 75%]
api/api/test/test_alogging.py ..........                                 [ 75%]
api/api/test/test_authentication.py ..........                           [ 76%]
api/api/test/test_configuration.py ..................................... [ 78%]
.....                                                                    [ 78%]
api/api/test/test_util.py ...................................            [ 80%]
api/api/test/test_validator.py ......................................... [ 82%]
........................................................................ [ 86%]
................                                                         [ 87%]
framework/wazuh/rbac/tests/test_auth_context.py ..                       [ 87%]
framework/wazuh/rbac/tests/test_decorators.py .......................... [ 89%]
........................................................................ [ 93%]
.......                                                                  [ 93%]
framework/wazuh/rbac/tests/test_default_configuration.py ............... [ 94%]
........................................                                 [ 96%]
framework/wazuh/rbac/tests/test_orm.py ................................. [ 98%]
.....................                                                    [ 99%]
framework/wazuh/rbac/tests/test_preprocessor.py ...........              [100%]

======= 1803 passed, 11 skipped, 29 warnings in 169.87 seconds =======

Integration tests

Collected tests [9]:
test_rbac_black_syscheck_endpoints.tavern.yaml, test_rbac_black_syscollector_endpoints.tavern.yaml, test_rbac_black_vulnerability_endpoints.tavern.yaml, test_rbac_white_syscheck_endpoints.tavern.yaml, test_rbac_white_syscollector_endpoints.tavern.yaml, test_rbac_white_vulnerability_endpoints.tavern.yaml, test_syscheck_endpoints.tavern.yaml, test_syscollector_endpoints.tavern.yaml, test_vulnerability_endpoints.tavern.yaml


test_rbac_black_syscheck_endpoints.tavern.yaml 
	 4 passed, 1 warnings

test_rbac_black_syscollector_endpoints.tavern.yaml 
	 9 passed, 1 warnings

test_rbac_black_vulnerability_endpoints.tavern.yaml 
	 1 passed, 1 warnings

test_rbac_white_syscheck_endpoints.tavern.yaml 
	 4 passed, 1 warnings

test_rbac_white_syscollector_endpoints.tavern.yaml 
	 9 passed, 1 warnings

test_rbac_white_vulnerability_endpoints.tavern.yaml 
	 1 passed, 1 warnings

test_syscheck_endpoints.tavern.yaml 
	 35 passed, 1 warnings

test_syscollector_endpoints.tavern.yaml 
	 159 passed, 1 warnings

test_vulnerability_endpoints.tavern.yaml 
	 1 passed, 1 warnings

Regards,
Gonzalo.

@noise-kngdm noise-kngdm self-assigned this Jul 26, 2021
@noise-kngdm noise-kngdm changed the title Fix/9245 api integration tests sslerror Fixed the way the API integration tests check that apid is running Jul 26, 2021
Copy link
Contributor

@Selutario Selutario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

Fix SSLError in API integration tests
3 participants