From 4bb006d1ddcf1807474067dcbef9fb0bb5def0ac Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 17 Nov 2014 22:54:29 +0100 Subject: fix file ownership tests to work on kfreebsd While on linux files are created in /tmp with $USER:$USER, on my kfreebsd testmachine they are created with $USER:root, so we pull some strings here to make it work on both. --- test/integration/framework | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 191e205ce..51c7b8cae 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -272,6 +272,14 @@ setupenvironment() { echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary configcompression '.' 'gz' #'bz2' 'lzma' 'xz' + # create some files in /tmp and look at user/group to get what this means + TEST_DEFAULT_USER="$USER" + if [ "$(uname)" = 'GNU/kFreeBSD' ]; then + TEST_DEFAULT_GROUP='root' + else + TEST_DEFAULT_GROUP="$USER" + fi + # Acquire::AllowInsecureRepositories=false is not yet the default # but we want it to be the default soon configallowinsecurerepositories "false"; @@ -1428,11 +1436,11 @@ aptautotest() { aptautotest_aptget_update() { if ! test -d "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists"; then return; fi - testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt" '%U:%G:%a' '=' "${USER}:${USER}:755" - testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" '%U:%G:%a' '=' "${USER}:${USER}:755" + testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:755" + testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:755" # all copied files are properly chmodded for file in $(find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -maxdepth 1 -type f ! -name 'lock'); do - testfilestats "$file" '%U:%G:%a' '=' "${USER}:${USER}:644" + testfilestats "$file" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" done } aptautotest_apt_update() { aptautotest_aptget_update "$@"; } -- cgit v1.2.3