summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2014-06-09 18:33:21 +0530
committerKaushal M <kaushal@redhat.com>2014-06-12 01:56:01 -0700
commit604ba9abf377ff56bb671478386d4ab977fdcd57 (patch)
tree43cfc3b732b1b9d74fc3dfdb747e13e8af2bd441 /tests
parentd240958fb36e652a2b910fe79414fb8b934e6158 (diff)
mgmt/glusterd: provide interface for configuring the entry point to snapshots
Change-Id: Ibfd0e43db8e5f3f0f2ab6ec6bed88f71397c0bf4 BUG: 1107531 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8025 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/uss.t99
1 files changed, 99 insertions, 0 deletions
diff --git a/tests/basic/uss.t b/tests/basic/uss.t
index 44589f45b59..5f48ad2e9e5 100644
--- a/tests/basic/uss.t
+++ b/tests/basic/uss.t
@@ -56,6 +56,7 @@ TEST umount $M0;
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0;
+# test 15
TEST ls $M0/.snaps;
NUM_SNAPS=$(ls $M0/.snaps | wc -l);
@@ -105,6 +106,7 @@ TEST fd_close $fd3
# similar tests on nfs mount
+# test 44
TEST mount_nfs $H0:/$V0 $N0 nolock;
TEST ls $N0/.snaps;
@@ -152,6 +154,103 @@ TEST fd_close $fd1;
TEST fd_close $fd2;
TEST fd_close $fd3;
+# test 73
+TEST $CLI volume set $V0 "features.snapshot-directory" .history
+
+TEST ls $M0/.history;
+
+NUM_SNAPS=$(ls $M0/.history | wc -l);
+
+TEST [ $NUM_SNAPS == 4 ]
+
+TEST ls $M0/.history/snap1;
+TEST ls $M0/.history/snap2;
+TEST ls $M0/.history/snap3;
+TEST ls $M0/.history/snap4;
+
+TEST ls $M0/.history/snap3/dir1;
+TEST ls $M0/.history/snap3/dir2;
+
+TEST ls $M0/.history/snap4/dir1;
+TEST ls $M0/.history/snap4/dir2;
+
+TEST ls $M0/dir1/.history/
+TEST ! ls $M0/dir1/.history/snap1;
+TEST ! ls $M0/dir2/.history/snap2;
+TEST ls $M0/dir1/.history/snap3;
+TEST ls $M0/dir2/.history/snap4;
+
+TEST fd1=`fd_available`
+TEST fd_open $fd1 'r' $M0/.history/snap1/file1;
+TEST fd_cat $fd1
+
+# opening fd with in write mode for snapshot files should fail
+TEST fd2=`fd_available`
+TEST ! fd_open $fd1 'w' $M0/.history/snap1/file2;
+
+# lookup on .history in the snapshot world should fail
+TEST ! stat $M0/.history/snap1/.history
+
+# creating new entries in snapshots should fail
+TEST ! mkdir $M0/.history/new
+TEST ! touch $M0/.history/snap2/other;
+
+TEST fd3=`fd_available`
+TEST fd_open $fd3 'r' $M0/dir1/.history/snap3/foo1
+
+TEST fd_cat $fd3;
+
+TEST fd_close $fd1;
+TEST fd_close $fd2;
+TEST fd_close $fd3
+
+
+# similar tests on nfs mount
+# test 103
+TEST ls $N0/.history;
+
+NUM_SNAPS=$(ls $N0/.history | wc -l);
+
+TEST [ $NUM_SNAPS == 4 ];
+
+TEST ls $N0/.history/snap1;
+TEST ls $N0/.history/snap2;
+TEST ls $N0/.history/snap3;
+TEST ls $N0/.history/snap4;
+
+TEST ls $N0/.history/snap3/dir1;
+TEST ls $N0/.history/snap3/dir2;
+
+TEST ls $N0/.history/snap4/dir1;
+TEST ls $N0/.history/snap4/dir2;
+
+TEST ! ls $N0/dir1/.history/snap1;
+TEST ! ls $N0/dir2/.history/snap2;
+TEST ls $N0/dir1/.history/snap3;
+TEST ls $N0/dir2/.history/snap4;
+
+TEST fd1=`fd_available`
+TEST fd_open $fd1 'r' $N0/.history/snap1/file1;
+TEST fd_cat $fd1
+
+TEST fd2=`fd_available`
+TEST ! fd_open $fd1 'w' $N0/.history/snap1/file2;
+
+TEST ! stat $N0/.history/snap1/.stat
+
+TEST ! mkdir $N0/.history/new
+
+TEST ! touch $N0/.history/snap2/other;
+
+TEST fd3=`fd_available`
+TEST fd_open $fd3 'r' $N0/dir1/.history/snap3/foo1
+
+TEST fd_cat $fd3;
+
+TEST fd_close $fd1;
+TEST fd_close $fd2;
+TEST fd_close $fd3;
+
rm -f /tmp/tmp-snap-uuids;
rm -f /tmp/tmp-snap_names;