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

Add test_providers cases for SUSE Linux Enterprise #2808

Closed
7 tasks done
damarisg opened this issue Apr 20, 2022 · 8 comments · Fixed by #2820
Closed
7 tasks done

Add test_providers cases for SUSE Linux Enterprise #2808

damarisg opened this issue Apr 20, 2022 · 8 comments · Fixed by #2820
Assignees

Comments

@damarisg
Copy link
Member

damarisg commented Apr 20, 2022

Related problem
#2792

Description

As part of #2792, it is necessary to add cases in the test_providers suite related to SUSE Linux Enterprise support for the Wazuh Vulnerability Detector module.

Suite test_providers

  • Test enabled/disabled: Check that the provider's feeds start downloading when activated.
  • Test missing os: Test the behavior when the tag is omitted. Check failure if the tag is required, and in case it is not, it starts downloading the feeds as normal
  • Test OS: Test that it starts downloading the feeds of the specified OS.
  • Test update from year: Test if the feed is updated from a specific date. If the option does not apply, check warning warning.
  • Test update interval: Test that the feed is updated at the specified interval

To Do

  • Add new custom SUSE feed
  • Add enabled/disabled tests
  • Add missing os tests.
  • Add OS tests.
  • Add update from year tests.
  • Add update interval tests.
  • Add SUSE OS to the test documentation
@CamiRomero
Copy link
Contributor

Task 1 - Add new custom SUSE feed

Create files in branch: 2792-add-support-for-SUSE-OVAL-in-Vulnerability-Detector

  • tests/integration/test_vulnerability_detector/data/feeds/suse/custom_suse_oval_feed.xml
  • tests/integration/test_vulnerability_detector/data/feeds/suse/custom_suse_oval_feed.xml.bz2
  • tests/integration/test_vulnerability_detector/data/feeds/suse/custom_suse_oval_feed.xml.gz

@CamiRomero
Copy link
Contributor

CamiRomero commented Apr 22, 2022

Task 2 - Add enabled/disabled tests

The test cases are in branch 2808-test-providers-for-suse-linux-enterprise

Added case in tests/integration/test_vulnerability_detector/test_providers/data/test_cases/cases_enabled.yaml:

  • name: 'SUSE Linux Enterprise Server 12'
    description: 'Test enabled SUSE Server 12'
    configuration_parameters:
    ENABLED: 'yes'
    PROVIDER: 'suse'
    OS: '12-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 12'

Result:

imagen

Added case in tests/integration/test_vulnerability_detector/test_providers/data/test_cases/cases_disabled.yaml:

  • name: 'SUSE Linux Enterprise Server 12'
    description: 'Test enabled SUSE Server 12'
    configuration_parameters:
    ENABLED: 'no'
    PROVIDER: 'suse'
    OS: '12-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 12'

Result:

imagen

@CamiRomero
Copy link
Contributor

Task 3 - Add missing os tests

The test cases are in branch 2808-test-providers-for-suse-linux-enterprise

Added case in tests/integration/test_vulnerability_detector/test_providers/data/test_cases/cases_missing_os.yaml

  • name: 'SUSE Linux Enterprise'
    description: 'SUSE Linux Enterprise provider'
    configuration_parameters:
    PROVIDER: 'suse'
    metadata:
    provider_name: 'SUSE Linux Enterprise'
    os: ['']

Result:

imagen

@CamiRomero
Copy link
Contributor

Task 4 - Add OS tests.

All the tests failed, I set up an environment and check manually the functionality and it work well. I run the test in a clean environment and the tests have passed.

Added 6 cases in tests/integration/test_vulnerability_detector/test_providers/data/test_cases/cases_os.yaml

  • name: 'SUSE Linux Enterprise Desktop 11'
    description: 'SUSE Linux Enterprise Desktop 11 provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '11-desktop'
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 11'
    os: '11-desktop'
  • name: 'SUSE Linux Enterprise Desktop 12'
    description: 'SUSE Linux Enterprise Desktop 12 provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '12-desktop'
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 12'
    os: '12-desktop'
  • name: 'SUSE Linux Enterprise Desktop 15'
    description: 'SUSE Linux Enterprise Desktop 15 provider'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '15-desktop'
    metadata:
    provider_name: 'SUSE Linux Enterprise Desktop 15'
    os: '15-desktop'
  • name: 'SUSE Linux Enterprise Server 11'
    description: 'SUSE Linux Enterprise Server 11'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '11-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 11'
    os: '11-server'
  • name: 'SUSE Linux Enterprise Server 12'
    description: 'SUSE Linux Enterprise Server 12'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '12-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 12'
    os: '12-server'
  • name: 'SUSE Linux Enterprise Server 15'
    description: 'SUSE Linux Enterprise Server 15'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '15-server'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 15'
    os: '15-server'

Result:

imagen

@CamiRomero
Copy link
Contributor

Task 5 - Add update interval tests.

Added case in tests/integration/test_vulnerability_detector/test_providers/data/test_cases/cases_update_from_year.yaml

  • name: 'SUSE'
    description: 'SUSE Linux Enterprise'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: 11-desktop
    UPDATE_FROM_YEAR: YEAR
    metadata:
    provider: 'suse'
    provider_name: 'SUSE Linux Enterprise Desktop 11'

Result:

imagen

@CamiRomero
Copy link
Contributor

Task 6 - Add update interval tests

Added case in tests/integration/test_vulnerability_detector/test_providers/data/test_cases/cases_update_interval.yaml

  • name: 'SUSE'
    description: 'Test update interval 5s SUSE'
    configuration_parameters:
    PROVIDER: 'suse'
    OS: '12-server'
    UPDATE_INTERVAL: '5s'
    metadata:
    provider_name: 'SUSE Linux Enterprise Server 12'
    update_interval: '5s'

Result:

imagen

@CamiRomero
Copy link
Contributor

Task 7 - Add SUSE OS to the test documentation

Added OS in tests involved

  • SUSE Linux Enterprise Desktop 11
    - SUSE Linux Enterprise Desktop 12
    - SUSE Linux Enterprise Desktop 15
    - SUSE Linux Enterprise Server 11
    - SUSE Linux Enterprise Server 12
    - SUSE Linux Enterprise Server 15

@damarisg
Copy link
Member Author

It was merge to 2792-add-support-for-SUSE-OVAL-in-Vulnerability-Detector branch

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

Successfully merging a pull request may close this issue.

2 participants