test-apt-key 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. msgtest 'Check that paths in list output are not' 'double-slashed'
  8. aptkey list 2>&1 | grep -q '//' && msgfail || msgpass
  9. msgtest 'Check that paths in finger output are not' 'double-slashed'
  10. aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass
  11. echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub";
  12. APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir/etc/apt/apt.conf.d/aptkey.conf
  13. aptkey list | grep '^pub' > aptkey.list
  14. testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
  15. testequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
  16. gpg: Total number processed: 1
  17. gpg: unchanged: 1' aptkey --fakeroot update
  18. aptkey list | grep '^pub' > aptkey.list
  19. testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
  20. testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
  21. aptkey list | grep '^pub' > aptkey.list
  22. testfileequal ./aptkey.list 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
  23. pub 2048R/DBAC8DAE 2010-08-18'
  24. msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
  25. testsuccess --nomsg aptkey --fakeroot update
  26. aptkey list | grep '^pub' > aptkey.list
  27. testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'