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