]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false failure on new mv --exchange test
authorPádraig Brady <P@draigBrady.com>
Sun, 24 Mar 2024 18:30:54 +0000 (18:30 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 24 Mar 2024 18:32:34 +0000 (18:32 +0000)
* tests/mv/mv-exchange.sh: Canonicalize different
"operation not supported" messages, so we can ignore correctly.
Reported by Bruno Haible on AIX, NetBSD, and OpenBSD.

tests/mv/mv-exchange.sh

index 35e3392cb91867047aef4701795d462ee9d450b4..98b9afa77d75150332873262beec7d5db1bc8c59 100755 (executable)
@@ -23,7 +23,10 @@ print_ver_ mv
 # Test exchanging files.
 touch a || framework_failure_
 mkdir b || framework_failure_
-if ! mv -T --exchange a b 2>exchange_err; then
+if ! mv -T --exchange a b 2>errt; then
+  # AIX gives "Unsupported attribute value" (errno 124)
+  # NetBSD and OpenBSD give "Not supported"
+  sed 's/Not /not /; s/[Uu]nsupported/not supported/' < errt > exchange_err
   grep 'not supported' exchange_err || { cat exchange_err; fail=1; }
 else
   test -d a || fail=1