summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.cfg9
-rwxr-xr-xtests/misc/env-signal-handler.sh5
-rwxr-xr-xtests/misc/seq-epipe.sh7
3 files changed, 20 insertions, 1 deletions
diff --git a/init.cfg b/init.cfg
index 2009e294e..8385963f4 100644
--- a/init.cfg
+++ b/init.cfg
@@ -629,6 +629,15 @@ trap_sigpipe_or_skip_()
skip_ 'trapping SIGPIPE is not supported'
}
+require_bash_as_SHELL_()
+{
+ if bash --version >/dev/null 2>&1; then
+ SHELL='bash'
+ else
+ skip_ 'bash is required'
+ fi
+}
+
# Disable the current test if the working directory seems to have
# the setgid bit set.
skip_if_setgid_()
diff --git a/tests/misc/env-signal-handler.sh b/tests/misc/env-signal-handler.sh
index fc1bb4e7d..c38177dae 100755
--- a/tests/misc/env-signal-handler.sh
+++ b/tests/misc/env-signal-handler.sh
@@ -20,6 +20,11 @@
print_ver_ env seq test timeout printf
trap_sigpipe_or_skip_
+# /bin/sh has an intermittent failure in ignoring SIGPIPE on OpenIndiana 11
+# so we require bash as discussed at:
+# https://lists.gnu.org/archive/html/coreutils/2020-03/msg00004.html
+require_bash_as_SHELL_
+
# Paraphrasing http://bugs.gnu.org/34488#8:
# POSIX requires that sh started with an inherited ignored SIGPIPE must
# silently ignore all attempts from within the shell to restore SIGPIPE
diff --git a/tests/misc/seq-epipe.sh b/tests/misc/seq-epipe.sh
index fe11e61f5..0c42e4308 100755
--- a/tests/misc/seq-epipe.sh
+++ b/tests/misc/seq-epipe.sh
@@ -20,8 +20,13 @@
print_ver_ seq
trap_sigpipe_or_skip_
+# /bin/sh has an intermittent failure in ignoring SIGPIPE on OpenIndiana 11
+# so we require bash as discussed at:
+# https://lists.gnu.org/archive/html/coreutils/2020-03/msg00004.html
+require_bash_as_SHELL_
+
# upon EPIPE with signals ignored, 'seq' should exit with an error.
-timeout 10 sh -c \
+timeout 10 $SHELL -c \
'trap "" PIPE && { seq inf 2>err; echo $? >code; } | head -n1' >out
# Exit-code must be 1, indicating 'write error'