From f86ae36dd8de4c3df97f2e45dcbfaf3e5bca3f92 Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Thu, 21 Nov 2024 12:48:31 +0100 Subject: [PATCH] fixup! Add test case for ima file signatures We need double [[ and ]] because one level is consumed by M4 and that causes the resulting query format to only print one file, not all. That also means we can no longer just cut the first 20 chars, replace the signature hex string with a (...), we only care about there being a signature on every file. --- tests/rpmsigdig.at | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/rpmsigdig.at b/tests/rpmsigdig.at index 667ee7e624..6e94973b46 100644 --- a/tests/rpmsigdig.at +++ b/tests/rpmsigdig.at @@ -1633,13 +1633,18 @@ cp /data/RPMS/hello-2.0-1.x86_64.rpm /tmp/ gpg2 --import /data/keys/rpm.org-rsa-2048-test.secret rpmsign --key-id 4344591E1964C5FC --addsign --signfiles --fskpath=/data/keys/privkey.pem /tmp/hello-2.0-1.x86_64.rpm -RPMTEST_CHECK([ -rpm -qp --qf "[%{filenames} %{filesignatures}\n]" /tmp/hello-2.0-1.x86_64.rpm | cut -c -20 -rpm -qp --qf "[%{filenames} %{filesignatures}\n]" /data/RPMS/imatest-1.0-1.fc34.noarch.rpm -], +RPMTEST_CHECK([[ +rpm -qp --qf "[%{filenames}:%{filesignatures}\n]" /tmp/hello-2.0-1.x86_64.rpm | sed 's/:.\+$/:(...)/' +rpm -qp --qf "[%{filenames}:%{filesignatures}\n]" /data/RPMS/imatest-1.0-1.fc34.noarch.rpm +]], [0], -[/usr/bin/hello 03020 -/usr/share/example1 030204a598255400483046022100e5117bdafa73baaeb1f1dc46ecaa46981a62d417745a33532572b63dc6d95d16022100c789107ac5b91e2d915e1df3c7b78414f6b3f50899d44c1de381d0e938dfc82b +[/usr/bin/hello:(...) +/usr/share/doc/hello-2.0: +/usr/share/doc/hello-2.0/COPYING:(...) +/usr/share/doc/hello-2.0/FAQ:(...) +/usr/share/doc/hello-2.0/README:(...) +/usr/share/example1:030204a598255400483046022100e5117bdafa73baaeb1f1dc46ecaa46981a62d417745a33532572b63dc6d95d16022100c789107ac5b91e2d915e1df3c7b78414f6b3f50899d44c1de381d0e938dfc82b +/usr/share/example2:030204a598255400473045022100c10943795bff5d9c0db53dd4f8e4b845615fd08a2be295c30a80f5bdb4e6a41302203038840cc6abaab92acb56cb3e3ce520b17f22ff7444a8d5d0f703a44d5307a3 ], [ignore])