From: Julian Andres Klode Date: Wed, 24 Aug 2016 14:05:37 +0000 (+0200) Subject: test: Use a file to determine TEST_DEFAULT_GROUP X-Git-Tag: 1.3_rc3~10^2~7 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/71e22da91ff888cf645e5083fbac7839846111d2?hp=8a362893a18eca569f8b93c572aaf966572b9546 test: Use a file to determine TEST_DEFAULT_GROUP This is more safe against sticky bits. For example, in FreeBSD all files created in /tmp have the group set to wheel. Gbp-Dch: ignore --- diff --git a/test/integration/framework b/test/integration/framework index 9dce3dc11..677c40711 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -451,11 +451,8 @@ EOF # create some files in /tmp and look at user/group to get what this means TEST_DEFAULT_USER="$(id -un)" - if [ "$(uname)" = 'GNU/kFreeBSD' ]; then - TEST_DEFAULT_GROUP='root' - else - TEST_DEFAULT_GROUP="$(id -gn)" - fi + touch "${TMPWORKINGDIRECTORY}/test-file" + TEST_DEFAULT_GROUP=$(stat --format '%G' "${TMPWORKINGDIRECTORY}/test-file") # cleanup the environment a bit # prefer our apt binaries over the system apt binaries