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

Fix 'test_general_settings/test_general_settings_ignore_time' tests in 4.2 #1644

Closed
4 tasks
Tracked by #1531
mdengra opened this issue Jul 26, 2021 · 2 comments
Closed
4 tasks
Tracked by #1531

Comments

@mdengra
Copy link
Contributor

mdengra commented Jul 26, 2021

Issue information

Related issue
Closes #1531

When it comes to starting with the test fix, there is some information that can help you:

Module: Vulnerability Detector
Support Team:  "binary beasts"
Target: Manager   
OS: Linux

I add some information obtained while researched the logs that failed.

Case:

Type Description
Test Path test_general_settings/test_general_settings_ignore_time
Consistent yes
Test Execution 3/3 executions failed
Cases Fails 3
Summary Error when inserting the testing vulnerability by the prepare_agent fixture due to missing VULNERABILITIES table.
In order to finish this issue the following tasks should be fulfilled:
  • Research of fails.
  • Apply Fix
  • Full Green/ Full Yellow in test_general_settings/test_general_settings_ignore_time for 3 times.
  • Documentation of any important change done for these tests or the used tools.
@mdengra
Copy link
Contributor Author

mdengra commented Jul 26, 2021

2021-07-26

Used Wazuh-QA branch: 1531-full-yellow-vuln-det
Test results with the default settings in the ossec.conf:

Test Executions Date By Status
test_general_settings_ignore_time_local_r1.log 2021-07-26 Miguel 🔴
test_general_settings_ignore_time_local_r2.log 2021-07-26 Miguel 🔴
test_general_settings_ignore_time_local_r3.log 2021-07-26 Miguel 🔴

The error is always the same:

==================================== ERRORS ====================================
____________ ERROR at setup of test_ignore_time[get_configuration0] ____________

mock_agent = '001'

    @pytest.fixture(scope='module')
    def prepare_agent(mock_agent):
        control_service('stop', daemon='wazuh-db')
    
        vd.clean_vd_tables(mock_agent)
        vd.insert_package(agent=mock_agent, vendor="Red Hat, Inc.")
>       vd.insert_vulnerability()
.
.
.
        connect = sqlite3.connect(db_path)
    
        try:
            with connect:
                for item in query_list:
>                   connect.execute(item)
E                   sqlite3.OperationalError: no such table: VULNERABILITIES

/usr/local/lib/python3.6/site-packages/wazuh_testing/vulnerability_detector.py:209: OperationalError

@damarisg
Copy link
Member

After merging #1650, it works successfully.

Test Results:

Test Executions Date By Status
YellowGeneralSettingIgnoreTime.log 2021-07-26 Seyla 🟡
YellowGeneralSettingIgnoreTime2.log 2021-07-26 Seyla 🟡
YellowGeneralSettingIgnoreTime3.log) 2021-07-26 Seyla 🟡

juliamagan pushed a commit that referenced this issue Sep 30, 2021
fix: Clear log file before run each use case

Closes: #1644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants