]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: refactor more tests to use mkfifo_or_skip_
authorPádraig Brady <P@draigBrady.com>
Tue, 10 May 2011 07:14:16 +0000 (08:14 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 14 May 2011 09:41:29 +0000 (10:41 +0100)
* tests/cp/existing-perm-race: s/mkfifo/mkfifo_or_skip_/
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/cp/special-f: Likewise.
* tests/dd/reblock: Likewise.
* tests/ls/file-type: Likewise.
* tests/misc/cat-buf: Likewise.
* tests/misc/mknod: Likewise.
* tests/misc/printf-surprise: Likewise.
* tests/misc/selinux: Likewise.
* tests/misc/sort-spinlock-abuse: Likewise.
* tests/misc/stdbuf: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/init.cfg: Improve the error message when skipping.

14 files changed:
tests/cp/existing-perm-race
tests/cp/file-perm-race
tests/cp/parent-perm-race
tests/cp/special-f
tests/dd/reblock
tests/init.cfg
tests/ls/file-type
tests/misc/cat-buf
tests/misc/mknod
tests/misc/printf-surprise
tests/misc/selinux
tests/misc/sort-spinlock-abuse
tests/misc/stdbuf
tests/misc/tac-continue

index 6afe1a2faea309de9c7103b57750e6b34916fcd6..a2a6493fa1a1660025a103d883424a34e50013be 100755 (executable)
@@ -30,8 +30,7 @@ g2=$2
 
 
 umask 077
-mkfifo fifo ||
-  skip_test_ "fifos not supported"
+mkfifo_or_skip_ fifo
 
 touch fifo-copy &&
 chgrp $g1 fifo &&
index 1e84b1eb524a8825ce1ea9d399ee1d942e9670b1..41f01efce4115554f30187a49c64422700068d27 100755 (executable)
@@ -23,8 +23,7 @@ print_ver_ cp
 require_local_dir_
 
 umask 022
-mkfifo fifo ||
-  skip_test_ "fifos not supported"
+mkfifo_or_skip_ fifo
 
 # Copy a fifo's contents.  That way, we can examine the
 # destination permissions before they're finalized.
index 4af3b69d020e730e0928ab4562b1b2cc31b590ca..366efbaa7f5dc99f69e3a6da41353537e6b2e718 100755 (executable)
@@ -29,8 +29,7 @@ chmod g+s d 2>/dev/null # The cp test is valid either way.
 
 for attr in mode ownership
 do
-  mkfifo $attr/fifo ||
-    skip_test_ "fifos not supported"
+  mkfifo_or_skip_ $attr/fifo
 
   # Copy a fifo's contents.  That way, we can examine d/$attr's
   # state while cp is running.
index fb75500779bea9551237956dc70f96fbc796f09b..3f63921f15dabf9088581783f148e64cf90d2997 100755 (executable)
@@ -20,8 +20,8 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ cp
 
-mkfifo fifo ||
-  skip_test_ "fifos not supported"
+mkfifo_or_skip_ fifo
+
 touch e || framework-failure
 
 
index 01924a85a4de08a8ffd48958e316e131f9006988..f66a9ba7c27f055a1c181a893a0c6415a27e6df2 100755 (executable)
@@ -39,7 +39,7 @@ EOF
 # until the consumer (dd) opens the fifo therefore
 # increasing the chance that dd will read the data
 # from each printf separately.
-mkfifo dd.fifo || framework_failure
+mkfifo_or_skip_ dd.fifo
 
 dd_reblock_1()
 {
index 3a59bbd6b175e283acee0a07a698273e1b1bf878..795f23c0dcea509b9c0da8519353b0c9de569cc9 100644 (file)
@@ -360,7 +360,7 @@ mkfifo_or_skip_()
     # failure as a test failure.  However, in this case, when running on a SunOS
     # system using a disk NFS mounted from OpenBSD, the above fails like this:
     # mkfifo: cannot make fifo `fifo-10558': Not owner
-    skip_test_ 'NOTICE: unable to create test prerequisites'
+    skip_test_ 'unable to create a fifo'
   fi
 }
 
index e1643fe98181393e9f04af5285ed119b0426eaad..b722290457a1b35c1f33cc5e74587b2dc981c455 100755 (executable)
@@ -31,7 +31,7 @@ mknod block b 20 20 2> /dev/null && block="block
 "
 mknod char c 10 10 2> /dev/null && char="char
 "
-mkfifo fifo
+mkfifo_or_skip_ fifo
 cd ..
 
 
index 29343f7e6a7b5231956f32485a5b57556e36a2ef..348b4145016e08aaecd881658164ac8e0c803277 100755 (executable)
@@ -24,7 +24,7 @@ print_ver_ cat
 # consumer (dd) opens the fifo therefore increasing
 # the chance that dd will read the data from each
 # write separately.
-mkfifo fifo || framework_failure
+mkfifo_or_skip_ fifo
 
 
 echo 1 > exp
index 053f96f33711477cc906701b9972b639abafe543..c07b633a8b536e915433b4e3a740d7e6e2066ac0 100755 (executable)
@@ -19,6 +19,8 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ mknod
 
+# Ensure fifos are supported
+mkfifo_or_skip_ fifo
 
 umask 777
 
index df781a96dd077815467b4c72011c00a70ded63ca..ca0f8e4b864993cff2a35f83e964ce2fd93b0206 100755 (executable)
@@ -48,7 +48,7 @@ require_ulimit_
 # and to make an N-byte-allocating-printf require more than that, thus
 # triggering the printf(3) misbehavior -- which, btw, is required by ISO C99.
 
-mkfifo fifo || framework_failure
+mkfifo_or_skip_ fifo
 
 # Disable MALLOC_PERTURB_, to avoid triggering this bug
 # http://bugs.debian.org/481543#77
index c0bd42e623eaa8452eebe589a4a58a7d9482fea6..d1bc9caea7aaf5a6648227915e1041018bcfc282 100755 (executable)
@@ -26,7 +26,7 @@ skip_if_mcstransd_is_running_
 # Create a regular file, dir, fifo.
 touch f || framework_failure
 mkdir d s1 s2 || framework_failure
-mkfifo p || framework_failure
+mkfifo_or_skip_ p
 
 
 # special context that works both with and without mcstransd
index c241c277a72222cacf4e06b9a7db83895407c2ed..b5ca30ff56c30e943e87088d0cedcbeec2877969 100755 (executable)
@@ -24,7 +24,7 @@ grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
   skip_test_ 'requires pthreads'
 
 seq 100000 > in || framework_failure_
-mkfifo fifo || framework_failure_
+mkfifo_or_skip_ fifo
 
 # Arrange for sort to require 5.0+ seconds of wall-clock time,
 # while actually using far less than 1 second of CPU time.
index 35b57105013f53a454cd8cee2c2c24fb9cf066f5..80ad870c2e0c73df4c5c4cbe334c16c52907384d 100755 (executable)
@@ -36,7 +36,7 @@ esac
 # consumer (dd) opens the fifo therefore increasing
 # the chance that dd will read the data from each
 # write separately.
-mkfifo fifo || framework_failure
+mkfifo_or_skip_ fifo
 
 
 # Verify input parameter checking
index 912d2ced5b39c802a2311bb7dc94a700a7b608d8..5902805a4579e939dc2867b24ea1fac13971edd9 100755 (executable)
@@ -53,7 +53,7 @@ seq 5 > in
 
 # Give tac a fifo command line argument.
 # This makes it try to create a temporary file in $TMPDIR.
-mkfifo fifo
+mkfifo_or_skip fifo
 seq 1000 > fifo &
 TMPDIR=$FULL_PARTITION_TMPDIR tac fifo in >out 2>err && fail=1