aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/defaults/main_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/defaults/main_test.go b/tests/defaults/main_test.go
index 89d3bfc..3eae919 100644
--- a/tests/defaults/main_test.go
+++ b/tests/defaults/main_test.go
@@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"runtime"
+ "strings"
"sync"
"testing"
@@ -215,6 +216,30 @@ func TestMvWarnings(t *testing.T) {
}
}
+// Check for this bug in symlink handling:
+// $ ln -s /asd/asdasd/asdasd b/foo
+// $ mv b/foo .
+// mv: listing attributes of 'b/foo': No such file or directory
+// strace shows:
+// llistxattr("b/foo", NULL, 0) = -1 ENOENT (No such file or directory)
+func TestMvWarningSymlink(t *testing.T) {
+ fn := test_helpers.DefaultPlainDir + "/TestMvWarningSymlink"
+ err := os.Symlink("/foo/bar/baz", fn)
+ if err != nil {
+ t.Fatal(err)
+ }
+ cmd := exec.Command("mv", fn, test_helpers.TmpDir)
+ out, err := cmd.CombinedOutput()
+ if err != nil {
+ t.Log(string(out))
+ t.Fatal(err)
+ }
+ if len(out) != 0 {
+ t.Log(strings.TrimSpace(string(out)))
+ t.Fatal("Got warnings")
+ }
+}
+
// See TestCpWarnings.
func TestCpWarnings(t *testing.T) {
fn := test_helpers.TmpDir + "/TestCpWarnings"