4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
'native'
10 buildsimplenativepackage
'foo' 'all' '1.0' 'stable'
11 buildsimplenativepackage
'libbar' 'all' '1.0' 'stable'
13 getlabelfromsuite
() { echo 'Testcases'; }
14 getoriginfromsuite
() { echo 'Debian'; }
16 setupaptarchive
--no-update
18 testsuccess aptget update
20 testsuccessequal
"'http://metadata.ftp-master.debian.org/changelogs/main/f/foo/foo_1.0_changelog' foo.changelog
21 'http://metadata.ftp-master.debian.org/changelogs/main/libb/libbar/libbar_1.0_changelog' libbar.changelog" aptget changelog foo libbar
--print-uris
24 # modifying the Release files in lists… bad stuff. Good that this is only a test…
25 sed -i "s#^${1}: .*#${1}: ${2}#" $(find rootdir/var/lib/apt/lists -name '*Release')
26 rm -f rootdir
/var
/cache
/apt
/*.bin
28 releasechanger
'Origin' 'Ubuntu'
29 testsuccessequal
"'http://changelogs.ubuntu.com/changelogs/pool/main/f/foo/foo_1.0/changelog' foo.changelog
30 'http://changelogs.ubuntu.com/changelogs/pool/main/libb/libbar/libbar_1.0/changelog' libbar.changelog" aptget changelog foo libbar
--print-uris
32 releasechanger
'Label' 'Debian'
33 testsuccessequal
"'http://changelogs.ubuntu.com/changelogs/pool/main/f/foo/foo_1.0/changelog' foo.changelog
34 'http://changelogs.ubuntu.com/changelogs/pool/main/libb/libbar/libbar_1.0/changelog' libbar.changelog" aptget changelog foo libbar
--print-uris
36 testsuccessequal
"'http://localhost:8080/main/f/foo/foo_1.0.changelog' foo.changelog
37 'http://localhost:8080/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar
--print-uris -o Acquire
::Changelogs
::URI
::Label
::Debian
='http://localhost:8080/CHANGEPATH.changelog'
39 sed -i '/^Origin: / a\
40 Changelogs: http://example.org/CHANGEPATH-changelog' $(find rootdir/var/lib/apt/lists -name '*Release')
41 rm -f rootdir
/var
/cache
/apt
/*.bin
43 testsuccessequal
"'http://example.org/main/f/foo/foo_1.0-changelog' foo.changelog
44 'http://example.org/main/libb/libbar/libbar_1.0-changelog' libbar.changelog" aptget changelog foo libbar
--print-uris -o Acquire
::Changelogs
::URI
::Label
::Debian
='http://localhost:8080/CHANGEPATH.changelog'
46 testsuccessequal
"'http://localhost:8080/main/f/foo/foo_1.0.changelog' foo.changelog
47 'http://localhost:8080/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar
--print-uris -o Acquire
::Changelogs
::URI
::Override
::Label
::Debian
='http://localhost:8080/CHANGEPATH.changelog'
49 releasechanger
'Changelogs' 'no'
50 testequal
'E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0
51 ' aptget changelog foo
-qq -d
53 sed -i '/^Changelogs: / d' $(find rootdir/var/lib/apt/lists -name '*Release')
54 releasechanger
'Label' 'Testcases'
56 echo 'Acquire::Changelogs::URI::Label::Testcases "http://localhost:8080/CHANGEPATH/change.txt";' > rootdir
/etc
/apt
/apt.conf.d
/changelog.conf
57 testsuccessequal
"'http://localhost:8080/main/f/foo/foo_1.0/change.txt' foo.changelog
58 'http://localhost:8080/main/libb/libbar/libbar_1.0/change.txt' libbar.changelog" aptget changelog foo libbar
--print-uris
60 echo 'Acquire::Changelogs::URI::Label::Testcases "http://localhost:8080/pool/CHANGEPATH/changelog";' > rootdir
/etc
/apt
/apt.conf.d
/changelog.conf
61 testsuccessequal
"'http://localhost:8080/pool/main/f/foo/foo_1.0/changelog' foo.changelog" aptget changelog foo
--print-uris
65 testsuccess aptget changelog foo
-qq
66 testfileequal
'../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)"
68 testsuccess aptget changelog foo libbar
-qq
69 testfileequal
'../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)
70 $(cat ../aptarchive/pool/main/libb/libbar/libbar_1.0/changelog)"
72 testsuccess aptget changelog foo
-d
73 testfilestats
'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644"
74 testfileequal
'foo.changelog' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)"
77 testsuccess aptget changelog libbar foo
-d
78 testfilestats
'libbar.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644"
79 testfilestats
'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644"
80 testfileequal
'libbar.changelog' "$(cat ../aptarchive/pool/main/libb/libbar/libbar_1.0/changelog)"
81 testfileequal
'foo.changelog' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)"
82 rm -f libbar.changelog foo.changelog
84 # as such bogus, but can happen with multiple binaries from the same source
85 testsuccessequal
"'http://localhost:8080/pool/main/f/foo/foo_1.0/changelog' foo.changelog
86 'http://localhost:8080/pool/main/f/foo/foo_1.0/changelog' foo.changelog" aptget changelog foo foo
--print-uris
87 testsuccess aptget changelog foo foo
-qq
88 testfileequal
'../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)
89 $(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)"
90 testsuccess aptget changelog foo foo
-d
91 testfilestats
'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644"
92 testfileequal
'foo.changelog' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)"
95 # no CHANGEPATH in the URI
96 testequal
'E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0
97 ' aptget changelog foo
-qq -d -o Acquire
::Changelogs
::URI
::Label
::Testcases
='http://localhost:8080/change.txt'
98 testfailure
test -e foo.changelog
100 testequal
'E: Failed to fetch http://localhost:8080/does/not/exist/main/f/foo/foo_1.0/change.txt Changelog unavailable for foo=1.0 (404 Not Found)
101 ' aptget changelog foo
-qq -d -o Acquire
::Changelogs
::URI
::Label
::Testcases
='http://localhost:8080/does/not/exist/CHANGEPATH/change.txt'
102 testfailure
test -e foo.changelog