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

Tests to check cpe_helper.json file #3731

Merged
merged 15 commits into from
Jan 25, 2023
Merged

Tests to check cpe_helper.json file #3731

merged 15 commits into from
Jan 25, 2023

Conversation

fedepacher
Copy link
Contributor

@fedepacher fedepacher commented Jan 6, 2023

Related issue
#796

Description

This PR aims to add tests to check if cpe_helper.json dictionary works correctly with the different options.
The tests that have been added test wrong tags and values in the cpe_helper.json file. The respective test that check for right tags and values is test_cpe_indexing.py that already exist in the repository under the test_vulnerability_detector/test_feed folder.

Added

  • custom_generic_cpe_helper.json
  • configuration_cpe_indexing.yaml
  • cases_cpe_indexing_missing_fields.yaml
  • cases_cpe_indexing_wrong_tags.yaml
  • cases_cpe_indexing_wrong_values.yaml
  • test_cpe_helper.py

Testing performed

Tester Test path Jenkins Local OS Commit Notes
@fedepacher (Developer) 🟢 ⚫⚫⚫ Nothing to highlight
@Rebits (Reviewer) ⚫⚫⚫ ⚫⚫⚫ Nothing to highlight

@fedepacher fedepacher requested a review from Rebits January 6, 2023 18:08
@fedepacher fedepacher self-assigned this Jan 6, 2023
Copy link
Member

@Rebits Rebits left a comment

Choose a reason for hiding this comment

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

GJ. Some changes are required

Copy link
Contributor

@jmv74211 jmv74211 left a comment

Choose a reason for hiding this comment

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

test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Indexing CPE helper with wrong source vendor fields] PASSED [  5%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Indexing CPE helper with wrong translation product fields] PASSED [ 10%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Indexing CPE helper with wrong version field] PASSED [ 15%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Indexing CPE helper with wrong format_version fields] PASSED [ 20%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Indexing CPE helper with wrong update_date fields] PASSED [ 25%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Indexing CPE helper with wrong target field] PASSED [ 30%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong version value] PASSED [ 35%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong update_date value] PASSED [ 40%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong target value] PASSED [ 45%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong format_version value] PASSED [ 50%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong source vendor value] PASSED [ 55%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong source product value] PASSED [ 60%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Indexing CPE helper with wrong action value] PASSED                                                          [ 65%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing version field] PASSED                                                      [ 70%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing format_version field] PASSED                                               [ 75%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing update_date field] PASSED                                                  [ 80%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing target field] PASSED                                                       [ 85%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing action field] PASSED                                                       [ 90%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing vendor field] PASSED                                                       [ 95%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Indexing CPE helper with missing product field] PASSED                                                      [100%]

========================================================================================= 20 passed in 727.09s (0:12:07

@jmv74211 jmv74211 merged commit e743deb into 4.4 Jan 25, 2023
@jmv74211 jmv74211 deleted the 796-test-cpe-helper branch January 25, 2023 15:19
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.

3 participants