]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-key-used-in-maintainerscript
don't purge directly, but remove and do purge at the end
[apt.git] / test / integration / test-apt-key-used-in-maintainerscript
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8unset APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE
9configarchitecture 'native'
10configdpkgnoopchroot
11
12buildingpkg() {
13 local PKG="$1"
14 shift
15 setupsimplenativepackage "$PKG" 'native' '1' 'unstable' "$@"
16 BUILDDIR="incoming/${PKG}-1"
17 echo '#!/bin/sh
18apt-key list >/dev/null' > "${BUILDDIR}/debian/postinst"
19 buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
20 rm -rf "$BUILDDIR"
21}
22buildingpkg 'aptkeyuser-nodepends' 'Depends: unrelated'
23buildingpkg 'aptkeyuser-depends' 'Depends: gnupg'
24
25insertinstalledpackage 'unrelated' 'native' '1'
26insertinstalledpackage 'gnupg' 'native' '1'
27testdpkgnotinstalled 'aptkeyuser-depends' 'aptkeyuser-nodepends'
28
29testsuccess apt install ./incoming/aptkeyuser-depends_*.changes -y
30cp rootdir/tmp/testsuccess.output apt.output
31testdpkginstalled 'aptkeyuser-depends'
32testfailure grep '^Warning: This will BREAK' apt.output
33testsuccess grep '^Warning: apt-key' apt.output
34
35testsuccess apt install ./incoming/aptkeyuser-nodepends_*.changes -y
36cp rootdir/tmp/testsuccess.output apt.output
37testdpkginstalled 'aptkeyuser-nodepends'
38testsuccess grep '^Warning: This will BREAK' apt.output
39testsuccess grep '^Warning: apt-key' apt.output
40
41testsuccess aptkey list
42cp rootdir/tmp/testsuccess.output aptkey.list
43testsuccess grep '^Warning: apt-key' aptkey.list