From 68ba0b7f4e1c03edfb6f621e7e7314ea610af96b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 15 Oct 2014 03:47:50 +0200 Subject: testcases runable as root Running the testcases is usually not a good idea, but it can be handy to check if the privilege dropping works. Git-Dch: Ignore --- test/integration/test-apt-get-download | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-get-download') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 0514542b3..9a154e5fb 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -11,18 +11,27 @@ buildsimplenativepackage 'apt' 'all' '1.0' 'stable' buildsimplenativepackage 'apt' 'all' '2.0' 'unstable' insertinstalledpackage 'vrms' 'all' '1.0' +OLD_UMASK="$(umask)" umask 0027 +setupaptarchive --no-update +umask "$OLD_UMASK" -setupaptarchive - +# directories should be readable by everyone +find aptarchive/dists -type d | while read dir; do + chmod o+rx "$dir" +done # apt-ftparchive knows how to chmod files find aptarchive/dists -name '*Packages*' -type f | while read file; do testaccessrights "$file" '644' + chmod 640 "$file" done # created by the framework without special care find aptarchive/dists -name '*Release*' -type f | while read file; do testaccessrights "$file" '640' done + +testsuccess aptget update + # all copied files are properly chmodded find rootdir/var/lib/apt/lists -type f | while read file; do testaccessrights "$file" '644' -- cgit v1.2.3