summaryrefslogtreecommitdiffstats
path: root/qa/workunits/fs/snaps/snaptest-hardlink.sh
diff options
context:
space:
mode:
Diffstat (limited to 'qa/workunits/fs/snaps/snaptest-hardlink.sh')
-rwxr-xr-xqa/workunits/fs/snaps/snaptest-hardlink.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/qa/workunits/fs/snaps/snaptest-hardlink.sh b/qa/workunits/fs/snaps/snaptest-hardlink.sh
new file mode 100755
index 000000000..90f3583b1
--- /dev/null
+++ b/qa/workunits/fs/snaps/snaptest-hardlink.sh
@@ -0,0 +1,25 @@
+#!/bin/sh -x
+
+set -e
+
+mkdir 1 2
+echo asdf >1/file1
+echo asdf >1/file2
+
+ln 1/file1 2/file1
+ln 1/file2 2/file2
+
+mkdir 2/.snap/s1
+
+echo qwer >1/file1
+grep asdf 2/.snap/s1/file1
+
+rm -f 1/file2
+grep asdf 2/.snap/s1/file2
+rm -f 2/file2
+grep asdf 2/.snap/s1/file2
+
+rmdir 2/.snap/s1
+rm -rf 1 2
+
+echo OK