]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: use system ENOTEMPTY message
authorPádraig Brady <P@draigBrady.com>
Tue, 17 Feb 2026 22:58:29 +0000 (22:58 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 18 Feb 2026 18:31:49 +0000 (18:31 +0000)
* tests/mv/dir2dir.sh: Map system specific messages.
* tests/rm/d-2.sh: Likewise.

tests/mv/dir2dir.sh
tests/rm/d-2.sh

index 5dabc560f2ad420fb39b26c067d99a9e51c6afd4..574e58acc3749df22d17b5064154c96bb9554f67 100755 (executable)
@@ -19,6 +19,7 @@
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ mv
+getlimits_
 
 mkdir -p a/t b/t || framework_failure_
 touch a/t/f || framework_failure_
@@ -29,12 +30,11 @@ touch a/t/f || framework_failure_
 # diagnostic about moving one directory to a subdirectory of itself.
 mv b/t a 2> out && fail=1
 
-# Accept any of these: EEXIST, ENOTEMPTY, EBUSY.
-sed             's/: File exists/: Directory not empty/'<out>o1;mv o1 out
-sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
+sed "s/: $EEXIST/: $ENOTEMPTY/"<out>o1;mv o1 out
+sed "s/: $EBUSY/: $ENOTEMPTY/"<out>o1;mv o1 out
 
-cat <<\EOF > exp || framework_failure_
-mv: cannot overwrite 'a/t': Directory not empty
+cat <<EOF > exp || framework_failure_
+mv: cannot overwrite 'a/t': $ENOTEMPTY
 EOF
 
 compare exp out || fail=1
index 24fe26017b37ba62469778a32128541d92372ee6..641adbc3bed6f3e91b1a1e91cfdfabc98bc67f75 100755 (executable)
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ rm
+getlimits_
 
 mkdir d || framework_failure_
 > d/a || framework_failure_
 
 rm -d d 2> out && fail=1
 
-# Accept any of these: EEXIST, ENOTEMPTY
-sed 's/: File exists/: Directory not empty/' out > out2
+sed "s/: $EEXIST/: $ENOTEMPTY/" out > out2
 
 printf "%s\n" \
-    "rm: cannot remove 'd': Directory not empty" \
+    "rm: cannot remove 'd': $ENOTEMPTY" \
     > exp || framework_failure_
 
 compare exp out2 || fail=1