test-apt-key-used-in-maintainerscript 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. unset APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE
  7. configarchitecture 'native'
  8. configdpkgnoopchroot
  9. buildingpkg() {
  10. local PKG="$1"
  11. shift
  12. setupsimplenativepackage "$PKG" 'native' '1' 'unstable' "$@"
  13. BUILDDIR="incoming/${PKG}-1"
  14. echo '#!/bin/sh
  15. apt-key list >/dev/null' > "${BUILDDIR}/debian/postinst"
  16. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  17. rm -rf "$BUILDDIR"
  18. }
  19. buildingpkg 'aptkeyuser-nodepends' 'Depends: unrelated'
  20. buildingpkg 'aptkeyuser-depends' 'Depends: gnupg'
  21. insertinstalledpackage 'unrelated' 'native' '1'
  22. insertinstalledpackage 'gnupg' 'native' '1'
  23. testdpkgnotinstalled 'aptkeyuser-depends' 'aptkeyuser-nodepends'
  24. testsuccess apt install ./incoming/aptkeyuser-depends_*.changes -y
  25. cp rootdir/tmp/testsuccess.output apt.output
  26. testdpkginstalled 'aptkeyuser-depends'
  27. testfailure grep '^Warning: This will BREAK' apt.output
  28. testsuccess grep '^Warning: apt-key' apt.output
  29. testsuccess apt install --with-source ./incoming/aptkeyuser-nodepends_*.changes aptkeyuser-nodepends -y
  30. cp rootdir/tmp/testsuccess.output apt.output
  31. testdpkginstalled 'aptkeyuser-nodepends'
  32. testsuccess grep '^Warning: This will BREAK' apt.output
  33. testsuccess grep '^Warning: apt-key' apt.output
  34. testsuccess aptkey list
  35. cp rootdir/tmp/testsuccess.output aptkey.list
  36. testsuccess grep '^Warning: apt-key' aptkey.list