]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-hooks
apt-key: warn instead of fail on unreadable keyrings
[apt.git] / test / integration / test-apt-update-hooks
CommitLineData
35664152
JAK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture 'i386'
9confighashes 'SHA512'
10
11insertpackage 'unstable' 'foo' 'i386' '1.0'
57f7fb65 12insertpackage 'testing' 'foo' 'i386' '1.0'
35664152
JAK
13
14setupaptarchive --no-update
15APTARCHIVE="$(readlink -f ./aptarchive)"
16
17signreleasefiles 'Joe Sixpack'
18
19echo 'APT::Update::Post-Invoke-Success { "echo SUCCESS"; };' >> rootdir/etc/apt/apt.conf.d/display-success.conf
20echo 'APT::Update::Post-Invoke { "echo RUN"; };' >> rootdir/etc/apt/apt.conf.d/display-success.conf
21
22
23msgmsg "All sources OK => run Post-Invoke-Success and Post-Invoke"
24testsuccess aptget update
25cp rootdir/tmp/testsuccess.output aptupdate.output
26testsuccess grep "RUN" aptupdate.output
27testsuccess grep "SUCCESS" aptupdate.output
28
29msgmsg "Some sources broken => run Post-Invoke-Success and Post-Invoke"
30sed -i -e '/^ / d' -e '/^SHA512:/ d' "$APTARCHIVE/dists/unstable/Release"
57f7fb65 31testsuccess rm "$(aptget indextargets 'Created-By: Packages' 'Suite: testing' --format '$(FILENAME)')"
35664152 32signreleasefiles
57f7fb65
DK
33listcurrentlistsdirectory > lists.before
34testfailure apt update
35664152 35cp rootdir/tmp/testfailure.output aptupdate.output
57f7fb65
DK
36listcurrentlistsdirectory > lists.after
37testfailure cmp lists.before lists.after
35664152
JAK
38testsuccess grep "RUN" aptupdate.output
39testsuccess grep "SUCCESS" aptupdate.output
40
41msgmsg "All sources broken => run Post-Invoke"
42sed -i -e '/^ / d' -e '/^SHA512:/ d' "$APTARCHIVE/dists/testing/Release"
43signreleasefiles
57f7fb65
DK
44mv lists.after lists.before
45testfailure apt update
35664152 46cp rootdir/tmp/testfailure.output aptupdate.output
57f7fb65 47testfileequal lists.before "$(listcurrentlistsdirectory)"
35664152
JAK
48testsuccess grep "RUN" aptupdate.output
49testfailure grep "SUCCESS" aptupdate.output