From 29bccc2ed18eedc40e83d2f0d35327037a322384 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 19 Feb 2014 16:30:11 +0530 Subject: gluster: GlusterFS Volume Snapshot Feature This is the initial patch for the Snapshot feature. Current patch includes following features: * Snapshot create * Snapshot delete * Snapshot restore * Snapshot list * Snapshot info * Snapshot status * Snapshot config Change-Id: I2f46920c0d61c515f6a60e0f8b46fff886d9f6a9 BUG: 1061685 Signed-off-by: shishir gowda Signed-off-by: Sachin Pandit Signed-off-by: Vijaikumar M Signed-off-by: Raghavendra Bhat Signed-off-by: Rajesh Joseph Signed-off-by: Joseph Fernandes Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/7128 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/bugs/bug-1045333.t | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/bugs/bug-1049834.t | 40 +++++++++++++++++++++++++++++++++++++ tests/bugs/bug-1064768.t | 20 +++++++++++++++++++ tests/bugs/bug-948686.t | 0 4 files changed, 111 insertions(+) create mode 100755 tests/bugs/bug-1045333.t create mode 100755 tests/bugs/bug-1049834.t create mode 100644 tests/bugs/bug-1064768.t mode change 100644 => 100755 tests/bugs/bug-948686.t (limited to 'tests/bugs') diff --git a/tests/bugs/bug-1045333.t b/tests/bugs/bug-1045333.t new file mode 100755 index 00000000000..8f4798ebc23 --- /dev/null +++ b/tests/bugs/bug-1045333.t @@ -0,0 +1,51 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../snapshot.rc + +cleanup; +TEST glusterd; +TEST pidof glusterd; + +TEST setup_lvm 1 + +TEST $CLI volume create $V0 $H0:$L1 +TEST $CLI volume start $V0 + + +S1="${V0}-snap1" #Create snapshot with name contains hyphen(-) +S2="-${V0}-snap2" #Create snapshot with name starts with hyphen(-) +#Create snapshot with a long name +S3="${V0}_single_gluster_volume_is_accessible_by_multiple_clients_offline_snapshot_is_a_long_name" + +TEST $CLI snapshot create $S1 $V0 +TEST snapshot_exists 0 $S1 + +TEST $CLI snapshot create $S2 $V0 +TEST snapshot_exists 0 $S2 + +TEST $CLI snapshot create $S3 $V0 +TEST snapshot_exists 0 $S3 + + +TEST glusterfs -s $H0 --volfile-id=/snaps/$S1/$V0 $M0 +sleep 2 +TEST umount -f $M0 + +TEST glusterfs -s $H0 --volfile-id=/snaps/$S2/$V0 $M0 +sleep 2 +TEST umount -f $M0 + +TEST glusterfs -s $H0 --volfile-id=/snaps/$S3/$V0 $M0 +sleep 2 +TEST umount -f $M0 + +#Clean up +#TEST $CLI snapshot delete $S1 +#TEST $CLI snapshot delete $S2 +#TEST $CLI snapshot delete $S3 + +TEST $CLI volume stop $V0 force +#TEST $CLI volume delete $V0 + +cleanup; diff --git a/tests/bugs/bug-1049834.t b/tests/bugs/bug-1049834.t new file mode 100755 index 00000000000..c1b126ba1b1 --- /dev/null +++ b/tests/bugs/bug-1049834.t @@ -0,0 +1,40 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../cluster.rc +. $(dirname $0)/../volume.rc +. $(dirname $0)/../snapshot.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}_snap5 ${V0} +TEST ! snapshot_exists 1 ${V0}_snap5 +TEST ! $CLI_1 snapshot delete ${V0}_snap5 + +#Deleting the 4 snaps +#TEST delete_n_snapshots $V0 4 $V0_snap +#TEST ! snapshot_n_exists $V0 4 $V0_snap + +cleanup; diff --git a/tests/bugs/bug-1064768.t b/tests/bugs/bug-1064768.t new file mode 100644 index 00000000000..b87168150d2 --- /dev/null +++ b/tests/bugs/bug-1064768.t @@ -0,0 +1,20 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/brick0 $H0:$B0/brick1 +TEST $CLI volume start $V0 +EXPECT_WITHIN 15 'Started' volinfo_field $V0 'Status'; + +TEST $CLI volume profile $V0 start +TEST $CLI volume profile $V0 info +TEST $CLI volume profile $V0 stop + +TEST $CLI volume status +TEST $CLI volume stop $V0 +EXPECT_WITHIN 15 'Stopped' volinfo_field $V0 'Status'; +cleanup; diff --git a/tests/bugs/bug-948686.t b/tests/bugs/bug-948686.t old mode 100644 new mode 100755 -- cgit