]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-604401-files-are-directories
eipp: add Allow-Temporary-Remove-of-Essentials
[apt.git] / test / integration / test-bug-604401-files-are-directories
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
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
14testsuccess --nomsg aptconfig dump
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
20testempty aptconfig shell TestLink 'Test::APT::Link'
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
25testsuccess --nomsg aptconfig dump
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
33testsuccess --nomsg aptget update --print-uris
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
39testempty aptget update --print-uris
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
44testempty aptget update --print-uris
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
52testsuccess --nomsg aptcache policy
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
60testsuccess aptcache policy
61testfailure grep '1000 ' rootdir/tmp/testsucess.output
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
66testsuccess --nomsg aptcache policy
67rm rootdir/etc/apt/preferences