]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-818628-unreadable-source
stop handling items in doomed transactions
[apt.git] / test / integration / test-bug-818628-unreadable-source
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7 configarchitecture 'amd64' 'i386'
8
9 if [ "$(id -u)" = "0" ]; then
10 msgskip "Tests for unreadable sources.list do not work as root"
11 exit 0
12 fi
13
14 insertinstalledpackage 'apt' 'i386' '1'
15 buildsimplenativepackage 'apt' 'i386' '2' 'unstable'
16
17 setupaptarchive
18
19 # Test unreadable sources.list files
20 chmod -r rootdir/etc/apt/sources.list.d
21
22 testfailureequal "E: Unable to read $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list.d/ - opendir (13: Permission denied)
23 W: You may want to run apt-get update to correct these problems
24 E: The package cache file is corrupted" aptcache policy apt
25 testfailureequal "E: Unable to read $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list.d/ - opendir (13: Permission denied)
26 W: You may want to run apt-get update to correct these problems
27 E: The package cache file is corrupted" apt search apt
28
29 chmod +r rootdir/etc/apt/sources.list.d
30
31
32 # Test unreadable sources.list files
33 chmod -r rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list
34
35 testfailureequal "E: Opening $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list - ifstream::ifstream (13: Permission denied)
36 E: The list of sources could not be read.
37 E: Opening $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list - ifstream::ifstream (13: Permission denied)
38 E: The list of sources could not be read." aptcache policy apt
39 testfailureequal "E: Opening $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list - ifstream::ifstream (13: Permission denied)
40 E: The list of sources could not be read." apt search apt
41
42 chmod +r rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list