]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix skipping in some tests
authorPádraig Brady <P@draigBrady.com>
Thu, 5 Jul 2018 00:46:07 +0000 (17:46 -0700)
committerPádraig Brady <P@draigBrady.com>
Thu, 5 Jul 2018 00:48:41 +0000 (17:48 -0700)
* tests/cp/cp-a-selinux.sh: Use 'skip_' rather than the probably
undefined 'skip'.
* tests/du/2g.sh: Likewise.
* tests/install/install-Z-selinux.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/selinux.sh: Likewise.
* tests/mkdir/restorecon.sh: Likewise.
* cfg.mk (sc_prohibit-skip): A new syntax check to catch the issue.

cfg.mk
tests/cp/cp-a-selinux.sh
tests/du/2g.sh
tests/install/install-Z-selinux.sh
tests/misc/chcon.sh
tests/misc/selinux.sh
tests/mkdir/restorecon.sh

diff --git a/cfg.mk b/cfg.mk
index 01a2525ab41f45143a5df17983a6d0338a390829..a02ed274831cca3c9df74cdc7c9f9be4fcedc87d 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -250,6 +250,11 @@ sc_prohibit-quotearg:
        halt='Unstyled diagnostic quoting detected' \
          $(_sc_search_regexp)
 
+sc_prohibit-skip:
+       @prohibit='\|\| skip ' \
+       halt='Use skip_ not skip' \
+         $(_sc_search_regexp)
+
 sc_sun_os_names:
        @grep -nEi \
            'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
index c48a063b873a55a4517aab3ca453f71634f306c5..3e83eaeb15f001d3021b7d3662b3db317fcaa6b5 100755 (executable)
@@ -33,7 +33,7 @@ mls_enabled_ && ctx="$ctx:s0"
 
 # Check basic functionality - before check on fixed context mount
 touch c || framework_failure_
-chcon $ctx c || skip "Failed to set context: $ctx"
+chcon $ctx c || skip_ "Failed to set context: $ctx"
 cp -a c d 2>err || framework_failure_
 cp --preserve=context c e || framework_failure_
 cp --preserve=all c f || framework_failure_
index 13b4bd0533dda26a25374461688256fc0d15a7aa..5c21964ee78aac0c9ab9e66a6cf36fb49af8c215 100755 (executable)
@@ -45,7 +45,7 @@ big=big
 if ! fallocate -l2G $big; then
   rm -f $big
   {
-    is_local_dir_ . || skip 'Not writing 2GB data to remote'
+    is_local_dir_ . || skip_ 'Not writing 2GB data to remote'
     for i in $(seq 100); do
       # Note: 2147483648 == 2^31. Print floor(2^31/100) per iteration.
       printf %21474836s x || fail=1
index d0086f568e2fb8132a99f7df85c4cf706bfb7884..8934ecd411fb732f0ed353f8a98857ff151f92dd 100755 (executable)
@@ -24,7 +24,7 @@ require_selinux_
 mkdir subdir || framework_failure_
 ctx='root:object_r:tmp_t'
 mls_enabled_ && ctx="$ctx:s0"
-chcon "$ctx" subdir || skip "Failed to set context: $ctx"
+chcon "$ctx" subdir || skip_ "Failed to set context: $ctx"
 cd subdir
 
 # Since in a tmp_t dir, dirs can be created as user_tmp_t ...
index dcc31e34e79e07f735785e7687b8e24f76944a4f..8f8de15253557eed78b74303d64a62f27c543c79 100755 (executable)
@@ -35,7 +35,7 @@ r1=object_r
 t1=tmp_t
 range=s0
 ctx=$u1:$r1:$t1:$range
-chcon $ctx f || skip "Failed to set context: $ctx"
+chcon $ctx f || skip_ "Failed to set context: $ctx"
 stat --printf='f|%C\n' f > out || fail=1
 
 # Use --reference.
index de7ff94a05345654cb8ba5c99bdf8a2e1fa147bf..44560d96d29827fcc0acfabf7c4d05dfaf9f4219 100755 (executable)
@@ -33,7 +33,7 @@ mkfifo_or_skip_ p
 ctx='root:object_r:tmp_t'
 mls_enabled_ && ctx="$ctx:s0"
 
-chcon $ctx f d p || skip "Failed to set context: $ctx"
+chcon $ctx f d p || skip_ "Failed to set context: $ctx"
 
 # inspect that context with both ls -Z and stat.
 for i in d f p; do
index 2bdfb5dfb654f6e6d307964ce3af08c5afef750d..defb3f76fe5010ec50baaf415a03520186f9e3d9 100755 (executable)
@@ -23,7 +23,7 @@ require_selinux_
 mkdir subdir || framework_failure_
 ctx='root:object_r:tmp_t'
 mls_enabled_ && ctx="$ctx:s0"
-chcon "$ctx" subdir || skip "Failed to set context: $ctx"
+chcon "$ctx" subdir || skip_ "Failed to set context: $ctx"
 cd subdir
 
 # --- mkdir -Z ---