Skip to content

Commit

Permalink
Eliminate a bunch of now unnecessary runroot() uses
Browse files Browse the repository at this point in the history
All tests are running in a container with the newly built rpm
as the system rpm, for many things runroot is simply no longer needed.
This isn't anywhere near them all, just a bunch of the more obvious
ones.

Running this without the extra nested root does have the downside of
exposing testsuite paths in the container, eg the second rpmspec --parse
test is left as runroot here because it'd otherwise produce output like
"/srv/rpmtests.dir/195/tree/build/SOURCES/hello-1.0-modernize.patch"
and we don't want to have to adjust numbers in unrelated tests if we
add something before that. This could probably be hidden with further
container magic.
  • Loading branch information
pmatilai committed Nov 18, 2024
1 parent d081540 commit eb10687
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
82 changes: 41 additions & 41 deletions tests/rpmquery.at
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AT_SETUP([rpm --qf -p *.i386.rpm])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-q --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" \
-p /data/RPMS/hello-2.0-1.i686.rpm
],
Expand All @@ -38,7 +38,7 @@ AT_SETUP([rpm --qf -p *.src.rpm])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-q --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" \
-p /data/SRPMS/hello-1.0-1.src.rpm
],
Expand All @@ -53,7 +53,7 @@ AT_SETUP([rpm -qp <glob>])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-qp "/data/RPMS/hello-2.0-1.{i686,x86_64}.rpm"
],
[0],
Expand All @@ -68,10 +68,10 @@ AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT

cp "${RPMTEST}/data/RPMS/hello-1.0-1.i386.rpm" \
"${RPMTEST}/tmp/fallback-[[123]].0-1.i386.rpm"
cp "/data/RPMS/hello-1.0-1.i386.rpm" \
"/tmp/fallback-[[123]].0-1.i386.rpm"

runroot rpm \
rpm \
-qp "/tmp/fallback-[[123]].0-1.i386.rpm"
],
[0],
Expand All @@ -84,7 +84,7 @@ AT_SETUP([rpm -qp <notfound>])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-qp /data/RPMS/hello-not-there-1.0-1.x86_64.rpm \
/data/RPMS/hello-not-there-2.0-1.x86_64.rpm \
/data/RPMS/hello-not-there-3.0-1.x86_64.rpm
Expand All @@ -101,7 +101,7 @@ AT_SETUP([rpm -qp <glob notfound>])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-qp "/data/RPMS/hello-not-there-*.x86_64.rpm" \
/data/RPMS/hello-not-there-1.0-1.x86_64.rpm \
/data/RPMS/hello-not-there-2.0-1.x86_64.rpm
Expand All @@ -119,7 +119,7 @@ AT_SETUP([rpm -ql -p *.src.rpm])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-ql \
-p /data/SRPMS/hello-1.0-1.src.rpm
],
Expand All @@ -135,7 +135,7 @@ AT_SETUP([rpm -ql multiple *.rpm])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-ql \
/data/SRPMS/hello-1.0-1.src.rpm /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -153,7 +153,7 @@ AT_SETUP([rpm -qp --dump])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-qp --dump \
/data/RPMS/hello-2.0-1.x86_64.rpm
],
Expand All @@ -172,7 +172,7 @@ AT_SETUP([rpmspec -q])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpmspec \
rpmspec \
-q --qf "%{name}" /data/SPECS/hello.spec
],
[0],
Expand All @@ -185,7 +185,7 @@ AT_SETUP([rpm -ql -p *.i386.rpm])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-ql \
-p /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -203,12 +203,12 @@ AT_SETUP([rpm -qp <manifest>])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
cat << EOF > ${RPMTEST}/query.mft
cat << EOF > query.mft
/data/RPMS/hello-1.0-1.i386.rpm
/data/RPMS/hello-1.0-1.ppc64.rpm
/data/RPMS/foo-1.0-1.noarch.rpm
EOF
runroot rpm -qp --qf "%{nvr}\n" /query.mft
rpm -qp --qf "%{nvr}\n" query.mft
],
[0],
[hello-1.0-1
Expand All @@ -225,7 +225,7 @@ AT_SETUP([rpm -q --scripts -p *.i386.rpm])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
-q --scripts \
-p /data/RPMS/hello-1.0-1.i386.rpm
],
Expand Down Expand Up @@ -346,7 +346,7 @@ AT_SETUP([integer array query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{filemodes}\n]]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -363,7 +363,7 @@ AT_SETUP([formatted filesbypkg query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%-10{=NAME} %{FILENAMES}\n]]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -380,7 +380,7 @@ AT_SETUP([hex formatted integer array extension query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%5{longfilesizes:hex}\n]]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand Down Expand Up @@ -412,7 +412,7 @@ AT_KEYWORDS([query signature])
AT_SKIP_IF([test x$PGP = xdummy])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%{rsaheader:pgpsig}" \
-qp /data/RPMS/hello-2.0-1.x86_64-signed.rpm
],
Expand Down Expand Up @@ -444,7 +444,7 @@ AT_SETUP([string array query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{basenames} ]]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand Down Expand Up @@ -472,7 +472,7 @@ AT_SETUP([empty string array extension array format])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{filenames}]]" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -486,7 +486,7 @@ AT_SETUP([empty string array extension query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%{filenames}" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -500,7 +500,7 @@ AT_SETUP([different sizes arrays query 1])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{basenames} %{changelogname}]\n]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -517,7 +517,7 @@ AT_SETUP([different sizes arrays query 2])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{name} %{changelogtime}]\n]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -532,7 +532,7 @@ AT_SETUP([different sizes arrays query 3])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{name} %{basenames}]\n]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -547,7 +547,7 @@ AT_SETUP([different sizes arrays query 4])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="[[%{=name} %{basenames}\n]]" \
-qp /data/RPMS/hello-1.0-1.i386.rpm
],
Expand All @@ -564,7 +564,7 @@ AT_SETUP([non-existent string tag])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%{vendor}" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand Down Expand Up @@ -592,7 +592,7 @@ AT_SETUP([conditional queryformat])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%|name?{%{name}}:{no}| %|installtime?{%{installtime}}:{(not installed)}|" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -606,7 +606,7 @@ AT_SETUP([invalid tag query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%{notag}" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -621,7 +621,7 @@ AT_SETUP([invalid data for format query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%{name:depflags}" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -635,7 +635,7 @@ AT_SETUP([invalid format width query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat="%ss{size}" \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -649,7 +649,7 @@ AT_SETUP([xml format])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm -qp --xml /data/RPMS/hello-2.0-1.x86_64.rpm
rpm -qp --xml /data/RPMS/hello-2.0-1.x86_64.rpm
],
[0],
[<rpmHeader>
Expand Down Expand Up @@ -949,7 +949,7 @@ AT_SETUP([json format 1])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm -qp --json /data/RPMS/hello-2.0-1.x86_64.rpm
rpm -qp --json /data/RPMS/hello-2.0-1.x86_64.rpm
],
[0],
[[{
Expand Down Expand Up @@ -1211,7 +1211,7 @@ AT_SETUP([query file attribute filtering])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpmbuild -bb --quiet \
rpmbuild -bb --quiet \
/data/SPECS/vattrtest.spec

pkg="/build/RPMS/noarch/vattrtest-1.0-1.noarch.rpm"
Expand Down Expand Up @@ -1266,13 +1266,13 @@ AT_SETUP([formatting name humansi, humaniec])
AT_KEYWORDS([query, humansi, humaniec])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat '%{SIZE:humansi} %{SIZE:humaniec}\n' \
-qp /data/RPMS/hello-1.0-1.i386.rpm
runroot rpm \
rpm \
--queryformat '%{SIZE:humansi} %{SIZE:humaniec}\n' \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
runroot rpm \
rpm \
--queryformat '%{SIZE:humansi} %{SIZE:humaniec}\n' \
-qp /data/SRPMS/foo-1.0-1.src.rpm
],
Expand All @@ -1289,7 +1289,7 @@ AT_SETUP([incomplete escape sequence for format query])
AT_KEYWORDS([query])
RPMTEST_CHECK([
RPMDB_INIT
runroot rpm \
rpm \
--queryformat='%{NAME}\n\' \
-qp /data/RPMS/foo-1.0-1.noarch.rpm
],
Expand All @@ -1305,7 +1305,7 @@ AT_KEYWORDS([query])
RPMDB_INIT

RPMTEST_CHECK([
runroot rpmspec -q --qf "[[%{*:tagnum}\n]]" --srpm /data/SPECS/mini.spec
rpmspec -q --qf "[[%{*:tagnum}\n]]" --srpm /data/SPECS/mini.spec
],
[0],
[100
Expand All @@ -1323,7 +1323,7 @@ runroot rpmspec -q --qf "[[%{*:tagnum}\n]]" --srpm /data/SPECS/mini.spec
[])

RPMTEST_CHECK([
runroot rpmspec -q --qf "[[%{*:tagname}\n]]" --srpm /data/SPECS/mini.spec
rpmspec -q --qf "[[%{*:tagname}\n]]" --srpm /data/SPECS/mini.spec
],
[0],
[Headeri18ntable
Expand Down
Loading

0 comments on commit eb10687

Please sign in to comment.