From: Pádraig Brady
Date: Thu, 5 Jul 2018 00:46:07 +0000 (-0700) Subject: tests: fix skipping in some tests X-Git-Tag: v8.31~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=351ac1256b948ea90a2be9e7e54b47b05b517f4f;p=thirdparty%2Fcoreutils.git tests: fix skipping in some tests * 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. --- diff --git a/cfg.mk b/cfg.mk index 01a2525ab4..a02ed27483 100644 --- 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]' \ diff --git a/tests/cp/cp-a-selinux.sh b/tests/cp/cp-a-selinux.sh index c48a063b87..3e83eaeb15 100755 --- a/tests/cp/cp-a-selinux.sh +++ b/tests/cp/cp-a-selinux.sh @@ -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_ diff --git a/tests/du/2g.sh b/tests/du/2g.sh index 13b4bd0533..5c21964ee7 100755 --- a/tests/du/2g.sh +++ b/tests/du/2g.sh @@ -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 diff --git a/tests/install/install-Z-selinux.sh b/tests/install/install-Z-selinux.sh index d0086f568e..8934ecd411 100755 --- a/tests/install/install-Z-selinux.sh +++ b/tests/install/install-Z-selinux.sh @@ -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 ... diff --git a/tests/misc/chcon.sh b/tests/misc/chcon.sh index dcc31e34e7..8f8de15253 100755 --- a/tests/misc/chcon.sh +++ b/tests/misc/chcon.sh @@ -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. diff --git a/tests/misc/selinux.sh b/tests/misc/selinux.sh index de7ff94a05..44560d96d2 100755 --- a/tests/misc/selinux.sh +++ b/tests/misc/selinux.sh @@ -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 diff --git a/tests/mkdir/restorecon.sh b/tests/mkdir/restorecon.sh index 2bdfb5dfb6..defb3f76fe 100755 --- a/tests/mkdir/restorecon.sh +++ b/tests/mkdir/restorecon.sh @@ -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 ---