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 committed May 30, 2024
1 parent c8344e1 commit 2ff2341
Showing 1 changed file with 72 additions and 1 deletion.
73 changes: 72 additions & 1 deletion 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,6 +81,14 @@ 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"
Expand All @@ -55,6 +98,15 @@ Scenario: upgrade-minimal sec-severity
| Action | Package |
| upgrade | advisory_B-0:1.0-2.x86_64 |

Scenario: check-upgrade --minimal with sec-severity
When I execute dnf4 with args "upgrade-minimal --sec-severity Moderate"
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"
Expand All @@ -64,6 +116,15 @@ Scenario: upgrade-minimal with pkgs specified sec-severity
| Action | Package |
| upgrade | advisory_B-0:1.0-2.x86_64 |

Scenario: check-upgrade --minimal with pkgs specified sec-severity
When I execute dnf4 with args "upgrade-minimal advisory_B --sec-severity Moderate"
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"
Expand All @@ -81,3 +142,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 2ff2341

Please sign in to comment.