From e123e4e16c0d1d3dfb17ff4610fc35d781292365 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Wed, 20 Nov 2024 21:55:14 +0100 Subject: [PATCH] beaker-tests-sanity, behave: fixes for DNF5 (F41+) --- .../copr-cli-basic-operations/runtest-dnf-copr.sh | 14 ++++++++------ behave/features/steps/builds.py | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/beaker-tests/Sanity/copr-cli-basic-operations/runtest-dnf-copr.sh b/beaker-tests/Sanity/copr-cli-basic-operations/runtest-dnf-copr.sh index 32c14d61c..6961452da 100755 --- a/beaker-tests/Sanity/copr-cli-basic-operations/runtest-dnf-copr.sh +++ b/beaker-tests/Sanity/copr-cli-basic-operations/runtest-dnf-copr.sh @@ -46,24 +46,26 @@ rlJournalStart OUTPUT=`mktemp` # Test `dnf copr search' command + # https://github.com/fedora-copr/copr/issues/3531 rlRun "copr-cli create --chroot $CHROOT ${NAME_PREFIX}DnfCopr" - rlRun "dnf copr --hub tested-copr search ${NAME_PREFIX}DnfCopr > $OUTPUT" + rlRun "dnf-3 copr --hub tested-copr search ${NAME_PREFIX}DnfCopr > $OUTPUT" rlRun "cat $OUTPUT |grep '${NAME_PREFIX}DnfCopr' |grep 'No description given'" # Test `dnf copr list' command rlRun "dnf copr list > $OUTPUT" - rlRun "cat $OUTPUT |grep 'copr.fedorainfracloud.org/group_copr/copr'" - rlRun "cat $OUTPUT |grep 'copr.fedorainfracloud.org/group_copr/copr-dev'" + rlRun "cat $OUTPUT |grep 'copr.fedorainfracloud.org/@copr/copr'" + rlRun "cat $OUTPUT |grep 'copr.fedorainfracloud.org/@copr/copr-dev'" # Test `dnf copr enable' command rlRun "copr-cli build ${NAME_PREFIX}DnfCopr ${HELLO}" rlRun "dnf -y copr enable --hub tested-copr ${NAME_PREFIX}DnfCopr" rlRun "dnf -y install hello" rlRun "hello" - rlRun "dnf -y erase hello" + rlRun "dnf -y remove hello" - # Test `dnf copr list --available-by-user' command - rlRun "dnf copr --hub tested-copr list --available-by-user $OWNER > $OUTPUT" + # Test `dnf copr list --available-by-user' command. The feature is only + # implemented in the DN4 plugin and there is no plan to port it to DNF5. + rlRun "dnf-3 copr --hub tested-copr list --available-by-user $OWNER > $OUTPUT" rlRun "cat $OUTPUT |grep '${NAME_PREFIX}DnfCopr' |grep 'No description given'" # Test `dnf copr disable' command diff --git a/behave/features/steps/builds.py b/behave/features/steps/builds.py index 0ac0e6b2c..6611244ff 100644 --- a/behave/features/steps/builds.py +++ b/behave/features/steps/builds.py @@ -36,7 +36,7 @@ def step_impl(context): (out, _) = run_check([ "sudo", "dnf", "repoquery", "--disablerepo=*", "--enablerepo=*{}*".format(project), "--available", - "--qf", "%{NAME}-%{VERSION}", "--noplugins", + "--qf", "%{NAME}-%{VERSION}\n", "--noplugins", ]) packages_found = set(out.strip().splitlines()) assert_is_subset(packages, packages_found) @@ -68,7 +68,7 @@ def step_impl(context, package_name, chroot, string): "--repofrompath", "{},{}".format(repo_id, repo_url) ] - out, _ = run_check(repoquery + ["--changelog", package_name]) + out, _ = run_check(repoquery + ["--changelogs", package_name]) assert_that(out, contains_string(string))