]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | set -e | |
3 | ||
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" | |
5 | . "$TESTDIR/framework" | |
6 | setupenvironment | |
7 | configarchitecture "i386" | |
8 | setupaptarchive | |
9 | ||
10 | test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/apt/apt.conf.d/000move-away-apt.conf | |
11 | ||
12 | msgtest "Directory instead of a file as apt.conf ignored" | |
13 | mkdir -p rootdir/etc/apt/apt.conf | |
14 | testsuccess --nomsg aptconfig dump | |
15 | rmdir rootdir/etc/apt/apt.conf | |
16 | ||
17 | msgtest "Good link instead of a file as apt.conf ignored" | |
18 | echo 'Test::APT::Link "good";' > rootdir/etc/apt/good-link.conf | |
19 | ln -s rootdir/etc/apt/good-link.conf rootdir/etc/apt/apt.conf | |
20 | testempty aptconfig shell TestLink 'Test::APT::Link' | |
21 | rm rootdir/etc/apt/apt.conf | |
22 | ||
23 | msgtest "Broken link instead of a file as apt.conf ignored" | |
24 | ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf | |
25 | testsuccess --nomsg aptconfig dump | |
26 | rm rootdir/etc/apt/apt.conf | |
27 | ||
28 | ||
29 | test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdir/etc/apt/sources.list.d/000move-away-sources.list | |
30 | ||
31 | msgtest "Directory instead of a file as sources.list ignored" | |
32 | mkdir -p rootdir/etc/apt/sources.list | |
33 | testsuccess --nomsg aptget update --print-uris | |
34 | rmdir rootdir/etc/apt/sources.list | |
35 | ||
36 | msgtest "Good link instead of a file as sources.list ignored" | |
37 | echo 'deb file:///tmp/debian sid main' > rootdir/etc/apt/good-link.list | |
38 | ln -s rootdir/etc/apt/good-link.list rootdir/etc/apt/sources.list | |
39 | testempty aptget update --print-uris | |
40 | rm rootdir/etc/apt/sources.list | |
41 | ||
42 | msgtest "Broken link instead of a file as sources.list ignored" | |
43 | ln -s /tmp/doesnt-exist rootdir/etc/apt/sources.list | |
44 | testempty aptget update --print-uris | |
45 | rm rootdir/etc/apt/sources.list | |
46 | ||
47 | ||
48 | test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/etc/apt/preferences.d/000move-away-preferences | |
49 | ||
50 | msgtest "Directory instead of a file as preferences ignored" | |
51 | mkdir -p rootdir/etc/apt/preferences | |
52 | testsuccess --nomsg aptcache policy | |
53 | rmdir rootdir/etc/apt/preferences | |
54 | ||
55 | msgtest "Good link instead of a file as preferences ignored" | |
56 | echo 'Package: apt | |
57 | Pin: release a=now | |
58 | Pin-Value: 1000' > rootdir/etc/apt/good-link.pref | |
59 | ln -s rootdir/etc/apt/good-link.pref rootdir/etc/apt/preferences | |
60 | testsuccess aptcache policy | |
61 | testfailure grep '1000 ' rootdir/tmp/testsucess.output | |
62 | rm rootdir/etc/apt/preferences | |
63 | ||
64 | msgtest "Broken link instead of a file as preferences ignored" | |
65 | ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences | |
66 | testsuccess --nomsg aptcache policy | |
67 | rm rootdir/etc/apt/preferences |