From 4e24b8632533f0284052bca1f9a283d4ed8b863a Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Mon, 14 Oct 2024 12:05:14 +0200 Subject: [PATCH 1/8] Add tests for alias functionality - drop alias-command.feature since the command is not supported in dnf5 - create a new feature to test dnf5 aliasing functionality --- dnf-behave-tests/dnf/alias-command.feature | 232 ------------------ dnf-behave-tests/dnf/aliases.feature | 168 +++++++++++++ .../alias-command/dnf-ci-packageA-1.0.spec | 14 -- 3 files changed, 168 insertions(+), 246 deletions(-) delete mode 100644 dnf-behave-tests/dnf/alias-command.feature create mode 100644 dnf-behave-tests/dnf/aliases.feature delete mode 100644 dnf-behave-tests/fixtures/specs/alias-command/dnf-ci-packageA-1.0.spec diff --git a/dnf-behave-tests/dnf/alias-command.feature b/dnf-behave-tests/dnf/alias-command.feature deleted file mode 100644 index c376908f2..000000000 --- a/dnf-behave-tests/dnf/alias-command.feature +++ /dev/null @@ -1,232 +0,0 @@ -# Aliases config path cannot be changed, so it cannot be taken from installroot -@no_installroot -Feature: Test for alias command - -Background: - Given I use repository "alias-command" - - -Scenario: Add alias - When I execute dnf with args "alias add inthrone=install" - Then the exit code is 0 - And stdout is - """ - Aliases added: inthrone - """ - - -@bz1666325 -Scenario: List aliases - When I execute dnf with args "alias add inthrone=install" - Then the exit code is 0 - When I execute dnf with args "alias list" - Then the exit code is 0 - And stdout is - """ - Alias inthrone='install' - """ - - -@bz1680488 -Scenario: List aliases with trivial infinite recursion - When I execute dnf with args "alias add install='install dnf-ci-packageC'" - Then the exit code is 0 - And stdout is - """ - Aliases added: install - """ - When I execute dnf with args "alias list" - Then the exit code is 0 - And stderr is - """ - Aliases contain infinite recursion, alias install="install dnf-ci-packageC" - """ - When I execute dnf with args "install dnf-ci-packageB" - Then the exit code is 1 - And stderr is - """ - Aliases contain infinite recursion, using original arguments. - Error: Unable to find a match: dnf-ci-packageB - """ - - -@bz1680488 -Scenario: List aliases with non-trivial infinite recursion - When I execute dnf with args "alias add install='inthrone dnf-ci-packageC' inthrone=install" - Then the exit code is 0 - And stdout is - """ - Aliases added: install, inthrone - """ - When I execute dnf with args "alias list" - Then the exit code is 0 - And stderr is - """ - Aliases contain infinite recursion, alias install="inthrone dnf-ci-packageC" - Aliases contain infinite recursion, alias inthrone="install" - """ - When I execute dnf with args "install dnf-ci-packageB" - Then the exit code is 1 - And stderr is - """ - Aliases contain infinite recursion, using original arguments. - Error: Unable to find a match: dnf-ci-packageB - """ - - -Scenario: Use alias - When I execute dnf with args "alias add inthrone=install" - Then the exit code is 0 - When I execute dnf with args "install dnf-ci-packageB" - Then the exit code is 1 - And stderr is - """ - Error: Unable to find a match: dnf-ci-packageB - """ - - -Scenario: Delete alias - When I execute dnf with args "alias add inthrone=install" - Then the exit code is 0 - When I execute dnf with args "alias delete inthrone" - Then the exit code is 0 - And stdout is - """ - Aliases deleted: inthrone - """ - When I execute dnf with args "alias list" - Then the exit code is 0 - And stdout is - """ - No aliases defined. - """ - When I execute dnf with args "inthrone dnf-ci-packageB" - Then the exit code is 1 - And stderr contains "No such command: inthrone" - - -@bz1680489 -Scenario: Aliases conflicts: USER.conf has the highest priority, then alphabetical ordering is used - # Multiple config files to decrease the randomness aspect - Given I create file "/etc/dnf/aliases.d/A.conf" with - """ - [aliases] - test0 = commandA - test1 = commandA - test2 = commandA - test3 = commandA - test4 = commandA - """ - And I create file "/etc/dnf/aliases.d/Z.conf" with - """ - [aliases] - test0 = commandZ - test1 = commandZ - """ - And I create file "/etc/dnf/aliases.d/B.conf" with - """ - [aliases] - test0 = commandB - test1 = commandB - test2 = commandB - test3 = commandB - """ - And I create file "/etc/dnf/aliases.d/USER.conf" with - """ - [aliases] - test0 = commandU - """ - And I create file "/etc/dnf/aliases.d/C.conf" with - """ - [aliases] - test0 = commandC - test1 = commandC - test2 = commandC - """ - When I execute dnf with args "alias" - Then stdout is - """ - Alias test0='commandU' - Alias test1='commandZ' - Alias test2='commandC' - Alias test3='commandB' - Alias test4='commandA' - """ - - -@bz1680566 -Scenario: ALIASES.conf can disable all aliases - Given I create file "/etc/dnf/aliases.d/ALIASES.conf" with - """ - [main] - enabled = 0 - """ - And I create file "/etc/dnf/aliases.d/custom.conf" with - """ - [main] - enabled = 1 - [aliases] - inthrone = install - """ - When I execute dnf with args "inthrone dnf-ci-packageB" - Then the exit code is 1 - And stderr contains "No such command: inthrone" - - -@bz1680566 -Scenario: Aliases can be disabled in individual conf files - Given I create file "/etc/dnf/aliases.d/ALIASES.conf" with - """ - [main] - enabled = 1 - """ - And I create file "/etc/dnf/aliases.d/USER.conf" with - """ - [main] - enabled = 0 - [aliases] - inthrone = install - """ - When I execute dnf with args "inthrone dnf-ci-packageB" - Then the exit code is 1 - And stderr contains "No such command: inthrone" - - -@bz1680566 -Scenario: One disabled config does not affect others - Given I create file "/etc/dnf/aliases.d/ALIASES.conf" with - """ - [main] - enabled = 1 - """ - And I create file "/etc/dnf/aliases.d/USER.conf" with - """ - [main] - enabled = 0 - [aliases] - inthrone = install - """ - And I create file "/etc/dnf/aliases.d/custom.conf" with - """ - [main] - enabled = 1 - [aliases] - inthrone = install - """ - When I execute dnf with args "inthrone dnf-ci-packageB" - Then the exit code is 1 - And stderr is - """ - Error: Unable to find a match: dnf-ci-packageB - """ - - -@bz1680482 -Scenario: Backslash ends the recursive processing and the '\' is stripped - Given I successfully execute dnf with args "alias add install='\install'" - When I execute dnf with args "install dnf-ci-packageB" - Then the exit code is 1 - And stderr is - """ - Error: Unable to find a match: dnf-ci-packageB - """ diff --git a/dnf-behave-tests/dnf/aliases.feature b/dnf-behave-tests/dnf/aliases.feature new file mode 100644 index 000000000..806c4635a --- /dev/null +++ b/dnf-behave-tests/dnf/aliases.feature @@ -0,0 +1,168 @@ +# aliases configuration directories are always taken from the host +@destructive +@dnf5 +Feature: Test for dnf5 aliases functionality + +Background: + Given I use repository "simple-base" + + +Scenario Outline: DNF recognizes command alias created in directory +Given I create directory "/" + And I create file "//TEST_ALIASES.conf" with +""" +version = '1.0' + +['inthrone'] +type = 'command' +attached_command = 'install' +descr = 'Install command test alias' +""" + When I execute dnf with args "inthrone labirinto" + Then the exit code is 0 + And Transaction is following + | Action | Package | + | install | labirinto-0:1.0-1.fc29.x86_64 | + +Examples: + | aliases_path | + | /usr/share/dnf5/aliases.d | + | /etc/dnf/dnf5-aliases.d | + | /root/.config/dnf5/aliases.d | + + +Scenario: I can add option to the aliased command +Given I create directory "//etc/dnf/dnf5-aliases.d" + And I create file "//etc/dnf/dnf5-aliases.d/TEST_ALIASES.conf" with +""" +version = '1.0' + +['inthrone'] +type = 'command' +attached_command = 'install' +descr = 'Install command test alias' +attached_named_args = [ + { id_path = 'assumeno' } +] +""" + When I execute dnf with args "inthrone labirinto" + Then the exit code is 1 + And stderr contains "Operation aborted by the user." + + +Scenario: I can add option with value to the aliased command +Given I create directory "//etc/dnf/dnf5-aliases.d" + And I create file "//etc/dnf/dnf5-aliases.d/TEST_ALIASES.conf" with +""" +version = '1.0' + +['inthrone'] +type = 'command' +attached_command = 'install' +descr = 'Install command test alias' +attached_named_args = [ + { id_path = 'repo', value = 'does_not_exist' } +] +""" + When I execute dnf with args "inthrone labirinto" + Then the exit code is 2 + And stderr contains "No matching repositories for does_not_exist." + + +Scenario: DNF recognizes alias for a named argument +Given I create directory "//etc/dnf/dnf5-aliases.d" + And I create file "//etc/dnf/dnf5-aliases.d/TEST_ALIASES.conf" with +""" +version = '1.0' + +['use-repository-id'] +type = 'cloned_named_arg' +long_name = 'TEST-use-repository-id' +source = 'repo' +""" + When I execute dnf with args "install labirinto --TEST-use-repository-id=simple-base" + Then the exit code is 0 + And Transaction is following + | Action | Package | + | install | labirinto-0:1.0-1.fc29.x86_64 | + + +Scenario: I can define a new named argument to replace multiple options +Given I create directory "//etc/dnf/dnf5-aliases.d" + And I create file "//etc/dnf/dnf5-aliases.d/TEST_ALIASES.conf" with +""" +version = '1.0' + +['list.all-available'] +type = 'named_arg' +long_name = 'all-available' +attached_named_args = [ + { id_path = 'list.showduplicates' }, + { id_path = 'list.available' } +] +""" + And I use repository "simple-updates" + And I successfully execute dnf with args "install labirinto" + When I execute dnf with args "list labirinto --all-available" + Then the exit code is 0 + And stdout is + """ + Available packages + labirinto.src 1.0-1.fc29 simple-base + labirinto.x86_64 1.0-1.fc29 simple-base + labirinto.src 2.0-1.fc29 simple-updates + labirinto.x86_64 2.0-1.fc29 simple-updates + """ + + +Scenario: Aliased command is printed to the user as part of the help +Given I create directory "//etc/dnf/dnf5-aliases.d" + And I create file "//etc/dnf/dnf5-aliases.d/TEST_ALIASES.conf" with +""" +version = '1.0' + +['inthrone'] +type = 'command' +attached_command = 'install' +descr = 'Install command test alias' +""" + When I execute dnf with args "--help" + Then stdout contains "inthrone" + + +Scenario: I can define a group for multiple commands or options +Given I create directory "//etc/dnf/dnf5-aliases.d" + And I create file "//etc/dnf/dnf5-aliases.d/TEST_ALIASES.conf" with +""" +version = '1.0' +['repo.test-query-aliases'] +type = 'group' +header = 'Test Query Aliases:' + +['repo.ls'] +type = 'command' +attached_command = 'repo.list' +descr = "Alias for 'repo list'" +group_id = 'test-query-aliases' + +['repo.if'] +type = 'command' +attached_command = 'repo.info' +descr = "Alias for 'repo info'" +group_id = 'test-query-aliases' +""" + When I execute dnf with args "repo --help" + Then the exit code is 0 + And stdout matches line by line +""" +Usage: + dnf5 \[GLOBAL OPTIONS\] repo \.\.\. +\s+ +Query Commands: + list List repositories + info Print details about repositories +\s+ +Test Query Aliases: + ls Alias for 'repo list' + if Alias for 'repo info' +""" diff --git a/dnf-behave-tests/fixtures/specs/alias-command/dnf-ci-packageA-1.0.spec b/dnf-behave-tests/fixtures/specs/alias-command/dnf-ci-packageA-1.0.spec deleted file mode 100644 index 66d1a822c..000000000 --- a/dnf-behave-tests/fixtures/specs/alias-command/dnf-ci-packageA-1.0.spec +++ /dev/null @@ -1,14 +0,0 @@ -Name: dnf-ci-packageA -Version: 1.0 -Release: 1 - -License: Public Domain -URL: None -Summary: Dummy - -%description -Dummy - -%files - -%changelog From 4e3beaa2336e6bc121f3b4ec019f4a59cb936bc4 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Mon, 14 Oct 2024 13:35:20 +0200 Subject: [PATCH 2/8] Review cache.feature - removed dnf4 only test - removed test that rely on expired_repos.json, such file is not used by dnf5 any more --- dnf-behave-tests/dnf/cache.feature | 47 +----------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/dnf-behave-tests/dnf/cache.feature b/dnf-behave-tests/dnf/cache.feature index 2dcf7f610..94d0d45ab 100644 --- a/dnf-behave-tests/dnf/cache.feature +++ b/dnf-behave-tests/dnf/cache.feature @@ -1,52 +1,7 @@ +@dnf5 Feature: Tests for cache -# @dnf5 -# TODO(nsella) different stdout -# TODO(nsella) different stderr -@bz1843280 -@destructive -@no_installroot -Scenario: Do not error out when fail to load/store expired_repos cache - Given I use repository "simple-base" - And I create file "/tmp/dnf/expired_repos.json" with - """ - """ - And I execute "chmod 777 /tmp/dnf/" - And I execute "chmod 000 /tmp/dnf/expired_repos.json" - When I execute dnf with args "repoquery --setopt=cachedir=/tmp/dnf/" as an unprivileged user - Then the exit code is 0 - And stdout is - """ - dedalo-signed-0:1.0-1.fc29.src - dedalo-signed-0:1.0-1.fc29.x86_64 - labirinto-0:1.0-1.fc29.src - labirinto-0:1.0-1.fc29.x86_64 - vagare-0:1.0-1.fc29.src - vagare-0:1.0-1.fc29.x86_64 - """ - And stderr contains lines - """ - Failed to load expired repos cache: [Errno 13] Permission denied: '/tmp/dnf/expired_repos.json' - Failed to store expired repos cache: [Errno 13] Permission denied: '/tmp/dnf/expired_repos.json' - """ - - -@not.with_dnf=5 -@bz2027445 -Scenario: Regenerate solvfile cache when solvfile version doesn't match - Given I use repository "simple-base" - And I execute dnf with args "makecache" - When I invalidate solvfile version of "{context.dnf.installroot}/var/cache/dnf/simple-base.solv" - And I execute dnf with args "repoquery --setopt=logfilelevel=10" - Then file "/var/log/hawkey.log" contains lines - """ - .* DEBUG caching repo: simple-base .* - """ - - -@not.with_dnf=4 -@dnf5 @bz2027445 Scenario: Regenerate solvfile cache when solvfile version doesn't match Given I use repository "simple-base" From 7844eca97efc1a3576c13e766446ef86f0a4916d Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Mon, 14 Oct 2024 13:40:55 +0200 Subject: [PATCH 3/8] Adjust command-aliases.feature test for dnf5 - use correct exit code - use correct error message --- dnf-behave-tests/dnf/command-aliases.feature | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dnf-behave-tests/dnf/command-aliases.feature b/dnf-behave-tests/dnf/command-aliases.feature index 934c8bfd9..959e0e20b 100644 --- a/dnf-behave-tests/dnf/command-aliases.feature +++ b/dnf-behave-tests/dnf/command-aliases.feature @@ -1,13 +1,17 @@ +@dnf5 Feature: Tests for command aliases availability Scenario: "nonexistent" is not an alias for any dnf command When I execute dnf with args "nonexistent -h" - Then the exit code is 1 - And stderr contains "No such command: nonexistent" + Then the exit code is 2 + And stderr is + """ + Unknown argument "nonexistent" for command "dnf5". + It could be a command provided by a plugin, try: dnf5 install 'dnf5-command(nonexistent)' + """ -@dnf5 Scenario Outline: "" is an alias for "" When I execute dnf with args " -h" Then the exit code is 0 From 31311929549473ea559b85d879abb74b6faaf554 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Mon, 14 Oct 2024 16:54:23 +0200 Subject: [PATCH 4/8] Review comps groups features for dnf5 - one failing scenario adjusted to dnf5 - for scenarios not passing on dnf5 added links to related github issues --- dnf-behave-tests/dnf/comps-group.feature | 35 ++++++++----------- dnf-behave-tests/dnf/comps-load-order.feature | 3 ++ dnf-behave-tests/dnf/comps-upgrade.feature | 3 +- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/dnf-behave-tests/dnf/comps-group.feature b/dnf-behave-tests/dnf/comps-group.feature index b08c67c40..33c87f042 100644 --- a/dnf-behave-tests/dnf/comps-group.feature +++ b/dnf-behave-tests/dnf/comps-group.feature @@ -6,8 +6,9 @@ Feature: Testing groups # optional: flac # conditional: wget, requires filesystem-content +# @dnf5 # dnf5 currently supports only group ids as a . Names are not supported -@not.with_dnf=5 +# https://github.com/rpm-software-management/dnf5/issues/1599 Scenario: Install and remove group using group name Given I use repository "dnf-ci-thirdparty" And I use repository "dnf-ci-fedora" @@ -186,21 +187,11 @@ Scenario: Install condidional package if required package has been installed | install-dep | setup-0:2.12.1-1.fc29.noarch | -#@dnf5 -# TODO(nsella) Reason change not captured in dnf5 transaction parser -# Changing reason: -# filesystem x86_64 3.9-2.fc29 @System 0.0 B -# Group -> Dependency -# basesystem requires filesystem (part of DNF-CI-Testgroup) -# -# TODO(emrakova) replace name DNF-CI-Testgroup with ID dnf-ci-testgroup -# and update transaction when -# https://github.com/rpm-software-management/ci-dnf-stack/issues/1344 -# will be resolved +@dnf5 Scenario: Group remove does not remove packages required by user installed packages Given I use repository "dnf-ci-thirdparty" And I use repository "dnf-ci-fedora" - When I execute dnf with args "group install DNF-CI-Testgroup" + When I execute dnf with args "group install dnf-ci-testgroup" Then the exit code is 0 And Transaction is following | Action | Package | @@ -216,15 +207,15 @@ Scenario: Group remove does not remove packages required by user installed packa | install | basesystem-0:11-6.fc29.noarch | # setup and filesystem packages should be kept because they are required by # userinstalled basesystem - When I execute dnf with args "group remove DNF-CI-Testgroup" + When I execute dnf with args "group remove dnf-ci-testgroup" Then the exit code is 0 And Transaction is following - | Action | Package | - | remove | lame-0:3.100-4.fc29.x86_64 | - | remove-unused | lame-libs-0:3.100-4.fc29.x86_64 | - | group-remove | DNF-CI-Testgroup | - | unchanged | filesystem-0:3.9-2.fc29.x86_64 | - | unchanged | setup-0:2.12.1-1.fc29.noarch | + | Action | Package | + | remove | lame-0:3.100-4.fc29.x86_64 | + | remove-unused | lame-libs-0:3.100-4.fc29.x86_64 | + | group-remove | DNF-CI-Testgroup | + | changing-reason | filesystem-0:3.9-2.fc29.x86_64 | + | unchanged | setup-0:2.12.1-1.fc29.noarch | When I execute dnf with args "remove basesystem" Then the exit code is 0 And Transaction is following @@ -264,6 +255,7 @@ Scenario: Group remove does not remove user installed packages # @dnf5 # TODO(nsella) "shell" command not implemented +# https://github.com/rpm-software-management/dnf5/issues/153 @bz1809600 Scenario: Group remove does not traceback when reason change Given I use repository "dnf-ci-thirdparty" @@ -433,6 +425,7 @@ Scenario: Install a group with empty packagelist # @dnf5 # TODO(nsella) Merged group produces different package set +# https://github.com/rpm-software-management/dnf5/issues/183 @not.with_os=rhel__ge__8 Scenario: Merge groups when one has empty packagelist Given I use repository "comps-group" @@ -505,6 +498,8 @@ Scenario: Group info with a group that has missing name # @dnf5 # TODO(nsella) Enviroments merge produces different groups sets in dnf4/dnf5 +# https://github.com/rpm-software-management/dnf5/issues/881 +# https://github.com/rpm-software-management/dnf5/issues/183 Scenario: Mark a group and an environment without name Given I use repository "comps-group" And I use repository "comps-group-merging" diff --git a/dnf-behave-tests/dnf/comps-load-order.feature b/dnf-behave-tests/dnf/comps-load-order.feature index ed312c4b0..ca768a260 100644 --- a/dnf-behave-tests/dnf/comps-load-order.feature +++ b/dnf-behave-tests/dnf/comps-load-order.feature @@ -1,3 +1,6 @@ +# comps groups merging works differently in dnf5 +# https://github.com/rpm-software-management/dnf5/issues/183 +# https://github.com/rpm-software-management/dnf5/issues/881 @bz1928181 Feature: Comps are merged based on repoconf load order diff --git a/dnf-behave-tests/dnf/comps-upgrade.feature b/dnf-behave-tests/dnf/comps-upgrade.feature index 1ecfb460d..1ebcdc108 100644 --- a/dnf-behave-tests/dnf/comps-upgrade.feature +++ b/dnf-behave-tests/dnf/comps-upgrade.feature @@ -190,8 +190,9 @@ Scenario: Upgrade environment - user-installed groups are not removed | group-install | B-group | | env-upgrade | AB-environment | -#@dnf5 +# @dnf5 # TODO(nsella) Enviroments merge produces different groups sets in dnf4/dnf5 +# https://github.com/rpm-software-management/dnf5/issues/881 Scenario: Upgrade environment when there are both old and new groups/packages - install only new groups/packages Given I successfully execute dnf with args "group install --no-packages AB-environment" # I don't drop repository comps-environment-upgrade-1, so the comps are merged From 1fd7716b7e4e33ef61461ce5324474e945ffcd7a Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Tue, 15 Oct 2024 08:33:17 +0200 Subject: [PATCH 5/8] Drop debuglevel.feature for dnf5 The --debuglevel option has been dropped in dnf5, only debuglevel config option is supposed to be supported. Unfortunately this config option is still not implemented, so there is nothing to test. https://github.com/rpm-software-management/dnf5/issues/1774 --- dnf-behave-tests/dnf/debuglevel.feature | 43 ------------------------- 1 file changed, 43 deletions(-) delete mode 100644 dnf-behave-tests/dnf/debuglevel.feature diff --git a/dnf-behave-tests/dnf/debuglevel.feature b/dnf-behave-tests/dnf/debuglevel.feature deleted file mode 100644 index 28be0ea50..000000000 --- a/dnf-behave-tests/dnf/debuglevel.feature +++ /dev/null @@ -1,43 +0,0 @@ -# @dnf5 -# TODO(nsella) Unknown argument "--debuglevel" for command "microdnf" -Feature: Tests for --debuglevel / -d cmdline option - - -Background: Enable repo - Given I use repository "dnf-ci-fedora" - - -Scenario: Test for debuglevel 0 - When I execute dnf with args "--assumeno -d0 install setup" - Then stderr contains "Operation aborted" - And stdout is empty - - -Scenario: Test for debuglevel 1 - When I execute dnf with args "--assumeno --debuglevel=1 install setup" - Then stdout contains "Installing:" - And stdout does not contain "cachedir:" - And stdout does not contain "Base command:" - And stdout does not contain "timer: depsolve:" - - -Scenario: Test for debuglevel 5 - When I execute dnf with args "--assumeno -d=5 install setup" - Then stdout contains "Installing:" - And stdout contains "cachedir:" - And stdout does not contain "Base command:" - And stdout does not contain "timer: depsolve:" - - -Scenario: Test for debuglevel 10 - When I execute dnf with args "--assumeno --debuglevel 10 install setup" - Then stdout contains "Installing:" - And stdout contains "cachedir:" - And stdout contains "Base command:" - And stdout contains "timer: depsolve:" - - -Scenario: Test for debuglevel greater than allowed value - When I execute dnf with args "--assumeno -d 100 install setup" - Then stderr contains "Config error:.*should be less than allowed value" - And stdout is empty From 324e21502eb44b2266513fe9f3bc7d70d646becc Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Tue, 15 Oct 2024 08:40:59 +0200 Subject: [PATCH 6/8] chore: Cleanup distro-sync.feature - move the @dnf5 decorator to the Feature level - remove remaining dnf4 output testing --- dnf-behave-tests/dnf/distro-sync.feature | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/dnf-behave-tests/dnf/distro-sync.feature b/dnf-behave-tests/dnf/distro-sync.feature index 7a38efe05..ace703b21 100644 --- a/dnf-behave-tests/dnf/distro-sync.feature +++ b/dnf-behave-tests/dnf/distro-sync.feature @@ -1,8 +1,8 @@ +@dnf5 Feature: distro-sync @dnf5daemon -@dnf5 Scenario: when there is noting to do Given I use repository "simple-base" When I execute dnf with args "distro-sync" @@ -11,7 +11,6 @@ Given I use repository "simple-base" @dnf5daemon -@dnf5 Scenario: updating a pkg Given I use repository "simple-base" And I execute dnf with args "install labirinto" @@ -23,7 +22,6 @@ Given I use repository "simple-base" | upgrade | labirinto-2.0-1.fc29.x86_64 | @dnf5daemon -@dnf5 Scenario: Ignore excluded packages - not fail on excluded best candidate Given I use repository "simple-base" And I execute dnf with args "install labirinto" @@ -34,7 +32,6 @@ Given I use repository "simple-base" @dnf5daemon -@dnf5 Scenario: updating a signed pkg Given I use repository "simple-base" And I execute dnf with args "install dedalo-signed" @@ -49,7 +46,6 @@ Given I use repository "simple-base" | upgrade | dedalo-signed-2.0-1.fc29.x86_64 | -@dnf5 Scenario: updating a signed pkg without key specified Given I use repository "simple-base" And I execute dnf with args "install dedalo-signed" @@ -60,7 +56,6 @@ Given I use repository "simple-base" Then the exit code is 1 -@dnf5 Scenario: updating a broken signed pkg whose key is not imported Given I use repository "dnf-ci-gpg" And I execute dnf with args "install wget" @@ -70,15 +65,13 @@ Given I use repository "dnf-ci-gpg" | gpgkey | file://{context.dnf.fixturesdir}/gpgkeys/keys/dnf-ci-gpg-updates/dnf-ci-gpg-updates-public | When I execute dnf with args "distro-sync wget" Then the exit code is 1 - And dnf4 stderr contains "Error: GPG check FAILED" - And dnf5 stderr contains lines matching + And stderr contains lines matching """ Transaction failed: Signature verification failed. PGP check for package "wget-2\.0\.0-1\.fc29\.x86_64" \(.*/wget-2.0.0-1.fc29.x86_64.rpm\) from repo "dnf-ci-gpg-updates" has failed: Problem occurred when opening the package. """ -@dnf5 @bz1963732 @not.with_os=rhel__ge__8 Scenario: updating a broken signed pkg whose key is imported @@ -91,15 +84,13 @@ Given I use repository "dnf-ci-gpg" And I execute rpm with args "--import {context.dnf.fixturesdir}/gpgkeys/keys/dnf-ci-gpg-updates/dnf-ci-gpg-updates-public" When I execute dnf with args "distro-sync wget" Then the exit code is 1 - And dnf4 stderr contains "Error: GPG check FAILED" - And dnf5 stderr contains lines matching + And stderr contains lines matching """ Transaction failed: Signature verification failed. PGP check for package "wget-2\.0\.0-1\.fc29\.x86_64" \(.*/wget-2.0.0-1.fc29.x86_64.rpm\) from repo "dnf-ci-gpg-updates" has failed: Problem occurred when opening the package. """ -@dnf5 Scenario: distro-sync list of packages, one of them is not available Given I use repository "dnf-ci-fedora" When I execute dnf with args "install flac" @@ -118,7 +109,6 @@ Scenario: distro-sync list of packages, one of them is not available And Transaction is empty -@dnf5 Scenario: distro-sync list of packages with --skip-unavailable, one of them is not available Given I use repository "dnf-ci-fedora" When I execute dnf with args "install flac" @@ -136,7 +126,6 @@ Scenario: distro-sync list of packages with --skip-unavailable, one of them is n | upgrade | flac-0:1.3.3-3.fc29.x86_64 | -@dnf5 Scenario: distro-sync list of packages, one of them is not installed Given I use repository "dnf-ci-fedora" When I execute dnf with args "install flac" @@ -152,7 +141,6 @@ Scenario: distro-sync list of packages, one of them is not installed And Transaction is empty -@dnf5 Scenario: distro-sync list of packages with --skip-unavailable, one of them is not installed Given I use repository "dnf-ci-fedora" When I execute dnf with args "install flac" @@ -170,7 +158,6 @@ Scenario: distro-sync list of packages with --skip-unavailable, one of them is n | upgrade | flac-0:1.3.3-3.fc29.x86_64 | -@dnf5 Scenario: distro-sync all with a broken dependency and without best Given I use repository "upgrade-dependent" And I successfully execute dnf with args "install labirinto" From b353dea26cb41ffc9040dab20b94d5d9ed00ef57 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Tue, 15 Oct 2024 11:50:05 +0200 Subject: [PATCH 7/8] Postpone dnf-transaction-exception.feature enablement Added a link to the github issue tracking Python plugins problem. --- dnf-behave-tests/dnf/dnf-transaction-exception.feature | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dnf-behave-tests/dnf/dnf-transaction-exception.feature b/dnf-behave-tests/dnf/dnf-transaction-exception.feature index 735ff417d..2483aec2b 100644 --- a/dnf-behave-tests/dnf/dnf-transaction-exception.feature +++ b/dnf-behave-tests/dnf/dnf-transaction-exception.feature @@ -1,6 +1,7 @@ # @dnf5 -# TODO(nsella) different exit code -# TODO(nsella) different stderr +# libdnf5 plugins written in Python are currently broken. +# TODO(mblaha): try again once +# https://github.com/rpm-software-management/dnf5/issues/1775 is resolved @no_installroot Feature: Test exception when dnf tries to do a transaction resolved but not valid anymore From b53ac5f99e6f8ffa39bd774e42a26b49d7a3fd95 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Tue, 15 Oct 2024 13:10:25 +0200 Subject: [PATCH 8/8] Review download-source.feature for dnf5 - one already passing test tagged with @dnf5 - added links to github issues for failing tests --- dnf-behave-tests/dnf/download-source.feature | 27 ++++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/dnf-behave-tests/dnf/download-source.feature b/dnf-behave-tests/dnf/download-source.feature index e2338c362..85152d509 100644 --- a/dnf-behave-tests/dnf/download-source.feature +++ b/dnf-behave-tests/dnf/download-source.feature @@ -2,7 +2,8 @@ Feature: Tests for different package download sources # @dnf5 -# TODO(nsella) Unknown argument "makecache" for command "microdnf" +# dnf5 does not fall-back to baseurl if mirrorlist fails. +# https://github.com/rpm-software-management/dnf5/issues/1763 @bz1775184 Scenario: baseurl is used if all mirrors from mirrorlist fail Given I create directory "/baseurlrepo" @@ -18,11 +19,14 @@ Given I create directory "/baseurlrepo" | mirrorlist | {context.dnf.installroot}/tmp/mirrorlist | When I execute dnf with args "makecache" Then the exit code is 0 - And stderr is empty + And stderr is + """ + + """ # @dnf5 -# TODO(nsella) Unknown argument "makecache" for command "microdnf" +# https://github.com/rpm-software-management/dnf5/issues/1763 @bz1775184 Scenario: baseurl is used if mirrorlist file cannot be found Given I create directory "/baseurlrepo" @@ -33,11 +37,14 @@ Given I create directory "/baseurlrepo" | mirrorlist | {context.dnf.installroot}/tmp/mirrorlist | When I execute dnf with args "makecache" Then the exit code is 0 - And stderr is empty + And stderr is + """ + + """ # @dnf5 -# TODO(nsella) Unknown argument "makecache" for command "microdnf" +# https://github.com/rpm-software-management/dnf5/issues/1763 @bz1775184 Scenario: baseurl is used if mirrorlist file is empty Given I create directory "/baseurlrepo" @@ -51,11 +58,14 @@ Given I create directory "/baseurlrepo" | mirrorlist | {context.dnf.installroot}/tmp/mirrorlist | When I execute dnf with args "makecache" Then the exit code is 0 - And stderr is empty + And stderr is + """ + + """ # @dnf5 -# TODO(nsella) Unknown argument "makecache" for command "microdnf" +# https://github.com/rpm-software-management/dnf5/issues/1763 Scenario: no working donwload source result in an error Given I create directory "/baseurlrepo" And I execute "createrepo_c {context.dnf.installroot}/baseurlrepo" @@ -139,7 +149,7 @@ Given I make packages from repository "dnf-ci-fedora" accessible via http # @dnf5 -# TODO(nsella) different HTTP log +# https://github.com/rpm-software-management/dnf5/issues/1321 @bz1817130 Scenario: Download a package that contains special URL characters that need to be encoded (e.g. a +) Given I use repository "download-sources" as http @@ -172,6 +182,7 @@ Given I make packages from repository "download-sources" accessible via http """ +@dnf5 @bz2103015 Scenario: Download a package that contains special URL characters by passing an encoded URL Given I use repository "download-sources" as http