Skip to content

Commit

Permalink
Add a test for -qa with positional args
Browse files Browse the repository at this point in the history
This use case (of narrowing down an --all query with positional
arguments) is no longer specifically tested after the previous commit so
add a simple test for that.

Since we want a bunch of packages to be preinstalled, make use of the
test image's rpmdb by simply not initializing an empty rpmdb with
RPMDB_INIT.
  • Loading branch information
dmnks authored and pmatilai committed Aug 21, 2024
1 parent 826cbb8 commit 19de35f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/rpmdb.at
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ runroot rpm \
[ignore])
RPMTEST_CLEANUP

AT_SETUP([rpm -qa 3])
AT_KEYWORDS([rpmdb query])
RPMTEST_SETUP

RPMTEST_CHECK([
runroot rpm -U --nodeps --ignorearch --ignoreos --nosignature \
/data/RPMS/foo-1.0-1.noarch.rpm \
/data/RPMS/hello-2.0-1.x86_64-signed.rpm

# Assert that there are at least 3 packages in the rpmdb (we are using that of
# the test image here so that is pretty much guaranteed).
runroot rpm -qa | wc -l | xargs test 2 -lt || exit 1

runroot rpm -qa foo hello | sort
],
[0],
[foo-1.0-1.noarch
hello-2.0-1.x86_64
],
[])
RPMTEST_CLEANUP

AT_SETUP([rpm -qa and rpmkeys])
AT_KEYWORDS([rpmdb query])
AT_SKIP_IF([test x$PGP = xdummy])
Expand Down

0 comments on commit 19de35f

Please sign in to comment.