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

Wazuh agentless_cluster system tests are failing due to changes in token_response['json']['data']['token'] in API /security/user/authenticate endpoint #4762

Closed
pro-akim opened this issue Dec 12, 2023 · 10 comments
Assignees
Labels

Comments

@pro-akim
Copy link
Member

pro-akim commented Dec 12, 2023

Running system test in v4.8.0-alpha1
In agentless_cluster environment was possible to detect some issues:

In some of the following tests:

test_jwt_invalidation/test_revoke_endpoint.py
test_jwt_invalidation/test_change_security_resources.py
test_jwt_invalidation/test_change_rbac_mode.py
test_jwt_invalidation/test_update_password.py

The following error message was detected:

        Returns:
            API token (str): Usable API token.
        """
        login_endpoint = '/security/user/authenticate'
        login_method = 'POST'
        login_body = ''
        if auth_context is not None:
            login_endpoint = '/security/user/authenticate/run_as'
            login_body = 'body="{}"'.format(json.dumps(auth_context).replace('"', '\\"').replace(' ', ''))
    
        try:
            token_response = self.get_host(host).ansible('uri', f"url=https://localhost:{port}{login_endpoint} "
                                                                f"user={user} password={password} "
                                                                f"method={login_method} {login_body} validate_certs=no "
                                                                f"force_basic_auth=yes",
                                                         check=check)
            return token_response['json']['data']['token']
        except KeyError:
>           raise KeyError(f'Failed to get token: {token_response}')
E           KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '65', 'content_type': 'application/problem+json; charset=utf-8', 'date': 'Mon, 11 Dec 2023 10:43:15 GMT', 'elapsed': 0, 'msg': 'Status code was 400 and not [200]: HTTP Error 400: Bad Request', 'redirected': False, 'status': 400, 'url': 'https://localhost:55000/security/user/authenticate/run_as'}"

On the other hand, in test_jwt_invalidation/test_update_password.py, the following variation of the message:

    def get_api_token(self, host, user='wazuh', password='wazuh', auth_context=None, port=55000, check=False):
        """Return an API token for the specified user.
    
        Args:
            host (str): Hostname.
            user (str, optional): API username. Default `wazuh`
            password (str, optional): API password. Default `wazuh`
            auth_context (dict, optional): Authorization context body. Default `None`
            port (int, optional): API port. Default `55000`
            check (bool, optional): Ansible check mode("Dry Run"),
                by default it is enabled so no changes will be applied. Default `False`
    
        Returns:
            API token (str): Usable API token.
        """
        login_endpoint = '/security/user/authenticate'
        login_method = 'POST'
        login_body = ''
        if auth_context is not None:
            login_endpoint = '/security/user/authenticate/run_as'
            login_body = 'body="{}"'.format(json.dumps(auth_context).replace('"', '\\"').replace(' ', ''))
    
        try:
            token_response = self.get_host(host).ansible('uri', f"url=https://localhost:{port}{login_endpoint} "
                                                                f"user={user} password={password} "
                                                                f"method={login_method} {login_body} validate_certs=no "
                                                                f"force_basic_auth=yes",
                                                         check=check)
            return token_response['json']['data']['token']
        except KeyError:
>           raise KeyError(f'Failed to get token: {token_response}')
E           KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '59', 'content_type': 'application/problem+json; charset=utf-8', 'date': 'Mon, 11 Dec 2023 10:44:58 GMT', 'elapsed': 0, 'msg': 'Status code was 401 and not [200]: HTTP Error 401: Unauthorized', 'redirected': False, 'status': 401, 'url': 'https://localhost:55000/security/user/authenticate/run_as'}"

/usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/system.py:229: KeyError

Reports are here:
report_agentless_cluster.zip

Research should be done to see if the API is failing or there were some changes in the endpoint that should be changed in the test

@pro-akim
Copy link
Member Author

Update

/security/user/authenticate/run_as seems to be the issue.
Those tests that does not include the mentioned method are working ok.

When the mentioned method is being used with the following input:

user=wazuh-wui password=wazuh-wui method=POST body="{\"username\":\"elastic\"}" validate_certs=no force_basic_auth=yes check=False

The test is failing showing the following message:

{'changed': False, 'connection': 'close', 'content_length': '65', 'content_type': 'application/problem+json; charset=utf-8', 'date': 'Mon, 18 Dec 2023 16:11:47 GMT', 'elapsed': 0, 'msg': 'Status code was 400 and not [200]: HTTP Error 400: Bad Request', 'redirected': False, 'status': 400, 'url': 'https://localhost:55000/security/user/authenticate/run_as'}

@pro-akim
Copy link
Member Author

pro-akim commented Dec 18, 2023

Update

In wazuh v4.7.0

Request parameters:

url=https://localhost:55000/security/user/authenticate/run_as user=testing_user password=Testing1* method=POST body="{\"username\":\"testing\"}" validate_certs=no force_basic_auth=yes check=False

Response

{'cache_control': 'no-cache, no-store, must-revalidate, max-age=0', 'changed': False, 'connection': 'close', 'content_length': '515', 'content_security_policy': 'none', 'content_type': 'application/json; charset=utf-8', 'cookies': {}, 'cookies_string': '', 'date': 'Mon, 18 Dec 2023 16:44:26 GMT', 'elapsed': 0, 'expires': '0', 'json': {'data': {'token': 'eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzAyOTE3ODY2LCJleHAiOjE3MDI5MTg3NjYsInN1YiI6InRlc3RpbmdfdXNlciIsInJ1bl9hcyI6dHJ1ZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSIsImhhc2hfYXV0aF9jb250ZXh0IjoiZjQ0ODVkMGYzM2Y4ZjFlMmZiNGIxYjA4NTI2OTFiYTMifQ.AFRTyfMUI643QLpyeWjvEe7lbdMBRHbyZvvadJv0iBGx3v6h-YWjeV9ceGI9IYL-JO0N9tcsrYRh06sIRlOiYacwAEzSUlQq_Qbh8Szj-rbae3779eSvQSZMrHrCGwrQAVfO-RfzQgxFJmTdRfd9-lss1VRdHgX94RUH7ojFuifCndT6'}, 'error': 0}, 'msg': 'OK (515 bytes)', 'pragma': 'no-cache', 'redirected': False, 'referrer_policy': 'no-referrer, strict-origin-when-cross-origin', 'status': 200, 'strict_transport_security': 'max-age=63072000; includeSubdomains', 'url': 'https://localhost:55000/security/user/authenticate/run_as', 'x_content_type_options': 'nosniff', 'x_frame_options': 'DENY', 'x_xss_protection': '1; mode=block'} 

@pro-akim
Copy link
Member Author

pro-akim commented Dec 19, 2023

Update

Manually testing, the endpoint /security/user/authenticate/run_as worked in v4.8.0-alpha1

curl -k -u sales-member-1:Sales-Member-1 -X POST https://localhost:55000/security/user/authenticate/run_as -H 'content-type: application/json' -d '{
        "name": "Initial_auth",
        "auth": {
                "name": "Bill",
                "office": ["20", "21", "30"]
        }
}'

root@wazuh-master: ~# curl -k -X POST "https://localhost:55000/security/users?pretty=true" -H  "accept: application/json" -H  "Authorization: Bearer $TOKEN" -H  "Content-Type: application/json" -d "{\"username\":\"sales-member-1\",\"password\":\"Sales-Member-1\"}"
{
   "data": {
      "affected_items": [
         {
            "id": 100,
            "username": "sales-member-1",
            "allow_run_as": false,
            "roles": []
         }
      ],
      "total_affected_items": 1,
      "total_failed_items": 0,
      "failed_items": []
   },
   "message": "User was successfully created",
   "error": 0
}

root@wazuh-master: ~# curl -k -X PUT "https://localhost:55000/security/users/100/run_as?allow_run_as=true" -H  "Authorization: Bearer $TOKEN"

{"data": {"affected_items": [{"id": 100, "username": "sales-member-1", "allow_run_as": true, "roles": []}], "total_affected_items": 1, "total_failed_items": 0, "failed_items": []}, "message": "Parameter allow_run_as has been enabled for the user", "error": 0}root@wazuh-master: ~# curl -k -X PUT "https://localhost:55000/security/users/100/run_as?allow_run_as=root@wazuh-master: ~# curl -k -X GET "https://localhost:55000/security/users?pretty=true" -H  "accept: application/json" -H  "Authorization: Bearer $TOKEN" -H  "Content-Type: application/json"    
{
   "data": {
      "affected_items": [
         {
            "id": 1,
            "username": "wazuh",
            "allow_run_as": true,
            "roles": [
               1
            ]
         },
         {
            "id": 2,
            "username": "wazuh-wui",
            "allow_run_as": true,
            "roles": [
               1
            ]
         },
         {
            "id": 100,
            "username": "sales-member-1",
            "allow_run_as": true,
            "roles": []
         }
      ],
      "total_affected_items": 3,
      "total_failed_items": 0,
      "failed_items": []
   },
   "message": "All specified users were returned",
   "error": 0
}

root@wazuh-master: ~# curl -k -u sales-member-1:Sales-Member-1 -X POST https://localhost:55000/security/user/authenticate/run_as -H 'content-type: application/json' -d '{
>         "name": "Initial_auth",
>         "auth": {
>                 "name": "Bill",
>                 "office": ["20", "21", "30"]
>         }
> }'
{"data": {"token": "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzAyOTc3MTUxLCJleHAiOjE3MDI5NzgwNTEsInN1YiI6InNhbGVzLW1lbWJlci0xIiwicnVuX2FzIjp0cnVlLCJyYmFjX3JvbGVzIjpbXSwicmJhY19tb2RlIjoid2hpdGUiLCJoYXNoX2F1dGhfY29udGV4dCI6IjY2YTI4ZWZiNWY4ZGIyZTkzZGEyYjVmYjEwN2JlYzM1In0.AZSV_ExIt6o9kwNqfvShEDLzPBufjAlZGhnUq1iNUTqBa8ld3MGeNMOwVVSrppf0ShluB5Tl0sMphkl16LYb6MpqAUrPL3Xlo0PA5RI_8UrczOymtBhZGKq3VOluLcrBVm0jCuNLFZwVskoZQTuMroFPor_GYiZT92IoDjLIyGKo3gze"}, "error": 0}

However, some changes in the function of the endpoint could happen.

@pro-akim
Copy link
Member Author

pro-akim commented Dec 19, 2023

Update

When the infrastructure is freshly deployed (Wazuh and Wazuh-qa v4.8.0-alpha1):

root@wazuh-master: ~# curl -k -u wazuh-wui:wazuh-wui -X POST https://localhost:55000/security/user/authenticate/run_as -H 'content-type: application/json' -d '{"username":"elastic"}'
{"data": {"token": "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzAyOTg2NzY4LCJleHAiOjE3MDI5ODc2NjgsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6dHJ1ZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSIsImhhc2hfYXV0aF9jb250ZXh0IjoiN2UzYmQ3YzVlYTBlMDdiZWIzNGU5ZGJlZjcwZWFlNmQifQ.AHpyT6yy-a30VcUT7OOeWdXUIhB46L76R07oWbHVQHHglQm8O4sLf0ls1GjmtKxl8dbUAs-kr1pqjX8KeERM0ejeAP_c0wqT_B6imSY-fS_PKRccrSj-rCvfG7cCIeyq-Ql5oxkmb88-r-HMnTsis9VDzigPOjFY1zA2otqQ_YZyqLlb"}, "error": 0}

After running tests (all related to run_as method have failed)

root@wazuh-master: ~# curl -k -u wazuh-wui:wazuh-wui -X POST https://localhost:55000/security/user/authenticate/run_as -H 'content-type: application/json' -d '{"username":"elastic"}'
curl: (7) Failed to connect to localhost port 55000: Connection refused

API logs did not show any relevant log:


2023/12/19 14:07:33 INFO: Checking RBAC database integrity...
2023/12/19 14:07:33 INFO: /var/ossec/api/configuration/security/rbac.db file was detected
2023/12/19 14:07:33 INFO: RBAC database integrity check finished successfully
2023/12/19 14:07:36 INFO: Listening on 0.0.0.0:55000..

After several repetitions, the following observations were made:

At times:

cat /var/ossec/api/configuration/api.yaml
''

Other times:

root@wazuh-master: ~# cat /var/ossec/api/configuration/api.yaml
access:
  max_login_attempts: 9998

When api.yaml is empty (''), the API responds as described before. However, when it contains content, the API still responds to manual API calls:

root@wazuh-master: ~# curl -k -u wazuh-wui:wazuh-wui -X POST https://localhost:55000/security/user/authenticate/run_as -H 'content-type: application/json' -d '{"username":"elastic"}'
{"data": {"token": "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzAyOTk1NTE3LCJleHAiOjE3MDI5OTY0MTcsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6dHJ1ZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSIsImhhc2hfYXV0aF9jb250ZXh0IjoiN2UzYmQ3YzVlYTBlMDdiZWIzNGU5ZGJlZjcwZWFlNmQifQ.ASAIiUAjnqkMnTRBKOFn8cEmKBRAJ_xELUa3KhR32o1-mZI6gCSwM2-2oTkuRXUJIpZDu_Z_dhL4vCEDfCRAJn0vAbX_T-sIsSymgOwOf20Bawd6tfD2LJQB0QEd5MMLHhhEXmPjfvKwoUGt9z1nMZt-mEgbtK34jtdYILvXW22XFGIb"}, "error": 0}

If I replace '' with content, there's a delay in response.

Despite these changes, running the tests leads to API failures (which don't occur in version v4.7.0). Testing Wazuh v4.7.0 with Wazuh-QA v4.8.0-alpha1 doesn't show failures, indicating that the testing framework is still functioning correctly. Report is attached here:
report_4.7.0.zip

@pro-akim
Copy link
Member Author

pro-akim commented Dec 19, 2023

Summary

  1. Wazuh 4.7.0 is functioning properly, and tests with both Wazuh-qa v4.7.0 and v4.8.0-alpha1 have passed successfully.
  2. Wazuh v4.8.0-alpha1 exhibits certain erratic behaviors in the API at the endpoint /security/user/authenticate/run_as. All agentless_cluster tests using that method have failed because attempting to obtain the token resulted in a status_code=400 and 401.
  3. During manual tests, the method has been observed to function correctly. However, after running the tests (where only the token retrieval method with the conflicting endpoint is executed), it starts failing, showing connection issues.
  4. No relevant records have been observed in the api.log logs.
  5. Checking cat /var/ossec/api/configuration/api.yaml, it has been noticed that at times, it's empty, and at other times, it contains content. When the correct content is present, the token can be obtained manually. However, during test execution, the tests fail to obtain the token.
  6. When replacing the empty content of api.yaml with YAML-like content, token retrieval is restored after a waiting period. However, the automated tests continue to fail consistently.
  7. To ensure that the tests are functioning properly, Wazuh v4.7.0 is re-run with Wazuh-qa v4.8.0-alpha1, and all tests pass satisfactorily.

Some research over Wazuh v4.8.0 security/user/authenticate/run_as should be done

@Deblintrake09
Copy link
Contributor

Research seems to imply some kind of change or error in the 4.8.0-alpha1 API and not in the tests themselves.
I would recommend this issue be blocked until the research in issue #20947 is completed.

@wazuhci wazuhci moved this from In review to Pending final review in Release 4.8.0 Dec 19, 2023
@wazuhci wazuhci moved this from Pending final review to Blocked in Release 4.8.0 Dec 20, 2023
@wazuhci wazuhci moved this from Blocked to In progress in Release 4.8.0 Jan 3, 2024
@pro-akim
Copy link
Member Author

pro-akim commented Jan 3, 2024

Update

After the fixes provided in #4797, I ran the agentless_cluster tests, but the results did not change.

agentless_retest.zip

--------------------------------------------------------------- generated html file: file:///home/akim/Desktop/wazuh-qa/tests/system/report_agentless.html ---------------------------------------------------------------
================================================================================================ short test summary info =================================================================================================
FAILED test_jwt_invalidation/test_change_rbac_mode.py::test_change_rbac_mode_with_endpoint[login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '65', 'conten...
FAILED test_jwt_invalidation/test_change_rbac_mode.py::test_change_rbac_mode_manually[login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '65', 'content_typ...
FAILED test_jwt_invalidation/test_change_security_resources.py::test_change_user_policy_and_role[wazuh-master-wazuh-worker1-login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close'...
FAILED test_jwt_invalidation/test_change_security_resources.py::test_change_user_policy_and_role[wazuh-worker1-wazuh-worker2-login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close...
FAILED test_jwt_invalidation/test_revoke_endpoint.py::test_revoke_all_tokens_with_api[wazuh-master-login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '65',...
FAILED test_jwt_invalidation/test_revoke_endpoint.py::test_revoke_all_tokens_with_api[wazuh-worker1-login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '65'...
FAILED test_jwt_invalidation/test_revoke_endpoint.py::test_revoke_all_tokens_with_api[wazuh-worker2-login_endpoint1] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_length': '65'...
FAILED test_jwt_invalidation/test_update_password.py::test_update_password[login_endpoint2-wazuh-master-Newpass2*-Newpass1*] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_lengt...
FAILED test_jwt_invalidation/test_update_password.py::test_update_password[login_endpoint3-wazuh-worker1-Newpass1*-Newpass2*] - KeyError: "Failed to get token: {'changed': False, 'connection': 'close', 'content_leng...
========================================================================= 9 failed, 15 passed, 168 deselected, 5 warnings in 1826.33s (0:30:26) ==========================================================================

If the research conducted by @wazuh/core confirms that the product worked fine, the test will be adjusted to the new condition.


On the other hand.. running the test as it in the PR where changes have been done, the same tests have worked:

akim@akim-PC:~/Desktop/wazuh-qa/tests/system/test_jwt_invalidation$ python3 -m pytest . --html=report2.html
=================================================================================== test session starts ===================================================================================
platform linux -- Python 3.10.12, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/akim/Desktop/wazuh-qa/tests/system, configfile: pytest.ini
plugins: html-3.1.1, testinfra-5.0.0, metadata-2.0.4
collected 19 items                                                                                                                                                                        

test_change_rbac_mode.py ....                                                                                                                                                       [ 21%]
test_change_security_resources.py ....                                                                                                                                              [ 42%]
test_disconnected_nodes.py .                                                                                                                                                        [ 47%]
test_revoke_endpoint.py ......                                                                                                                                                      [ 78%]
test_update_password.py ....                                                                                                                                                        [100%]

----------------------------------------- generated html file: file:///home/akim/Desktop/wazuh-qa/tests/system/test_jwt_invalidation/report2.html -----------------------------------------
============================================================================= 19 passed in 895.28s (0:14:55) ==============================================================================

Running the tests from /wazuh-qa/tests/system/test_jwt_invalidation with python3 -m pytest . --html=report_wo_changes.html

akim@akim-PC:~/Desktop/wazuh-qa/tests/system/test_jwt_invalidation$ python3 -m pytest . --html=report_wo_changes.html
=================================================================================== test session starts ===================================================================================
platform linux -- Python 3.10.12, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/akim/Desktop/wazuh-qa/tests/system, configfile: pytest.ini
plugins: html-3.1.1, testinfra-5.0.0, metadata-2.0.4
collected 19 items                                                                                                                                                                        

test_change_rbac_mode.py ....                                                                                                                                                       [ 21%]
test_change_security_resources.py ....                                                                                                                                              [ 42%]
test_disconnected_nodes.py .                                                                                                                                                        [ 47%]
test_revoke_endpoint.py ......                                                                                                                                                      [ 78%]
test_update_password.py ....                                                                                                                                                        [100%]

------------------------------------ generated html file: file:///home/akim/Desktop/wazuh-qa/tests/system/test_jwt_invalidation/report_wo_changes.html ------------------------------------
============================================================================= 19 passed in 841.85s (0:14:01) ==============================================================================

Tests are working fine again, even if I am reversing the changes done in #4797

It seems that failure is related to the test run using environment as variable.


Creating a virtual environment using venv and running tests with a fresh installation of the 'wazuh-testing' dependency resulted in successful test execution. Changes have occurred in the dependency that made previous versions incompatible with 4.8.0.

akim@akim-PC:~/Desktop/wazuh-qa/tests/system$ python3 -m pytest -m agentless_cluster_env --html=report_wo_reinstall.html
======================================================================= test session starts ========================================================================
platform linux -- Python 3.10.12, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/akim/Desktop/wazuh-qa/tests/system, configfile: pytest.ini
plugins: html-3.1.1, testinfra-5.0.0, metadata-2.0.4
collected 192 items / 168 deselected / 24 selected                                                                                                                 

test_cluster/test_integrity_sync/test_integrity_sync.py ....                                                                                                 [ 16%]
test_cluster/test_ruleset_sync_status/test_ruleset_sync_status.py .                                                                                          [ 20%]
test_jwt_invalidation/test_change_rbac_mode.py ....                                                                                                          [ 37%]
test_jwt_invalidation/test_change_security_resources.py ....                                                                                                 [ 54%]
test_jwt_invalidation/test_disconnected_nodes.py .                                                                                                           [ 58%]
test_jwt_invalidation/test_revoke_endpoint.py ......                                                                                                         [ 83%]
test_jwt_invalidation/test_update_password.py ....                                                                                                           [100%]

========================================================================= warnings summary =========================================================================
../../../../.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:24
  /home/akim/.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:24: PytestUnknownMarkWarning: Unknown pytest.mark.win32 - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    WINDOWS = pytest.mark.win32

../../../../.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:25
  /home/akim/.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:25: PytestUnknownMarkWarning: Unknown pytest.mark.linux - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    LINUX = pytest.mark.linux

../../../../.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:26
  /home/akim/.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:26: PytestUnknownMarkWarning: Unknown pytest.mark.darwin - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    MACOS = pytest.mark.darwin

../../../../.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:27
  /home/akim/.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:27: PytestUnknownMarkWarning: Unknown pytest.mark.sunos5 - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    SOLARIS = pytest.mark.sunos5

../../../../.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:29
  /home/akim/.local/lib/python3.10/site-packages/wazuh_testing/modules/__init__.py:29: PytestUnknownMarkWarning: Unknown pytest.mark.agent - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    AGENT = pytest.mark.agent

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------- generated html file: file:///home/akim/Desktop/wazuh-qa/tests/system/report_wo_reinstall.html -----------------------------------
=================================================== 24 passed, 168 deselected, 5 warnings in 1936.73s (0:32:16) ====================================================

report_reinstall_deps.zip

@wazuhci wazuhci moved this from In progress to Pending review in Release 4.8.0 Jan 3, 2024
@pro-akim
Copy link
Member Author

pro-akim commented Jan 3, 2024

Summary

  1. Wazuh is working fine because it was tested.
  2. The issue was with the tests, but depending on how they were run, it either worked or not.
  3. Suspected that the problem lay in the incompatibility of the 'wazuh-testing' dependency on the local environment with the version being tested. It has been reinstalled the dependency and running the test as usual, and it worked.

No fixes are proposed as a conclusion. Dependencies should be checked before running a test. Fixes done in #4797 were not relevant to fix the issue.

@Deblintrake09
Copy link
Contributor

Considering the research done, the proposed conclusion is appropriate. It seems that it was a local issue instead of the repository or tests itself.

LGTM!

@wazuhci wazuhci moved this from Pending review to Pending final review in Release 4.8.0 Jan 3, 2024
@davidjiglesias
Copy link
Member

LGTM!

@wazuhci wazuhci moved this from Pending final review to Done in Release 4.8.0 Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants