]>
git.saurik.com Git - apt.git/blob - test/integration/test-apt-update-hooks
4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'i386'
11 insertpackage 'unstable' 'foo' 'i386' '1.0'
12 insertpackage 'testing' 'foo' 'i386' '1.0'
14 setupaptarchive --no-update
15 APTARCHIVE="$(readlink -f ./aptarchive)"
17 signreleasefiles 'Joe Sixpack'
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
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
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)')"
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
41 msgmsg "All sources broken => run Post-Invoke"
42 sed -i -e '/^
/ d
' -e '/^SHA512
:/ d
' "$APTARCHIVE/dists/testing/Release"
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