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

Refactor of vulnerability detector testing framework structure #2474

Merged
merged 24 commits into from
Jan 25, 2022

Conversation

jmv74211
Copy link
Contributor

Related issue
close #2462

Description

This PR adds some changes to refactor the structure of methods and variables used in the testing framework for vulnerability detector.

All the functionality of vulnerability_detector.py has now been separated into independent and reusable modules. The entire data access layer has also been separated, using a new database interface.

The new structure is as follows:

__init__.py

db_interface/
├── agent_db.py
├── cve_db.py
├── global_db.py
└── __init__.py

modules/
├── __init__.py
└── vulnerability_detector
    ├── event_monitor.py
    ├── __init__.py
    └── utils.py

processes/
└── __init__.py

Tests

  • Proven that tests pass when they have to pass.

All non-disabled vulnerability_detector tests have been modified according to this new structure.

========================================= test session starts ==========================================
platform linux -- Python 3.6.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /mnt/qa/tests/integration, configfile: pytest.ini
plugins: metadata-1.11.0, testinfra-5.0.0, html-3.1.1
collected 2571 items                                                                                   

...

============================= 58 passed, 2513 skipped in 301.11s (0:05:01) =============================

jmv74211 and others added 24 commits January 24, 2022 09:17
- agent_db
- cve_db
- global_db
- test_validate_feed_content
- test_general_settings_retry_interval
- test_full_scan_type
@jmv74211 jmv74211 self-assigned this Jan 25, 2022
@jmv74211 jmv74211 merged commit 8f5fbbe into dev-cves-alerts-inventory Jan 25, 2022
@jmv74211 jmv74211 deleted the 2462-vuln-module-refactor branch January 25, 2022 15:42
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.

2 participants