From f4dca9ca03ba2825953a86561c4af3c38d997377 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Mon, 15 Dec 2025 15:30:43 +0000
Subject: [PATCH] tests: mv: check traversed fifos copy correctly
* tests/mv/mv-special-1.sh: Add a case also for fifos
encountered when traversing.
---
tests/mv/mv-special-1.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/mv/mv-special-1.sh b/tests/mv/mv-special-1.sh
index 03667b82ab..707d3e9d85 100755
--- a/tests/mv/mv-special-1.sh
+++ b/tests/mv/mv-special-1.sh
@@ -23,12 +23,16 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
null=mv-null
dir=mv-dir
+dir2=mv-dir2
rm -f $null || framework_failure_
mknod $null p || framework_failure_
test -p $null || framework_failure_
mkdir -p $dir/a/b/c $dir/d/e/f || framework_failure_
touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure_
+mkdir $dir2/ || framework_failure_
+mknod $dir2/$null p || framework_failure_
+test -p $dir2/$null || framework_failure_
# We used to...
# exit 77 here to indicate that we couldn't run the test.
@@ -36,13 +40,15 @@ touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure_
# from an OpenBSD system, the above mknod fails.
# It's not worth making an exception any more.
-timeout 60 mv --verbose $null $dir "$other_partition_tmpdir" > out || fail=1
+timeout 60 mv -v $null $dir $dir2 "$other_partition_tmpdir" > out || fail=1
# Make sure the files are gone.
test -p $null && fail=1
test -d $dir && fail=1
+test -p $dir2/$null && fail=1
# Make sure they were moved.
test -p "$other_partition_tmpdir/$null" || fail=1
test -d "$other_partition_tmpdir/$dir/a/b/c" || fail=1
+test -p "$other_partition_tmpdir/$dir2/$null" || fail=1
# POSIX says rename (A, B) can succeed if A and B are on different file systems,
# so ignore chatter about when files are removed and copied rather than renamed.
@@ -65,6 +71,8 @@ cat <