On AIX, I noticed that tests/cksum/cksum-c.sh hangs. This was caused
by the recent addition of tests using 'strace'. AIX has an unrelated
program of the same name [1]. The important line in the documentation
is this:
Once initiated, the strace command continues to execute until
terminated by the user.
The only occurance of strace we have with three to seven arguments,
which will cause it to continue executing, is in cksum-c.sh. However,
handling it only there seems poor since we will likely introduce
similar tests later elsewhere.
Therefore, I added a new function 'uses_strace_' in init.cfg. If
'strace true' does not execute sucessfully, it defines a function
'strace' which just invokes 'false'. That will prevent further
'strace' tests from being run.
I will leave this one uncomitted for a bit, in case anyone has better
ideas to handle this.
[1] https://www.ibm.com/docs/en/aix/7.2.0?topic=s-strace-command
-- 8< --
* init.cfg (uses_strace_): New function.
(require_strace_): Use it.
tests/cksum/cksum-c.sh: Likewise.
tests/misc/read-errors.sh: Likewise.
---
init.cfg | 13 +++++++++++++
tests/cksum/cksum-c.sh | 1 +
tests/misc/read-errors.sh | 1 +
3 files changed, 15 insertions(+)
diff --git a/init.cfg b/init.cfg
index 82d70b77f..f453279bf 100644
--- a/init.cfg
+++ b/init.cfg
@@ -246,6 +246,8 @@ require_strace_()
{
test $# = 1 || framework_failure_
+ uses_strace_
+
strace -V < /dev/null > /dev/null 2>&1 ||
skip_ 'no strace program'
@@ -837,4 +839,15 @@ bad_unicode ()
env printf '\xC3|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n'
}
+# AIX has a 'strace' program unrelated to the one we care about. Avoid
+# executing it since it will run forever until manually killed when given
+# three to seven arguments.
+uses_strace_ ()
+{
+ strace true > /dev/null 2>&1
+ if test $? -ne 0; then
+ strace () { false; }
+ fi
+}
+
sanitize_path_
diff --git a/tests/cksum/cksum-c.sh b/tests/cksum/cksum-c.sh
index b2b6c4759..cfb29f137 100755
--- a/tests/cksum/cksum-c.sh
+++ b/tests/cksum/cksum-c.sh
@@ -18,6 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cksum shuf
+uses_strace_
shuf -i 1-10 > input || framework_failure_
diff --git a/tests/misc/read-errors.sh b/tests/misc/read-errors.sh
index a691cd168..796573a17 100755
--- a/tests/misc/read-errors.sh
+++ b/tests/misc/read-errors.sh
@@ -17,6 +17,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+uses_strace_
! cat . >/dev/null 2>&1 || skip_ "Need unreadable directories"
--
2.52.0