summaryrefslogtreecommitdiffstats
path: root/test/shell
diff options
context:
space:
mode:
authorJonathan Earl Brassow <jbrassow@redhat.com>2012-01-24 14:33:38 +0000
committerJonathan Earl Brassow <jbrassow@redhat.com>2012-01-24 14:33:38 +0000
commit6cf3274732449d5eed753289c3fe70ebb464f706 (patch)
tree1ee69e4819c5a79a95ff49dd49da39795083887a /test/shell
parent095d95d0a87ef76bee43f001d480d15b3770a36b (diff)
downloadlvm2-6cf3274732449d5eed753289c3fe70ebb464f706.tar.gz
lvm2-6cf3274732449d5eed753289c3fe70ebb464f706.tar.xz
lvm2-6cf3274732449d5eed753289c3fe70ebb464f706.zip
Use suspend|resume_origin_only when up-converting RAID LVs, as mirrors do.
Failure to do so results in "Performing unsafe table load while X device(s) are known to be suspended" errors. While fixing the problem in this way works and is consistent with the way the mirror segment type does it, it would be nice to find a solution that uses the generic suspend/resume calls. Also included in this check-in are additions to the test suite that perform conversions on RAID LVs under a snapshot. These tests are disabled for the time being due to a kernel bug that is yet to be tracked down.
Diffstat (limited to 'test/shell')
-rw-r--r--test/shell/lvconvert-raid.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 66f533c3..73d1a000 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -25,10 +25,14 @@ function is_in_sync()
if ! a=(`dmsetup status $dm_name`); then
echo "Unable to get sync status of $1"
exit 1
+ elif [ ${a[2]} = "snapshot-origin" ]; then
+ if ! a=(`dmsetup status ${dm_name}-real`); then
+ echo "Unable to get sync status of $1"
+ exit 1
+ fi
fi
# 6th argument is the sync ratio for RAID and mirror
- echo ${a[@]}
if [ ${a[2]} = "raid" ]; then
# Last argument is the sync ratio for RAID
idx=$((${#a[@]} - 1))
@@ -103,6 +107,11 @@ aux prepare_vg 5 80
###########################################
# RAID1 convert tests
###########################################
+#
+# FIXME: Snapshots of RAID is available, but there are kernel bugs that
+# still prevent its use.
+#for under_snap in false true; do
+for under_snap in false; do
for i in 1 2 3 4; do
for j in 1 2 3 4; do
if [ $i -eq 1 ]; then
@@ -115,7 +124,13 @@ for i in 1 2 3 4; do
else
to="$j-way"
fi
- echo "Converting from $from to $to"
+
+ echo -n "Converting from $from to $to"
+ if $under_snap; then
+ echo -n " (while under a snapshot)"
+ fi
+ echo
+
if [ $i -eq 1 ]; then
# Shouldn't be able to create with just 1 image
not lvcreate --type raid1 -m 0 -l 2 -n $lv1 $vg
@@ -125,6 +140,11 @@ for i in 1 2 3 4; do
lvcreate --type raid1 -m $(($i - 1)) -l 2 -n $lv1 $vg
wait_for_sync $vg/$lv1
fi
+
+ if $under_snap; then
+ lvcreate -s $vg/$lv1 -n snap -l 2
+ fi
+
lvconvert -m $((j - 1)) $vg/$lv1
# FIXME: ensure no residual devices
@@ -135,7 +155,7 @@ for i in 1 2 3 4; do
lvremove -ff $vg
done
done
-
+done
#
# FIXME: Add tests that specify particular devices to be removed
#