mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
In testsuite, catch also failures that happen in the middle of a pipeline.
This commit is contained in:
parent
97d91b30e6
commit
943c443426
@ -35,7 +35,7 @@ lvremove -f $vg/$lv
|
||||
# 'lvextend computes necessary free space correctly - bz213552'
|
||||
vgsize=$(vgs -o vg_extent_count --noheadings)
|
||||
lvcreate -l $vgsize -n $lv $vg
|
||||
yes | lvreduce -l $(( $vgsize / 2 )) $vg/$lv
|
||||
lvreduce -f -l $(( $vgsize / 2 )) $vg/$lv
|
||||
lvextend -l $vgsize $vg/$lv
|
||||
|
||||
# 'Reset LV to original size'
|
||||
|
@ -31,11 +31,13 @@ mimages_are_redundant_ ()
|
||||
local i
|
||||
|
||||
rm -f out
|
||||
lvs -odevices --noheadings $lv | sed 's/([^)]*)//g; s/,/ /g'
|
||||
for i in $(lvs -odevices --noheadings $lv | sed 's/([^)]*)//g; s/,/ /g'); do
|
||||
lvs -a -odevices --noheadings $vg/$i | sed 's/([^)]*)//g; s/,/ /g' | \
|
||||
sort | uniq >> out
|
||||
sort | uniq >> out || true
|
||||
done
|
||||
|
||||
cat out
|
||||
# if any duplication is found, it's not redundant
|
||||
sort out | uniq -d | grep . && return 1
|
||||
|
||||
@ -181,7 +183,7 @@ check_and_cleanup_lvs_
|
||||
#COMM "convert from linear to 2-way mirror"
|
||||
prepare_lvs_
|
||||
lvcreate -l2 -n $lv1 $vg $dev1
|
||||
lvconvert -m+1 $vg/$lv1 $dev2 $dev3:0-1
|
||||
lvconvert -i1 -m+1 $vg/$lv1 $dev2 $dev3:0-1
|
||||
mimages_are_redundant_ $vg $lv1
|
||||
mirrorlog_is_on_ $vg/$lv1 $dev3
|
||||
check_and_cleanup_lvs_
|
||||
@ -196,21 +198,21 @@ check_and_cleanup_lvs_
|
||||
for status in active inactive; do
|
||||
# bz192865 lvconvert log of an inactive mirror lv
|
||||
#COMM "convert from disklog to corelog"
|
||||
prepare_lvs_
|
||||
lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1
|
||||
test $status = "inactive" && lvchange -an $vg/$lv1
|
||||
yes | lvconvert --mirrorlog core $vg/$lv1
|
||||
mimages_are_redundant_ $vg $lv1
|
||||
check_and_cleanup_lvs_
|
||||
prepare_lvs_
|
||||
lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1
|
||||
test $status = "inactive" && lvchange -an $vg/$lv1
|
||||
echo y | lvconvert -f --mirrorlog core $vg/$lv1
|
||||
mimages_are_redundant_ $vg $lv1
|
||||
check_and_cleanup_lvs_
|
||||
|
||||
#COMM "convert from corelog to disklog"
|
||||
prepare_lvs_
|
||||
lvcreate -l2 -m1 --mirrorlog core -n $lv1 $vg $dev1 $dev2
|
||||
test $status = "inactive" && lvchange -an $vg/$lv1
|
||||
lvconvert --mirrorlog disk $vg/$lv1 $dev3:0-1
|
||||
mimages_are_redundant_ $vg $lv1
|
||||
mirrorlog_is_on_ $vg/$lv1 $dev3
|
||||
check_and_cleanup_lvs_
|
||||
#COMM "convert from corelog to disklog"
|
||||
prepare_lvs_
|
||||
lvcreate -l2 -m1 --mirrorlog core -n $lv1 $vg $dev1 $dev2
|
||||
test $status = "inactive" && lvchange -an $vg/$lv1
|
||||
lvconvert --mirrorlog disk $vg/$lv1 $dev3:0-1
|
||||
mimages_are_redundant_ $vg $lv1
|
||||
mirrorlog_is_on_ $vg/$lv1 $dev3
|
||||
check_and_cleanup_lvs_
|
||||
done
|
||||
|
||||
# ---
|
||||
@ -267,7 +269,7 @@ check_and_cleanup_lvs_
|
||||
prepare_lvs_
|
||||
lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0-1
|
||||
mirrorlog_is_on_ $vg/$lv1 $dev3
|
||||
yes | lvchange --resync $vg/$lv1
|
||||
echo y | lvchange --resync $vg/$lv1
|
||||
mirrorlog_is_on_ $vg/$lv1 $dev3
|
||||
check_and_cleanup_lvs_
|
||||
|
||||
|
@ -58,6 +58,7 @@ mirrorlog_is_on_()
|
||||
{
|
||||
local lv="$1"_mlog
|
||||
shift 1
|
||||
if ! lvs -a $lv; then return 0; fi # FIXME?
|
||||
lvs -a -odevices --noheadings $lv | sed 's/,/\n/g' > out
|
||||
for d in $*; do grep "$d(" out || return 1; done
|
||||
for d in $*; do grep -v "$d(" out > out2 || true; mv out2 out; done
|
||||
|
@ -52,7 +52,7 @@ for mdacp in 0 1 2; do
|
||||
echo n | not pvremove -ff $dev1
|
||||
|
||||
# pvremove -ff succeds with confirmation when pv in a vg (---metadatacopies $mdacp)
|
||||
yes | pvremove -ff $dev1
|
||||
pvremove -ffy $dev1
|
||||
not pvs $dev1
|
||||
|
||||
vgreduce --removemissing $vg
|
||||
|
@ -36,7 +36,7 @@ lvcreate -n "$lv" -l 100%FREE -i5 -I256 "$vg"
|
||||
ra="$(get_lvs_ lv_kernel_read_ahead)"
|
||||
test "$(( ( $ra / 5 ) * 5 ))" -eq $ra
|
||||
lvdisplay "$vg"/"$lv"
|
||||
lvchange -r auto "$vg"/"$lv" 2>&1 | grep auto
|
||||
not lvchange -r auto "$vg"/"$lv" 2>&1 | grep auto
|
||||
check_lvs_ lv_read_ahead auto
|
||||
check_lvs_ lv_kernel_read_ahead 5120
|
||||
lvchange -r 640 "$vg/$lv"
|
||||
|
@ -302,6 +302,6 @@ prepare_lvmconf() {
|
||||
EOF
|
||||
}
|
||||
|
||||
set -vexE
|
||||
set -vexE -o pipefail
|
||||
aux prepare_lvmconf
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user