test-apt-key-used-in-maintainerscript 910 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'native'
  7. configdpkgnoopchroot
  8. buildingpkg() {
  9. local PKG="$1"
  10. shift
  11. setupsimplenativepackage "$PKG" 'native' '1' 'unstable' "$@"
  12. BUILDDIR="incoming/${PKG}-1"
  13. echo '#!/bin/sh
  14. apt-key list' > "${BUILDDIR}/debian/postinst"
  15. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  16. rm -rf "$BUILDDIR"
  17. }
  18. buildingpkg 'aptkeyuser-nodepends' 'Depends: unrelated'
  19. buildingpkg 'aptkeyuser-depends' 'Depends: gnupg'
  20. setupaptarchive
  21. insertinstalledpackage 'unrelated' 'native' '1'
  22. insertinstalledpackage 'gnupg' 'native' '1'
  23. testsuccess apt install aptkeyuser-depends -y
  24. testfailure grep '^Warning: This will BREAK' rootdir/tmp/testsuccess.output
  25. testsuccess apt install aptkeyuser-nodepends -y
  26. cp rootdir/tmp/testsuccess.output apt.output
  27. testsuccess grep '^Warning: This will BREAK' apt.output