From eb10687a5200c8431be6960c166db3b952541477 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 15 Nov 2024 14:29:24 +0200 Subject: [PATCH] Eliminate a bunch of now unnecessary runroot() uses 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. --- tests/rpmquery.at | 82 +++++++++++++++++++++++------------------------ tests/rpmspec.at | 38 +++++++++++----------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/rpmquery.at b/tests/rpmquery.at index abdc941d48..33c5708bc9 100644 --- a/tests/rpmquery.at +++ b/tests/rpmquery.at @@ -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 ], @@ -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 ], @@ -53,7 +53,7 @@ AT_SETUP([rpm -qp ]) AT_KEYWORDS([query]) RPMTEST_CHECK([ RPMDB_INIT -runroot rpm \ +rpm \ -qp "/data/RPMS/hello-2.0-1.{i686,x86_64}.rpm" ], [0], @@ -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], @@ -84,7 +84,7 @@ AT_SETUP([rpm -qp ]) 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 @@ -101,7 +101,7 @@ AT_SETUP([rpm -qp ]) 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 @@ -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 ], @@ -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 ], @@ -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 ], @@ -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], @@ -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 ], @@ -203,12 +203,12 @@ AT_SETUP([rpm -qp ]) 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 @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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 ], @@ -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], [ @@ -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], [[{ @@ -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" @@ -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 ], @@ -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 ], @@ -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 @@ -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 diff --git a/tests/rpmspec.at b/tests/rpmspec.at index 0de41f3ea2..d5cc43c879 100644 --- a/tests/rpmspec.at +++ b/tests/rpmspec.at @@ -12,7 +12,7 @@ AT_BANNER([RPM Spec Tool]) AT_SETUP([rpmspec --query Requires]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex}\n]' \ /data/SPECS/test-parsebits.spec ]], @@ -37,7 +37,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(,)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(,): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -52,7 +52,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(;)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(;): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -67,7 +67,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(junk)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(junk): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -82,7 +82,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre,junk)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre,junk): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -97,7 +97,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(junk,pre)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(junk,pre): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -112,7 +112,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(,pre)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(,pre): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -127,7 +127,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre,)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre,): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -142,7 +142,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre,,postun)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre,,postun): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -157,7 +157,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre,,junk)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre,,junk): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -172,7 +172,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(;pre)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(;pre): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -187,7 +187,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre;)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre;): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -202,7 +202,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre;postun)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre;postun): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -217,7 +217,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --query Requires(pre;junk)]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([[ -runroot rpmspec --query \ +rpmspec --query \ --define 'extra Requires(pre;junk): bad' \ --qf '[%{REQUIRENAME} %{REQUIREFLAGS:hex} %{REQUIREVERSION}\n]' \ /data/SPECS/test-parsebits.spec @@ -231,7 +231,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --parse]) AT_KEYWORDS([rpmspec]) -RPMTEST_CHECK([runroot rpmspec --parse /data/SPECS/foo.spec], +RPMTEST_CHECK([rpmspec --parse /data/SPECS/foo.spec], [0], [ @@ -273,8 +273,8 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec --srpm provides]) AT_KEYWORDS([rpmspec]) RPMTEST_CHECK([ -runroot rpmspec -q --srpm --provides /data/SPECS/foo.spec -runroot rpmspec -q --srpm --provides --with bus /data/SPECS/foo.spec +rpmspec -q --srpm --provides /data/SPECS/foo.spec +rpmspec -q --srpm --provides --with bus /data/SPECS/foo.spec ], [0], [foo = 1.0-1 @@ -363,7 +363,7 @@ RPMTEST_CLEANUP AT_SETUP([rpmspec -q --rpms and --srpm]) AT_KEYWORDS([rpmspec query]) RPMTEST_CHECK([ -runroot rpmspec -q --rpms --target s390x \ +rpmspec -q --rpms --target s390x \ /data/SPECS/hello.spec ], [0], @@ -372,7 +372,7 @@ runroot rpmspec -q --rpms --target s390x \ []) RPMTEST_CHECK([ -runroot rpmspec -q --srpm \ +rpmspec -q --srpm \ /data/SPECS/hello.spec ], [0],