Browse Source

tests: fix numeric.at for BSD

While creating file, BSD kernels inherit the group ownership from
parent directory.
http://lists.gnu.org/archive/html/bug-tar/2016-06/msg00000.html

* tests/numeric.at: Attempt to 'chown' the newly created directory
to proper group (at least on affected machines that command is
expected to succeed).
Pavel Raiskup 8 years ago
parent
commit
c697d62598
2 changed files with 7 additions and 3 deletions
  1. 1 0
      THANKS
  2. 6 3
      tests/numeric.at

+ 1 - 0
THANKS

@@ -95,6 +95,7 @@ Christian Laubscher	[email protected]
 Christian T. Dum	[email protected]
 Christian von Roques	[email protected]
 Christian Wetzel	[email protected]
+Christian Weisgerber	[email protected]
 Christoph Litauer	[email protected]
 Christophe Colle	[email protected]
 Christophe Kalt		[email protected]

+ 6 - 3
tests/numeric.at

@@ -27,14 +27,17 @@ tar $1 -vvf a dir |dnl
 ])
 
 AT_TAR_CHECK([
-mkdir dir
-genfile --file dir/file
-
 MYUID=$(id -u) || AT_SKIP_TEST
 MYGID=$(id -g) || AT_SKIP_TEST
 MYUSR=$(id -un) || AT_SKIP_TEST
 MYGRP=$(id -gn) || AT_SKIP_TEST
 
+mkdir dir
+# Ensure correct group id on BSDs.
+chown :$MYGID dir >/dev/null 2>/dev/null
+genfile --file dir/file
+
+
 TESTOP([--create])
 TESTOP([--list])
 TESTOP([--diff])