Skip to content

Commit

Permalink
Adjust versionlock-list.feature tests to dnf5
Browse files Browse the repository at this point in the history
I've removed most of the tests, because dnf5 works correctly without
versionlock configuration file.
  • Loading branch information
m-blaha committed Jan 19, 2024
1 parent 7f38aae commit d38582b
Showing 1 changed file with 7 additions and 65 deletions.
72 changes: 7 additions & 65 deletions dnf-behave-tests/dnf/plugins-core/versionlock-list.feature
Original file line number Diff line number Diff line change
@@ -1,79 +1,21 @@
@dnf5
Feature: Tests missing or misconfigured versionlock.list file in versionlock plugin


Background: Set up versionlock infrastructure in the installroot
Given I enable plugin "versionlock"
# plugins do not honor installroot when searching their configuration
# all the next steps are merely to set up versionlock plugin inside installroot
And I configure dnf with
| key | value |
| pluginconfpath | {context.dnf.installroot}/etc/dnf/plugins |
And I create and substitute file "/etc/dnf/plugins/versionlock.conf" with
Given I create file "/etc/dnf/versionlock.toml" with
"""
[main]
enabled = 1
locklist = {context.dnf.installroot}/etc/dnf/plugins/versionlock.list
"""
And I create file "/etc/dnf/plugins/versionlock.list" with
"""
"""
# check that both locked and newer versions of the package are available
Given I use repository "dnf-ci-fedora"
And I use repository "dnf-ci-fedora-updates"


Scenario: dnf will fail if versionlock.list file is missing
Given I delete file "/etc/dnf/plugins/versionlock.list"
When I execute dnf with args "check-update"
Then the exit code is 1


Scenario: dnf will fail if versionlock.list path is missing from conf
Given I create file "/etc/dnf/plugins/versionlock.conf" with
"""
[main]
enabled=1
"""
When I execute dnf with args "check-update"
Then the exit code is 1


Scenario Outline: dnf versionlock <option> <package> will fail if versionlock.list file is missing
Given I delete file "/etc/dnf/plugins/versionlock.list"
When I execute dnf with args "versionlock <option> <package>"
Then the exit code is 1

Examples:
| option | package |
| list | |
| delete | abcde |
| add | abcde |
| exclude | abcde |


Scenario: dnf versionlock clear will create empty file if versionlock.list is missing
Given I delete file "/etc/dnf/plugins/versionlock.list"
Given I delete file "/etc/dnf/versionlock.toml"
When I execute dnf with args "versionlock clear"
Then the exit code is 0
And file "/etc/dnf/plugins/versionlock.list" exists
And file "/etc/dnf/plugins/versionlock.list" contents is
"""
And file "/etc/dnf/versionlock.toml" exists
And file "/etc/dnf/versionlock.toml" contents is
"""


Scenario Outline: dnf versionlock <option> <package> will fail if versionlock.list path is missing from conf
Given I create file "/etc/dnf/plugins/versionlock.conf" with
packages = []
version = "1.0"
"""
[main]
enabled=1
"""
When I execute dnf with args "versionlock <option> <package>"
Then the exit code is 1

Examples:
| option | package |
| list | |
| clear | |
| add | abcde |
| delete | abcde |
| exclude | abcde |

0 comments on commit d38582b

Please sign in to comment.