]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-get-changelog
testcases runable as root
[apt.git] / test / integration / test-apt-get-changelog
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6
7 setupenvironment
8 configarchitecture "i386"
9
10 buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
11
12 setupaptarchive --no-update
13 changetowebserver
14 testsuccess aptget update
15
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
22 echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf
23
24 testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris
25
26 testequal "'http://localhost:8080//pool/apt_1.0/changelog'
27 'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris
28
29 testsuccess aptget changelog apt -qq
30 testfileequal 'rootdir/tmp/testsuccess.output' "$(cat aptarchive/pool/apt_1.0/changelog)"
31
32 testsuccess aptget changelog apt -d
33 testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)"
34 rm -f apt.changelog aptarchive/pool/apt_1.0/changelog
35
36 testequal "$(cat aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \
37 -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'
38
39 testsuccess aptget changelog apt -d
40 testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)"
41 rm -f apt.changelog aptarchive/pool/apt_1.0.changelog
42
43 testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'