summaryrefslogtreecommitdiffstats
path: root/tests/snapshot.rc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/snapshot.rc')
-rwxr-xr-xtests/snapshot.rc20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/snapshot.rc b/tests/snapshot.rc
index fa308e5..0be98dc 100755
--- a/tests/snapshot.rc
+++ b/tests/snapshot.rc
@@ -19,11 +19,15 @@ function init_lvm() {
local b
local i
+ if [ "$B1" = "" ]; then
+ B1=$B0
+ fi
+
for i in `seq 1 $LVM_COUNT`; do
b="B$i"
if [ "${!b}" = "" ]; then
echo "Error: $b not defined."
- echo "Please run launch_cluster before creating lvm"
+ echo "Please run launch_cluster with atleast $LVM_COUNT nodes"
return 1
fi
@@ -91,18 +95,18 @@ function _cleanup_lvm() {
function _cleanup_lvm_again() {
local file
- mount | grep $LVM_PREFIX | awk '{print $3}' | xargs umount -f
+ mount | grep $LVM_PREFIX | awk '{print $3}' | xargs -r umount -f
- /sbin/vgs | grep $LVM_PREFIX | awk '{print $1}' | xargs vgremove -f
+ /sbin/vgs | grep $LVM_PREFIX | awk '{print $1}' | xargs -r vgremove -f
- find $B0 -name "${LVM_PREFIX}_loop" | xargs losetup -d
+ find $B0 -name "${LVM_PREFIX}_loop" | xargs -r losetup -d
- find $B0 -name "${LVM_PREFIX}*" | xargs rm -rf
+ find $B0 -name "${LVM_PREFIX}*" | xargs -r rm -rf
- find /run/gluster/snaps -name "*${LVM_PREFIX}*" | xargs rm -rf
+ find /run/gluster/snaps -name "*${LVM_PREFIX}*" | xargs -r rm -rf
for file in `ls /run/gluster/snaps`; do
- find /run/gluster/snaps/$file -mmin -2 | xargs rm -rf
+ find /run/gluster/snaps/$file -mmin -2 | xargs -r rm -rf
done
}
@@ -168,6 +172,6 @@ function _remove_vhd() {
########################################################
function snapshot_exists() {
local snapname=$1
- $CLI_1 snapshot list | egrep -q "\b$snapname\b"
+ $CLI snapshot list | egrep -q "\s$snapname\b"
return $?
}