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/volume.rc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'tests/volume.rc') diff --git a/tests/volume.rc b/tests/volume.rc index 9e4843e06..7d2494067 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -308,3 +308,54 @@ function has_holes { echo "0" fi } + +function do_volume_operations() { + local operation=$1 + local count=$2 + local force=$3 + + local pids=() + local cli + local v + + for i in `seq 1 $count`; do + cli="CLI_$i" + v="V`expr $i - 1`" + ${!cli} volume $operation ${!v} $force & + pids[$i]=$! + done + + for i in `seq 1 $count`; do + wait ${pids[$i]} + done +} + +function start_volumes() { + do_volume_operations start $1 +} + +function stop_volumes() { + do_volume_operations stop $1 +} + +function start_force_volumes() { + do_volume_operations start $1 force +} + +function stop_force_volumes() { + do_volume_operations stop $1 force +} + +function delete_volumes() { + do_volume_operations delete $1 +} + +function volume_exists() { + local volname=$1 + $CLI volume info $volname 2>&1 | grep -q 'does not exist' + if [ $? -eq 0 ]; then + return 1 + else + return 0 + fi +} -- cgit