]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-key-used-in-maintainerscript
test: Use a file to determine TEST_DEFAULT_GROUP
[apt.git] / test / integration / test-apt-key-used-in-maintainerscript
CommitLineData
5f17b19f
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
08fcf962 8unset APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE
5f17b19f
DK
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
08fcf962 18apt-key list >/dev/null' > "${BUILDDIR}/debian/postinst"
5f17b19f
DK
19 buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
20 rm -rf "$BUILDDIR"
21}
22buildingpkg 'aptkeyuser-nodepends' 'Depends: unrelated'
23buildingpkg 'aptkeyuser-depends' 'Depends: gnupg'
24
5f17b19f
DK
25insertinstalledpackage 'unrelated' 'native' '1'
26insertinstalledpackage 'gnupg' 'native' '1'
92296fe4 27testdpkgnotinstalled 'aptkeyuser-depends' 'aptkeyuser-nodepends'
5f17b19f 28
92296fe4 29testsuccess apt install ./incoming/aptkeyuser-depends_*.changes -y
08fcf962 30cp rootdir/tmp/testsuccess.output apt.output
92296fe4 31testdpkginstalled 'aptkeyuser-depends'
08fcf962
DK
32testfailure grep '^Warning: This will BREAK' apt.output
33testsuccess grep '^Warning: apt-key' apt.output
5f17b19f 34
8bd823d0 35testsuccess apt install --with-source ./incoming/aptkeyuser-nodepends_*.changes aptkeyuser-nodepends -y
5f17b19f 36cp rootdir/tmp/testsuccess.output apt.output
92296fe4 37testdpkginstalled 'aptkeyuser-nodepends'
5f17b19f 38testsuccess grep '^Warning: This will BREAK' apt.output
08fcf962
DK
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