From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/test/shell lvconvert-mirror.sh
Date: 2 Mar 2012 00:08:49 -0000 [thread overview]
Message-ID: <20120302000849.8649.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-03-02 00:08:49
Modified files:
test/shell : lvconvert-mirror.sh
Log message:
Wait for mirror in sync
1s could be too short
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/lvconvert-mirror.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3
--- LVM2/test/shell/lvconvert-mirror.sh 2012/02/23 13:11:10 1.2
+++ LVM2/test/shell/lvconvert-mirror.sh 2012/03/02 00:08:48 1.3
@@ -11,6 +11,11 @@
. lib/test
+wait_for_mirror_in_sync_()
+{
+ while [ $(lvs --noheadings -o copy_percent $1) != "100.00" ]; do sleep 1; done
+}
+
# convert from linear to 2-way mirror
aux prepare_vg 5
lvcreate -l2 -n $lv1 $vg $dev1
@@ -79,7 +84,7 @@
lvconvert $vg/$lv1 # wait
lvconvert -m2 $vg/$lv1 $dev1 $dev2 $dev4 $dev3:0 # If the above "should" failed...
-sleep 1
+wait_for_mirror_in_sync_ $vg/$lv1
lvconvert -m-1 $vg/$lv1 $dev1
check mirror_images_on $lv1 $dev2 $dev4
lvconvert -m-1 $vg/$lv1 $dev2
@@ -201,7 +206,7 @@
# "rhbz440405: lvconvert -m0 incorrectly fails if all PEs allocated"
aux prepare_vg 5
lvcreate -l`pvs --noheadings -ope_count $dev1` -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0
-while [ `lvs --noheadings -o copy_percent $vg/$lv1` != "100.00" ]; do sleep 1; done
+wait_for_mirror_in_sync_ $vg/$lv1
lvconvert -m0 $vg/$lv1 $dev1
check linear $vg $lv1
@@ -223,7 +228,7 @@
# BZ 463272: disk log mirror convert option is lost if downconvert option is also given
aux prepare_vg 5
lvcreate -l1 -m2 --corelog -n $lv1 $vg $dev1 $dev2 $dev3
-while [ `lvs --noheadings -o copy_percent $vg/$lv1` != "100.00" ]; do sleep 1; done
+wait_for_mirror_in_sync_ $vg/$lv1
lvconvert -m1 --mirrorlog disk $vg/$lv1
check mirror $vg $lv1
not check mirror $vg $lv1 core
reply other threads:[~2012-03-02 0:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120302000849.8649.qmail@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.