summaryrefslogtreecommitdiffstats
path: root/test/integration/test-ignored-files
blob: bc9eefb4d87600071a2c3eb7c0559fb684e9844b (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
41
42
#!/bin/sh
set -e

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

setupenvironment
configarchitecture 'amd64'
setupaptarchive

msgmsg "Check notices about .list and .sources directories in sources.list.d"
mkdir rootdir/etc/apt/sources.list.d/a-dir-that-will-be-ignored
mkdir rootdir/etc/apt/sources.list.d/a-dir-that-will-be-ignored.conf
mkdir rootdir/etc/apt/sources.list.d/a-dir-that-will-not-be-ignored.list
mkdir rootdir/etc/apt/sources.list.d/a-dir-that-will-not-be-ignored.sources
testsuccesswithnotice apt update
testequalor2 "Reading package lists...
Building dependency tree...
All packages are up to date.
N: Ignoring 'a-dir-that-will-not-be-ignored.sources' in directory '${TMPWORKINGDIRECTORY}/rootdir/etc/apt/sources.list.d/' as it is not a regular file
N: Ignoring 'a-dir-that-will-not-be-ignored.list' in directory '${TMPWORKINGDIRECTORY}/rootdir/etc/apt/sources.list.d/' as it is not a regular file" "Reading package lists...
Building dependency tree...
All packages are up to date.
N: Ignoring 'a-dir-that-will-not-be-ignored.list' in directory '${TMPWORKINGDIRECTORY}/rootdir/etc/apt/sources.list.d/' as it is not a regular file
N: Ignoring 'a-dir-that-will-not-be-ignored.sources' in directory '${TMPWORKINGDIRECTORY}/rootdir/etc/apt/sources.list.d/' as it is not a regular file" cat rootdir/tmp/testsuccesswithnotice.output
rmdir rootdir/etc/apt/sources.list.d/a-dir-*

msgmsg "Check for notices about .conf directories in apt.conf.d"
mkdir -p rootdir/etc/apt/apt.conf.d/a-dir-that-will-be-ignored
mkdir -p rootdir/etc/apt/apt.conf.d/a-dir-that-will-be-ignored.list
mkdir -p rootdir/etc/apt/apt.conf.d/a-dir-that-will-not-be-ignored.conf
testsuccessequal "N: Ignoring 'a-dir-that-will-not-be-ignored.conf' in directory '${TMPWORKINGDIRECTORY}/rootdir/etc/apt/apt.conf.d/' as it is not a regular file" aptconfig shell
rmdir rootdir/etc/apt/apt.conf.d/a-dir-*

msgmsg "Check for directory notices in preferences.d"
mkdir -p rootdir/etc/apt/preferences.d/a-dir-that-will-be-ignored
mkdir -p rootdir/etc/apt/preferences.d/a-dir-that-will-be-ignored.conf
mkdir -p rootdir/etc/apt/preferences.d/a-dir-that-will-not-be-ignored.pref
testsuccessequal "Package files:
Pinned packages:
N: Ignoring 'a-dir-that-will-not-be-ignored.pref' in directory '${TMPWORKINGDIRECTORY}/rootdir/etc/apt/preferences.d/' as it is not a regular file" apt policy
rmdir rootdir/etc/apt/preferences.d/a-dir-*