Richard W.M. Jones wrote:
Another fix revealed by testing this on Debian.
...
Subject: [PATCH] Debian: Use /bin/bash as the shell for regression
test scripts.
/bin/sh on Debian is a minimal shell called 'dash' which doesn't
support some features we need such as the particular 'function'
syntax used by regressions/test-stringlist.sh, and therefore
this script was failing on Debian.
Hi Rich,
Have you considered changing to POSIX syntax, e.g.,
-function foo
+foo()
If that's the only change, it may be worthwhile to accommodate dash.
Change all of these scripts to use #!/bin/bash explicitly to avoid
these sorts of problems.
---
regressions/rhbz503169c10.sh | 2 +-
regressions/rhbz503169c13.sh | 2 +-
regressions/test-bootbootboot.sh | 2 +-
.../test-cancellation-download-librarycancels.sh | 2 +-
.../test-cancellation-upload-daemoncancels.sh | 2 +-
regressions/test-find0.sh | 2 +-
regressions/test-qemudie-killsub.sh | 2 +-
regressions/test-qemudie-launchfail.sh | 2 +-
regressions/test-qemudie-midcommand.sh | 2 +-
regressions/test-qemudie-synch.sh | 2 +-
regressions/test-read_file.sh | 2 +-
regressions/test-remote.sh | 2 +-
regressions/test-reopen.sh | 2 +-
regressions/test-stringlist.sh | 2 +-
14 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/regressions/rhbz503169c10.sh b/regressions/rhbz503169c10.sh
index 8813c05..91284e0 100755
--- a/regressions/rhbz503169c10.sh
+++ b/regressions/rhbz503169c10.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -
+#!/bin/bash -
An alternative is to change Makefile.am to do e.g.,
TESTS_ENVIRONMENT = \
export MALLOC_PERTURB_=$(random_val) \
LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
NOEXEC_CHECK="$(top_builddir)/src/.libs/libguestfs.so
$(top_builddir)/daemon/guestfsd"
; /bin/bash
Or even use a configure-time test like gnulib's posix-shell
module to set SHELL to /bin/bash if it exists, then use this,
TESTS_ENVIRONMENT = \
export MALLOC_PERTURB_=$(random_val) \
LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
NOEXEC_CHECK="$(top_builddir)/src/.libs/libguestfs.so
$(top_builddir)/daemon/guestfsd"
; $(SHELL)
which would might work even if /bin/bash doesn't exist.