Skip to content

Commit

Permalink
Adjust versionlock-list-manipulation.feature tests
Browse files Browse the repository at this point in the history
Mostly changing checked outputs to match what dnf5 actually prints.
Dropped test for --raw switch, which is not going to be supported in
dnf5.
  • Loading branch information
m-blaha committed Feb 15, 2024
1 parent d38582b commit fc9f30d
Showing 1 changed file with 61 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,106 +2,102 @@ Feature: Versionlock command can maintain versionlock.list file


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
"""
[main]
enabled = 1
locklist = {context.dnf.installroot}/etc/dnf/plugins/versionlock.list
"""
And I create file "/etc/dnf/plugins/versionlock.list" with
Given I create file "/etc/dnf/versionlock.toml" with
"""
"""
And I use repository "dnf-ci-fedora"


@dnf5
Scenario: Basic commands add/exclude/list/delete/clear for manipulation with versionlock.list file are working
Given I use repository "dnf-ci-fedora"
When I execute dnf with args "install wget"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | wget-0:1.19.5-5.fc29.x86_64 |
# add is the default command
When I execute dnf with args "versionlock wget"
# add command
When I execute dnf with args "versionlock add wget"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
Adding versionlock on: wget-0:1.19.5-5.fc29.*
Adding versionlock on "wget = 1.19.5-5.fc29".
"""
When I execute dnf with args "versionlock list"
Then the exit code is 0
And stdout is
And stdout matches line by line
"""
<REPOSYNC>
wget-0:1.19.5-5.fc29.*
# Added by 'versionlock add' command on .*
Package name: wget
evr = 1.19.5-5.fc29
"""
# exclude command
When I execute dnf with args "versionlock exclude lame"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
Adding exclude on: lame-0:3.100-4.fc29.*
Adding versionlock exclude on "lame = 3.100-4.fc29".
"""
When I execute dnf with args "versionlock list"
Then the exit code is 0
And stdout is
And stdout matches line by line
"""
<REPOSYNC>
wget-0:1.19.5-5.fc29.*
!lame-0:3.100-4.fc29.*
# Added by 'versionlock add' command on .*
Package name: wget
evr = 1.19.5-5.fc29
# Added by 'versionlock exclude' command on .*
Package name: lame
evr != 3.100-4.fc29
"""
# delete command
When I execute dnf with args "versionlock delete wget"
Then the exit code is 0
And stdout is
And stdout matches line by line
"""
<REPOSYNC>
Deleting versionlock for: wget-0:1.19.5-5.fc29.*
Deleting versionlock entry:
# Added by 'versionlock add' command on .*
Package name: wget
evr = 1.19.5-5.fc29
"""
When I execute dnf with args "versionlock list"
Then the exit code is 0
And stdout is
And stdout matches line by line
"""
<REPOSYNC>
!lame-0:3.100-4.fc29.*
# Added by 'versionlock exclude' command on .*
Package name: lame
evr != 3.100-4.fc29
"""
# delete command on excluded package
When I execute dnf with args "versionlock delete lame"
Then the exit code is 0
And stdout is
And stdout matches line by line
"""
<REPOSYNC>
Deleting versionlock for: !lame-0:3.100-4.fc29.*
Deleting versionlock entry:
# Added by 'versionlock exclude' command on .*
Package name: lame
evr != 3.100-4.fc29
"""
When I execute dnf with args "versionlock list"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
"""
# add command
# clear command
When I execute dnf with args "versionlock add wget"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
Adding versionlock on: wget-0:1.19.5-5.fc29.*
"""
When I execute dnf with args "versionlock list"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
wget-0:1.19.5-5.fc29.*
Adding versionlock on "wget = 1.19.5-5.fc29".
"""
# clear command
When I execute dnf with args "versionlock clear"
Then the exit code is 0
And stdout is
Expand All @@ -116,34 +112,22 @@ Scenario: Basic commands add/exclude/list/delete/clear for manipulation with ver
"""


Scenario: Versionlock accepts --raw switch
Given I use repository "dnf-ci-fedora"
When I execute dnf with args "install flac"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | flac-0:1.3.2-8.fc29.x86_64 |
When I execute dnf with args "versionlock add --raw flac-1.3.*"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
Adding versionlock on: flac-1.3.*
"""


@dnf5
@bz1785563
Scenario: versionlock will print just necessary information with -q option
Given I use repository "dnf-ci-fedora"
Given I execute dnf with args "versionlock add wget"
When I execute dnf with args "-q versionlock"
When I execute dnf with args "-q versionlock list"
Then the exit code is 0
And stdout is
And stdout matches line by line
"""
wget-0:1.19.5-5.fc29.*
# Added by 'versionlock add' command on .*
Package name: wget
evr = 1.19.5-5.fc29
"""


@dnf5
@bz1782052
@bz1845270
Scenario: Prevent duplicate entries in versionlock.list
Expand All @@ -152,13 +136,16 @@ Scenario: Prevent duplicate entries in versionlock.list
And I successfully execute dnf with args "versionlock add wget"
When I execute dnf with args "versionlock add wget"
Then the exit code is 0
And stdout is
And stderr is
"""
<REPOSYNC>
Package already locked in equivalent form: wget-0:1.19.5-5.fc29.*
Package "wget" is already locked.
"""


# @dnf5
# currently the conflict between add and exclude is not detected.
# The reason is that we need multiple entries for the same name
# to handle locking version-1 OR version-2
@bz1782052
Scenario: Prevent conflicting entries in versionlock.list
Given I use repository "dnf-ci-fedora"
Expand All @@ -172,6 +159,7 @@ Scenario: Prevent conflicting entries in versionlock.list
"""


@dnf5
@bz2013324
Scenario: I can exclude mutliple packages when one is already excluded
Given I use repository "dnf-ci-fedora"
Expand All @@ -181,20 +169,27 @@ Scenario: I can exclude mutliple packages when one is already excluded
And stdout is
"""
<REPOSYNC>
Adding exclude on: abcde-0:2.9.2-1.fc29.*
Package already locked in equivalent form: !wget-0:1.19.5-5.fc29.*
Adding versionlock exclude on "abcde = 2.9.2-1.fc29".
"""
And stderr is
"""
Package "wget" is already excluded.
"""


@dnf5
@bz2013324
Scenario: I can lock mutliple packages when one is already locked
Given I use repository "dnf-ci-fedora"
And I successfully execute dnf with args "versionlock add wget"
When I execute dnf with args "versionlock abcde wget"
When I execute dnf with args "versionlock add abcde wget"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
Adding versionlock on: abcde-0:2.9.2-1.fc29.*
Package already locked in equivalent form: wget-0:1.19.5-5.fc29.*
Adding versionlock on "abcde = 2.9.2-1.fc29".
"""
And stderr is
"""
Package "wget" is already locked.
"""

0 comments on commit fc9f30d

Please sign in to comment.