diff options
author | Joseph Fernandes <josferna@redhat.com> | 2014-02-12 13:03:30 +0530 |
---|---|---|
committer | Rajesh Joseph <rjoseph@redhat.com> | 2014-02-18 00:56:54 -0800 |
commit | bd38426958fb27879bc1a06cf7104e94c7789796 (patch) | |
tree | 7028617c70d000ae4b4bb91c53b94b0c98a5fe0d /tests/bugs/bug-1049834.t | |
parent | 715c168a68fa5cc810fbe3df08c48e705aa31363 (diff) |
Snapshot: snap-max-limit implemented
Added the check on snap-max-limit in snapshot_create_prevalidate. Now snapshot
creation will fail if snap count reaches max limit.
Change-Id: I5b1cf8441f02c32085d2f6f5fd8902cb61031af5
BUG: 1049834
Author: Joseph Fernandes <josferna@redhat.com>
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/6981
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'tests/bugs/bug-1049834.t')
-rwxr-xr-x | tests/bugs/bug-1049834.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/bugs/bug-1049834.t b/tests/bugs/bug-1049834.t new file mode 100755 index 000000000..ea4b3c85d --- /dev/null +++ b/tests/bugs/bug-1049834.t @@ -0,0 +1,40 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../cluster.rc +. $(dirname $0)/../snapshot.rc +. $(dirname $0)/../volume.rc + +cleanup; + +TEST launch_cluster 2 +TEST setup_lvm 2 + +TEST $CLI_1 peer probe $H2 +EXPECT_WITHIN 20 1 peer_count + +TEST $CLI_1 volume create $V0 $H1:$L1 $H2:$L2 +EXPECT 'Created' volinfo_field $V0 'Status' + +TEST $CLI_1 volume start $V0 +EXPECT 'Started' volinfo_field $V0 'Status' + +#Setting the snap-max-hard-limit to 4 +TEST $CLI_1 snapshot config $V0 snap-max-hard-limit 4 +PID_1=$! +wait $PID_1 + +#Creating 4 snapshots on the volume +TEST create_n_snapshots $V0 4 $V0_snap +TEST snapshot_n_exists $V0 4 $V0_snap + +#Creating the 5th snapshots on the volume and expecting it not to be created. +TEST ! $CLI_1 snapshot create $V0 -n ${V0}_snap5 +TEST ! snapshot_exists ${V0}_snap5 +TEST ! $CLI_1 snapshot delete $V0 -s ${V0}_snap5 + +#Deleting the 4 snaps +TEST delete_n_snapshots $V0 4 $V0_snap +TEST ! snapshot_n_exists $V0 4 $V0_snap + +cleanup; |