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