]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: mv: check broken symlink cross-filesystem move
authorSylvestre Ledru <sylvestre@debian.org>
Thu, 1 Jan 2026 12:20:52 +0000 (13:20 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 1 Jan 2026 13:43:15 +0000 (13:43 +0000)
Identified here:
<https://github.com/uutils/coreutils/issues/8586>

* tests/mv/mv-special-2.sh: Add the check.

tests/mv/mv-special-2.sh

index f77e323234571842676576d72f7c1607472bb167..36ebcb427dc2d846f21d4521c5eeca0ed14d270d 100755 (executable)
@@ -59,6 +59,12 @@ mv --verbose blah xdev &&
 returns_ 1 test -L blah &&
 test -L xdev/blah || fail=1
 
+# Test moving a broken symlink to another file system
+ln -nsf nonexistent broken_symlink || framework_failure_
+mv --verbose broken_symlink xdev &&
+returns_ 1 test -L broken_symlink &&
+test -L xdev/broken_symlink || fail=1
+
 if python -c "import socket as s; s.socket(s.AF_UNIX).bind('test.sock')" &&
    test -S 'test.sock'; then
   mv --verbose test.sock xdev &&