diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-11-17 22:54:29 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-11-18 02:41:20 +0100 |
commit | 4bb006d1ddcf1807474067dcbef9fb0bb5def0ac (patch) | |
tree | be51ac0639d57904d8f5db8e8bcc1910f775d2da /test/integration/framework | |
parent | 8fe964f148344b8a55252fe52b6292a4ab86ea98 (diff) |
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.
Diffstat (limited to 'test/integration/framework')
-rw-r--r-- | test/integration/framework | 14 |
1 files changed, 11 insertions, 3 deletions
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 "$@"; } |