4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
7 configarchitecture 'amd64' 'i386'
9 if [ "$(id -u)" = "0" ]; then
10 msgskip "Tests
for unreadable sources.list
do not work as root
"
14 insertinstalledpackage 'apt' 'i386' '1'
15 buildsimplenativepackage 'apt' 'i386' '2' 'unstable'
19 # Test unreadable sources.list files
20 chmod -r rootdir/etc/apt/sources.list.d
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
29 chmod +r rootdir/etc/apt/sources.list.d
32 # Test unreadable sources.list files
33 chmod -r rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list
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
42 chmod +r rootdir/etc/apt/sources.list.d/apt-test-unstable-deb-src.list