mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
More test script fixes.
This commit is contained in:
parent
0c06de632a
commit
378bbe63f3
@ -52,17 +52,29 @@ loop_setup_()
|
||||
|
||||
check_vg_field_()
|
||||
{
|
||||
if test "$verbose" = "t"
|
||||
then
|
||||
echo "check_vg_field_ actual: `vgs --noheadings -o $2 $1` expected $3"
|
||||
fi
|
||||
return $(test $(vgs --noheadings -o $2 $1) == $3)
|
||||
}
|
||||
|
||||
check_pv_size_()
|
||||
check_pv_field_()
|
||||
{
|
||||
return $(test $(pvs --noheadings -o pv_free $1) == $2)
|
||||
if test "$verbose" = "t"
|
||||
then
|
||||
echo "check_pv_field_ actual: `pvs --noheadings -o $2 $1` expected $3"
|
||||
fi
|
||||
return $(test $(pvs --noheadings -o $2 $1) == $3)
|
||||
}
|
||||
|
||||
check_lv_size_()
|
||||
check_lv_field_()
|
||||
{
|
||||
return $(test $(lvs --noheadings -o lv_size $1) == $2)
|
||||
if test "$verbose" = "t"
|
||||
then
|
||||
echo "check_lv_field_ actual: `lvs --noheadings -o $2 $1` expected $3"
|
||||
fi
|
||||
return $(test $(lvs --noheadings -o $2 $1) == $3)
|
||||
}
|
||||
|
||||
dmsetup_has_dm_devdir_support_()
|
||||
|
@ -37,7 +37,7 @@ test_expect_success \
|
||||
lv=lvcreate-usage-$$
|
||||
|
||||
test_expect_success \
|
||||
'lvcreate rejects a negative stripesize' \
|
||||
'lvcreate rejects a negative stripe_size' \
|
||||
'lvcreate -L 64M -n $lv -i2 --stripesize -4 $vg 2>err;
|
||||
status=$?; echo status=$?; test $status = 3 &&
|
||||
grep "^ Negative stripesize is invalid\$" err'
|
||||
@ -56,10 +56,11 @@ test_expect_success \
|
||||
lvremove -ff $vg'
|
||||
|
||||
test_expect_success \
|
||||
'lvcreate w/no stripe size succeeds with diagnostics to stdout' \
|
||||
'lvcreate w/default (64KB) stripe size succeeds with diagnostics to stdout' \
|
||||
'lvcreate -L 64M -n $lv -i2 $vg > out &&
|
||||
grep "^ Using default stripesize" out &&
|
||||
lvdisplay $vg &&
|
||||
check_lv_field_ $vg/$lv stripesize "64.00K" &&
|
||||
lvremove -ff $vg'
|
||||
|
||||
test_expect_success \
|
||||
|
@ -50,7 +50,7 @@ test_expect_success \
|
||||
'lvextend accepts no size or extents but one PV - bz154691' \
|
||||
'lvextend $vg/$lv $d1 >out; test $? = 0 &&
|
||||
grep "^ Logical volume $lv successfully resized\$" out &&
|
||||
check_pv_size_ $d1 "0"'
|
||||
check_pv_field_ $d1 pv_free "0"'
|
||||
|
||||
test_expect_success \
|
||||
'Reset LV to original size' \
|
||||
@ -61,8 +61,8 @@ test_expect_success \
|
||||
'lvextend accepts no size but extents 100%PVS and two PVs - bz154691' \
|
||||
'lvextend -l +100%PVS $vg/$lv $d1 $d2 >out; test $? = 0 &&
|
||||
grep "^ Logical volume $lv successfully resized\$" out &&
|
||||
check_pv_size_ $d1 "0" &&
|
||||
check_pv_size_ $d2 "0"'
|
||||
check_pv_field_ $d1 pv_free "0" &&
|
||||
check_pv_field_ $d2 pv_free "0"'
|
||||
|
||||
# Exercise the range overlap code. Allocate every 2 extents.
|
||||
#
|
||||
@ -89,14 +89,14 @@ test_expect_success \
|
||||
'create_pvs=`for i in $(seq 0 4 20); do echo -n "\$d1:$i-$(($i + 1)) "; done` &&
|
||||
lvremove -f $vg/$lv; test $? = 0 &&
|
||||
lvcreate -l 12 -n $lv $vg $create_pvs; test $? = 0 &&
|
||||
check_lv_size_ $vg/$lv "48.00M"'
|
||||
check_lv_field_ $vg/$lv lv_size "48.00M"'
|
||||
|
||||
test_expect_success \
|
||||
'lvextend with partially allocated PVs and extents 100%PVS with PE ranges' \
|
||||
'extend_pvs=`for i in $(seq 0 6 18); do echo -n "\$d1:$i-$(($i + 2)) "; done` &&
|
||||
lvextend -l +100%PVS $vg/$lv $extend_pvs >out; test $? = 0 &&
|
||||
grep "^ Logical volume $lv successfully resized\$" out &&
|
||||
check_lv_size_ $vg/$lv "72.00M"'
|
||||
check_lv_field_ $vg/$lv lv_size "72.00M"'
|
||||
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user