]>
Commit | Line | Data |
---|---|---|
e5837128 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture "i386" | |
9 | ||
13845042 | 10 | buildsimplenativepackage 'apt' 'all' '1.0' 'stable' |
e5837128 | 11 | |
75b09312 | 12 | setupaptarchive --no-update |
13845042 | 13 | changetowebserver |
75b09312 | 14 | testsuccess aptget update |
e5837128 | 15 | |
43acd019 DK |
16 | # simulate normal user with non-existent root-owned directories |
17 | rm -rf rootdir/var/cache/apt/archives/ | |
18 | mkdir rootdir/var/cache/apt/archives/ | |
19 | addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;" | |
20 | chmod -R -w rootdir/var/cache/apt/archives | |
21 | ||
75b09312 | 22 | echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf |
e5837128 | 23 | |
25b86db1 | 24 | testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt --print-uris |
fcb144b9 | 25 | |
25b86db1 | 26 | testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog' |
03aa0847 DK |
27 | 'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris |
28 | ||
29 | cd downloaded | |
a98b6615 | 30 | |
68ba0b7f | 31 | testsuccess aptget changelog apt -qq |
03aa0847 | 32 | testfileequal '../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/apt_1.0/changelog)" |
72dd5bec | 33 | |
75b09312 | 34 | testsuccess aptget changelog apt -d |
03aa0847 | 35 | testfileequal 'apt.changelog' "$(cat ../aptarchive/pool/apt_1.0/changelog)" |
4bb006d1 | 36 | testfilestats 'apt.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" |
03aa0847 | 37 | rm -f apt.changelog ../aptarchive/pool/apt_1.0/changelog |
13845042 | 38 | |
03aa0847 | 39 | testequal "$(cat ../aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \ |
22da5c13 | 40 | -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' |
72dd5bec | 41 | |
75b09312 | 42 | testsuccess aptget changelog apt -d |
03aa0847 | 43 | testfileequal 'apt.changelog' "$(cat ../aptarchive/pool/apt_1.0.changelog)" |
4bb006d1 | 44 | testfilestats 'apt.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" |
03aa0847 | 45 | rm -f apt.changelog ../aptarchive/pool/apt_1.0.changelog |
13845042 | 46 | |
03aa0847 DK |
47 | testequal 'E: changelog download failed' aptget changelog apt -qq -d -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' |
48 | testfailure test -e apt.changelog |