summaryrefslogtreecommitdiffstats
path: root/tests/snapshot.rc
diff options
context:
space:
mode:
authorVijaikumar M <vmallika@redhat.com>2014-02-13 16:32:12 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-02-13 06:18:15 -0800
commit96f6c5159da92500e8ddb21a487d2848a2b1f7db (patch)
tree173aadb72ff76d27ef6589a2ed1eed5c5220abff /tests/snapshot.rc
parenta6351ee1c823a295f592f4adf5876a6166d47afe (diff)
glusterd/snapshot: Use snap uuid to create lvm snapshot
Using snap uuid to create lvm snapshot will solve the problem of having '-' in the snap name or snap name is too long. Change-Id: If204f02a8f5de599fb409d06c7893ef3542a6300 BUG: 1045333 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/6709 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
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 fa308e599..0be98dc06 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 $?
}