summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-get-changelog
blob: d64a09bd655c63b0b90eec3218bfb5b187a45933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework

setupenvironment
configarchitecture "i386"

buildsimplenativepackage 'apt' 'all' '1.0' 'stable'

setupaptarchive --no-update
changetowebserver
testsuccess aptget update

echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf

testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris

testequal "'http://localhost:8080//pool/apt_1.0/changelog'
'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris

aptget changelog apt -qq > apt.changelog
testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)"
rm apt.changelog

testsuccess aptget changelog apt -d
testfileequal 'apt.changelog' "$(cat  aptarchive/pool/apt_1.0/changelog)"
rm apt.changelog aptarchive/pool/apt_1.0/changelog

aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' > apt.changelog
testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)"
rm apt.changelog

testsuccess aptget changelog apt -d
testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)"
rm apt.changelog aptarchive/pool/apt_1.0.changelog

# note that this output is different on ubuntu and debian
testequal 'E: changelog for this version is not (yet) available; try https://launchpad.net/ubuntu/+source/apt/+changelog' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'