]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/snaps: add hardlink snapshot test
authorYan, Zheng <zyan@redhat.com>
Fri, 22 Dec 2017 02:19:12 +0000 (10:19 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 9 Feb 2018 10:42:29 +0000 (18:42 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
qa/workunits/fs/snaps/snaptest-hardlink.sh [new file with mode: 0755]

diff --git a/qa/workunits/fs/snaps/snaptest-hardlink.sh b/qa/workunits/fs/snaps/snaptest-hardlink.sh
new file mode 100755 (executable)
index 0000000..9848a01
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh -x
+
+set -e
+
+ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
+
+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