Skip to content

Commit

Permalink
fixup! Add test case for ima file signatures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dmnks committed Nov 21, 2024
1 parent 776ad98 commit f86ae36
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/rpmsigdig.at
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit f86ae36

Please sign in to comment.