diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2017-04-10 10:21:55 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2017-04-10 10:25:33 +0300 |
commit | 016c37900dc9acb739fb29fe21f9a1b5b4c0ecfb (patch) | |
tree | ad279dd278e4570675c941351babc399f7536cb9 | |
parent | c707ab26362e795d3f9dba4eb87dc7ed99a28bcb (diff) | |
download | rpm-016c37900dc9acb739fb29fe21f9a1b5b4c0ecfb.tar.gz |
Basic signing tests, take II
Essentially reverts commit 40efa628a513fa43e47b0151d69c9fa8c8a56ba4
but with two differences: use $(abs_srcdir) instead of $(srcdir)
for base of HOME which seems to make things work fairly reliably.
Knock wood, and watch out for 'em pixies... The other thing is
to drop -q(uiet) from the import commands, those were a leftover
from importing in the test itself, but better import just once
because we're not here testing gpg really.
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/rpmsigdig.at | 92 |
2 files changed, 47 insertions, 46 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 6ba497d15..d96d70101 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -125,6 +125,7 @@ testing$(bindir)/rpmbuild: ../rpmbuild for prog in gzip cat patch tar sh ln chmod rm mkdir uname grep sed find file ionice mktemp nice cut sort diff touch; do p=`which $${prog}`; ln -s $${p} testing/$(bindir)/; done for d in /proc /sys /selinux /etc/selinux; do if [ -d $${d} ]; then ln -s $${d} testing/$${d}; fi; done (cd testing/magic && file -C) + HOME=$(abs_srcdir)/testing gpg2 --import data/keys/*.secret || HOME=$(abs_srcdir)/testing gpg --import data/keys/*.secret check_DATA = atconfig atlocal $(TESTSUITE) check_DATA += testing$(bindir)/rpmbuild diff --git a/tests/rpmsigdig.at b/tests/rpmsigdig.at index a2e2fcccb..a3dc5548a 100644 --- a/tests/rpmsigdig.at +++ b/tests/rpmsigdig.at @@ -147,38 +147,38 @@ AT_CLEANUP # ------------------------------ # Test --addsign -#AT_SETUP([rpmsign --addsign <unsigned>]) -#AT_KEYWORDS([rpmsign signature]) -#AT_CHECK([ -#RPMDB_CLEAR -#RPMDB_INIT -#rm -rf "${TOPDIR}" -# -#cp "${RPMDATA}"/RPMS/hello-2.0-1.x86_64.rpm "${RPMTEST}"/tmp/ -#run rpmsign --key-id 1964C5FC --addsign "${RPMTEST}"/tmp/hello-2.0-1.x86_64.rpm > /dev/null -#echo PRE-IMPORT -#runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm|grep -v digest -#echo POST-IMPORT -#runroot rpmkeys --import /data/keys/rpm.org-rsa-2048-test.pub -#runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm|grep -v digest -#run rpmsign --delsign "${RPMTEST}"/tmp/hello-2.0-1.x86_64.rpm > /dev/null -#echo POST-DELSIGN -#runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm|grep -v digest -#], -#[0], -#[PRE-IMPORT -#/tmp/hello-2.0-1.x86_64.rpm: -# Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY -# V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY -#POST-IMPORT -#/tmp/hello-2.0-1.x86_64.rpm: -# Header V4 RSA/SHA256 Signature, key ID 1964c5fc: OK -# V4 RSA/SHA256 Signature, key ID 1964c5fc: OK -#POST-DELSIGN -#/tmp/hello-2.0-1.x86_64.rpm: -#], -#[]) -#AT_CLEANUP +AT_SETUP([rpmsign --addsign <unsigned>]) +AT_KEYWORDS([rpmsign signature]) +AT_CHECK([ +RPMDB_CLEAR +RPMDB_INIT +rm -rf "${TOPDIR}" + +cp "${RPMDATA}"/RPMS/hello-2.0-1.x86_64.rpm "${RPMTEST}"/tmp/ +run rpmsign --key-id 1964C5FC --addsign "${RPMTEST}"/tmp/hello-2.0-1.x86_64.rpm > /dev/null +echo PRE-IMPORT +runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm|grep -v digest +echo POST-IMPORT +runroot rpmkeys --import /data/keys/rpm.org-rsa-2048-test.pub +runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm|grep -v digest +run rpmsign --delsign "${RPMTEST}"/tmp/hello-2.0-1.x86_64.rpm > /dev/null +echo POST-DELSIGN +runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm|grep -v digest +], +[0], +[PRE-IMPORT +/tmp/hello-2.0-1.x86_64.rpm: + Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY + V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY +POST-IMPORT +/tmp/hello-2.0-1.x86_64.rpm: + Header V4 RSA/SHA256 Signature, key ID 1964c5fc: OK + V4 RSA/SHA256 Signature, key ID 1964c5fc: OK +POST-DELSIGN +/tmp/hello-2.0-1.x86_64.rpm: +], +[]) +AT_CLEANUP # ------------------------------ # Test --delsign @@ -209,17 +209,17 @@ AT_CLEANUP # ------------------------------ # Test --addsign -#AT_SETUP([rpmsign --addsign <signed>]) -#AT_KEYWORDS([rpmsign signature]) -#AT_CHECK([ -#RPMDB_CLEAR -#RPMDB_INIT -#rm -rf "${TOPDIR}" -# -#cp "${RPMDATA}"/RPMS/hello-2.0-1.x86_64-signed.rpm "${RPMTEST}"/tmp/ -#run rpmsign --key-id 1964C5FC --addsign "${RPMTEST}"/tmp/hello-2.0-1.x86_64-signed.rpm 2>&1 |grep -q "already contains identical signature, skipping" -#], -#[0], -#[], -#[]) -#AT_CLEANUP +AT_SETUP([rpmsign --addsign <signed>]) +AT_KEYWORDS([rpmsign signature]) +AT_CHECK([ +RPMDB_CLEAR +RPMDB_INIT +rm -rf "${TOPDIR}" + +cp "${RPMDATA}"/RPMS/hello-2.0-1.x86_64-signed.rpm "${RPMTEST}"/tmp/ +run rpmsign --key-id 1964C5FC --addsign "${RPMTEST}"/tmp/hello-2.0-1.x86_64-signed.rpm 2>&1 |grep -q "already contains identical signature, skipping" +], +[0], +[], +[]) +AT_CLEANUP |