Browse Source

Testsuite fixes.

* paxutils: Update.
* src/unlink.c (flush_deferred_unlinks): OpenSolaris sets EEXIST
instead of ENOTEMPTY if trying to remove a non-empty directory.
* tests/numeric.at: Avoid using awk -v: some older awks don't support
that option.  Also fix environment variable usage.
* tests/onetop05.at: Skip test if unable to set initial directory
mode bits.
* tests/sparse06.at: Use --quiet option.
Sergey Poznyakoff 9 years ago
parent
commit
c0fb0740fa
5 changed files with 13 additions and 7 deletions
  1. 1 1
      paxutils
  2. 3 0
      src/unlink.c
  3. 2 2
      tests/numeric.at
  4. 5 1
      tests/onetop05.at
  5. 2 3
      tests/sparse06.at

+ 1 - 1
paxutils

@@ -1 +1 @@
-Subproject commit 58b8ac114790e2de7992db1a387ec14238783f39
+Subproject commit ec72abd9dd63bbff4534ec77e97b1a6cadfc3cf8

+ 3 - 0
src/unlink.c

@@ -124,6 +124,9 @@ flush_deferred_unlinks (bool force)
 		    case ENOENT:
 		      /* nothing to worry about */
 		      break;
+		    case EEXIST:
+		      /* OpenSolaris >=10 sets EEXIST instead of ENOTEMPTY
+			 if trying to remove a non-empty directory */
 		    case ENOTEMPTY:
 		      /* Keep the record in list, in the hope we'll
 			 be able to remove it later */

+ 2 - 2
tests/numeric.at

@@ -21,9 +21,9 @@ AT_KEYWORDS([options numeric numeric-owner])
 m4_pushdef([TESTOP],[
 decho $1
 tar $1 -vvf a dir --numeric-owner |dnl
- awk -vowner=$MYUID/$MYGID '@S|@2==owner {print "OK"; next} {print}'
+ awk '@S|@2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
 tar $1 -vvf a dir |dnl
- awk -vowner=$MYUSR/$MYGRP '@S|@2==owner {print "OK"; next} {print}'
+ awk '@S|@2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 ])
 
 AT_TAR_CHECK([

+ 5 - 1
tests/onetop05.at

@@ -29,6 +29,10 @@ AT_TAR_CHECK([
 orig_mode=3702
 mkdir d
 chmod $orig_mode d
+
+mode=$(genfile --stat=mode.7777 d)
+test $mode = $orig_mode || AT_SKIP_TEST
+
 genfile --file d/file
 tar -cf d.tar -C d .
 rm -rf d
@@ -43,7 +47,7 @@ if test 700 = $mode; then
 else
     echo "CWD: mode changed: 700 != $mode"
 fi
-
+ 
 mkdir d2
 chmod 700 d2
 tar -C d2 --one-top-level=top -xpf d.tar

+ 2 - 3
tests/sparse06.at

@@ -23,7 +23,7 @@ AT_KEYWORDS([sparse sparse06])
 
 m4_define([check_pattern],[
 rm -rf out archive.tar smallsparse && mkdir out
-genfile --sparse --file smallsparse $1
+genfile --sparse --quiet --file smallsparse $1
 tar -cSf archive.tar smallsparse
 tar -xf archive.tar -C out
 cmp smallsparse out/smallsparse
@@ -50,7 +50,6 @@ check_pattern([10M DEF 20M GHI 30M JKL 40M])
 
 ],
 [0],,
-[genfile: created file is not sparse
-],,,[posix])
+[],,,[posix])
 
 AT_CLEANUP