Skip to content

Commit

Permalink
beaker-tests-sanity, behave: fixes for DNF5 (F41+)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyX committed Nov 26, 2024
1 parent 90df59d commit e123e4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions behave/features/steps/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))


Expand Down

0 comments on commit e123e4e

Please sign in to comment.