]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-update-hooks
add apt-key support for armored GPG key files (*.asc)
[apt.git] / test / integration / test-apt-update-hooks
... / ...
CommitLineData
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'
12insertpackage 'testing' 'foo' 'i386' '1.0'
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"
31testsuccess rm "$(aptget indextargets 'Created-By: Packages' 'Suite: testing' --format '$(FILENAME)')"
32signreleasefiles
33listcurrentlistsdirectory > lists.before
34testfailure apt update
35cp rootdir/tmp/testfailure.output aptupdate.output
36listcurrentlistsdirectory > lists.after
37testfailure cmp lists.before lists.after
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
44mv lists.after lists.before
45testfailure apt update
46cp rootdir/tmp/testfailure.output aptupdate.output
47testfileequal lists.before "$(listcurrentlistsdirectory)"
48testsuccess grep "RUN" aptupdate.output
49testfailure grep "SUCCESS" aptupdate.output