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

Deprecate the usage of the ossec-init.conf file from the whole qa repository #1007

Closed
DProvinciani opened this issue Jan 12, 2021 · 6 comments · Fixed by #1013
Closed

Deprecate the usage of the ossec-init.conf file from the whole qa repository #1007

DProvinciani opened this issue Jan 12, 2021 · 6 comments · Fixed by #1013
Assignees
Milestone

Comments

@DProvinciani
Copy link
Contributor

Description

Description

As part of the epic wazuh/wazuh#7054, we have the main goal of removing the /etc/ossec-init.conf file from the Wazuh installations. Having said that, the next set of files should be updated to stop making use of that file in this Wazuh QA repository.

    - deps/wazuh_testing/wazuh_testing/tools/__init__.py
    - tests/integration/test_wpk/test_wpk_agent.py
    - tests/integration/test_wpk/test_wpk_manager.py
    - tests/integration/test_sca/test_basic_usage/data/sca_directories_test_suite.yml

If the information provided by ossec-init.conf is mandatory for the tests, this can be obtained from the wazuh-control script as it is explained in the issue wazuh/wazuh#7081.

@DProvinciani
Copy link
Contributor Author

Here a summary of the tests failures generated in the automated tests because of the removal of the ossec-init.conf file.

  • Services test cases (for both manager and agent)
[2021-01-15T13:58:10.663Z] �[0;31mImportError while loading conftest '/wazuh-qa/tests/integration/conftest.py'.�[0m
[2021-01-15T13:58:10.663Z] �[0;31m/wazuh-qa/tests/integration/conftest.py:19: in <module>�[0m
[2021-01-15T13:58:10.663Z] �[0;31m    from wazuh_testing.tools import LOG_FILE_PATH, WAZUH_CONF, WAZUH_SERVICE, ALERT_FILE_PATH�[0m
[2021-01-15T13:58:10.663Z] �[0;31mE   ImportError: cannot import name 'WAZUH_SERVICE'�[0m

This is because of the import of WAZUH_SERVICE. It will try to read the ossec-init.conf file and will fail.

  • Version check test cases
============================= test session starts ==============================
platform linux -- Python 3.8.2, pytest-5.4.1, py-1.9.0, pluggy-0.13.1 -- /usr/testing/bin/python3.8
cachedir: .pytest_cache
rootdir: /install_manager
collecting ... collected 14 items

install_manager_test.py::test_check_version FAILED                       [  7%]
install_manager_test.py::test_check_process_clusterd PASSED              [ 14%]
install_manager_test.py::test_check_process_modulesd PASSED              [ 21%]
install_manager_test.py::test_check_process_monitord PASSED              [ 28%]
install_manager_test.py::test_check_process_logcollector PASSED          [ 35%]
install_manager_test.py::test_check_process_remoted PASSED               [ 42%]
install_manager_test.py::test_check_process_syscheckd PASSED             [ 50%]
install_manager_test.py::test_check_process_analysisd PASSED             [ 57%]
install_manager_test.py::test_check_process_maild PASSED                 [ 64%]
install_manager_test.py::test_check_process_execd PASSED                 [ 71%]
install_manager_test.py::test_check_process_wazuhdb PASSED               [ 78%]
install_manager_test.py::test_check_log_errors PASSED                    [ 85%]
install_manager_test.py::test_check_ossec_conf PASSED                    [ 92%]
install_manager_test.py::test_connection_manager PASSED                  [100%]

=================================== FAILURES ===================================
______________________________ test_check_version ______________________________
install_manager_test.py:42: in test_check_version
    f = open('/var/ossec/etc/ossec-init.conf', 'r')
E   FileNotFoundError: [Errno 2] No such file or directory: '/var/ossec/etc/ossec-init.conf'
=========================== short test summary info ============================
FAILED install_manager_test.py::test_check_version - FileNotFoundError: [Errn...
========================= 1 failed, 13 passed in 0.08s =========================

@spothound
Copy link
Contributor

spothound commented Jan 27, 2021

I'm working on this issue.

Related issue

TODO

Branches

  • QA: 1007-init-conf
  • Jenkins: 2243-init-conf

@spothound
Copy link
Contributor

spothound commented Jan 27, 2021

We've detected some problems in the wazuh-packages branch wazuh/wazuh-packages#609

I'm going to fix them and notify the development team to continue with this issue.

The required changes have been added: wazuh/wazuh-packages#609 (comment)

And tested: https://ci.wazuh.info/job/PR_wazuh/6719/

@spothound
Copy link
Contributor

spothound commented Jan 28, 2021

Required testing

@spothound
Copy link
Contributor

@BraulioV BraulioV added the qa label Feb 2, 2021
@spothound
Copy link
Contributor

spothound commented Feb 5, 2021

We've merged last changes from master and make a required fix.

Testing

Packages

manager: https://ci.wazuh.info/view/Packages/job/Packages_builder/35226/console
agent: https://ci.wazuh.info/view/Packages/job/Packages_builder/35227/console

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 a pull request may close this issue.

3 participants