Skip to content

Commit

Permalink
Add several tests for check-upgrade with advisories and minimal options
Browse files Browse the repository at this point in the history
Some of the tests are related to new option --minimal for check-upgrade
  • Loading branch information
j-mracek authored and kontura committed Jun 6, 2024
1 parent 09e500f commit 382ec64
Showing 1 changed file with 73 additions and 7 deletions.
80 changes: 73 additions & 7 deletions dnf-behave-tests/dnf/security-advisory.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@dnf5
Feature: Test upgrade-minimal with advisory, cve, secseverity
Feature: Test upgrade, upgrade-minimal, and check-ugrade with advisory, cve, secseverity


Background: Use repository with advisories
Expand All @@ -20,6 +20,15 @@ Scenario: upgrade-minimal cve and advisory
| upgrade | advisory_A-0:1.0-2.x86_64 |
| upgrade | advisory_B-0:1.0-2.x86_64 |

Scenario: check-upgrade --minimal cve and advisory
When I execute dnf with args "check-upgrade --minimal --cves CVE-001 --advisories DNF-BUGFIX-001"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_A.x86_64 +1.0-2 +dnf-ci-security
advisory_B.x86_64 +1.0-2 +dnf-ci-security
"""

Scenario: upgrade-minimal with pkgs specified cve and advisory
When I execute dnf with args "upgrade-minimal advisory_A advisory_B --cve CVE-001 --advisory DNF-BUGFIX-001"
Expand All @@ -29,6 +38,15 @@ Scenario: upgrade-minimal with pkgs specified cve and advisory
| upgrade | advisory_A-0:1.0-2.x86_64 |
| upgrade | advisory_B-0:1.0-2.x86_64 |

Scenario: check-upgrade --minimal with pkgs specified cve and advisory
When I execute dnf with args "check-upgrade --minimal advisory_A advisory_B --cves CVE-001 --advisories DNF-BUGFIX-001"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_A.x86_64 +1.0-2 +dnf-ci-security
advisory_B.x86_64 +1.0-2 +dnf-ci-security
"""

Scenario: upgrade advisories
When I execute dnf with args "upgrade --advisories=DNF-BUGFIX-001 --advisories=DNF-SECURITY-004"
Expand All @@ -38,6 +56,23 @@ Scenario: upgrade advisories
| upgrade | advisory_A-0:1.0-4.x86_64 |
| upgrade | advisory_B-0:1.0-4.x86_64 |

Scenario: upgrade --minimal advisories
When I execute dnf with args "upgrade --minimal --advisories=DNF-BUGFIX-001 --advisories=DNF-SECURITY-004"
Then the exit code is 0
And Transaction is following
| Action | Package |
| upgrade | advisory_A-0:1.0-2.x86_64 |
| upgrade | advisory_B-0:1.0-4.x86_64 |

Scenario: check-upgrade --minimal advisories
When I execute dnf with args "check-upgrade --minimal --advisories=DNF-BUGFIX-001 --advisories=DNF-SECURITY-004"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_A.x86_64 +1.0-2 +dnf-ci-security
advisory_B.x86_64 +1.0-4 +dnf-ci-security
"""

Scenario: upgrade cves
When I execute dnf with args "upgrade --cve CVE-001 --cve CVE-002"
Expand All @@ -46,28 +81,49 @@ Scenario: upgrade cves
| Action | Package |
| upgrade | advisory_B-0:1.0-4.x86_64 |

Scenario: check-upgrade cves
When I execute dnf with args "check-upgrade --cves CVE-001 --cves CVE-002"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_B.x86_64 +1.0-4 +dnf-ci-security
"""

Scenario: upgrade-minimal sec-severity
When I execute dnf4 with args "upgrade-minimal --sec-severity Moderate"
When I execute dnf5 with args "upgrade-minimal --advisory-severities=Moderate"
When I execute dnf with args "upgrade-minimal --advisory-severities=Moderate"
Then the exit code is 0
And Transaction is following
| Action | Package |
| upgrade | advisory_B-0:1.0-2.x86_64 |

Scenario: check-upgrade --minimal with sec-severity
When I execute dnf with args "check-upgrade --minimal --advisory-severities=Moderate"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_B.x86_64 +1.0-2 +dnf-ci-security
"""

Scenario: upgrade-minimal with pkgs specified sec-severity
When I execute dnf4 with args "upgrade-minimal advisory_B --sec-severity Moderate"
When I execute dnf5 with args "upgrade-minimal advisory_B --advisory-severities=Moderate"
When I execute dnf with args "upgrade-minimal advisory_B --advisory-severities=Moderate"
Then the exit code is 0
And Transaction is following
| Action | Package |
| upgrade | advisory_B-0:1.0-2.x86_64 |

Scenario: check-upgrade --minimal with pkgs specified sec-severity
When I execute dnf with args "check-upgrade --minimal advisory_B --advisory-severities=Moderate"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_B.x86_64 +1.0-2 +dnf-ci-security
"""

Scenario: upgrade secseverity
When I execute dnf4 with args "upgrade --sec-severity Critical"
When I execute dnf5 with args "upgrade --advisory-severities Critical"
When I execute dnf with args "upgrade --advisory-severities Critical"
Then the exit code is 0
And Transaction is following
| Action | Package |
Expand All @@ -81,3 +137,13 @@ Scenario: upgrade-minimal security plus bugfix
| Action | Package |
| upgrade | advisory_A-0:1.0-3.x86_64 |
| upgrade | advisory_B-0:1.0-4.x86_64 |

Scenario: check-upgrade --minimal security plus bugfix
When I execute dnf with args "check-upgrade --minimal --security --bugfix"
Then the exit code is 100
And stdout matches line by line
"""
<REPOSYNC>
advisory_A.x86_64 +1.0-3 +dnf-ci-security
advisory_B.x86_64 +1.0-4 +dnf-ci-security
"""

0 comments on commit 382ec64

Please sign in to comment.