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