mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-26 03:22:12 +03:00
53 lines
1.5 KiB
Bash
53 lines
1.5 KiB
Bash
|
#!/bin/sh
|
||
|
|
||
|
test_description='Ensure that pvmove diagnoses PE-range values 2^32 and larger.'
|
||
|
privileges_required_=1
|
||
|
|
||
|
. ./test-lib.sh
|
||
|
|
||
|
cleanup_()
|
||
|
{
|
||
|
test -n "$vg" && {
|
||
|
vgchange -an "$vg"
|
||
|
lvremove -ff "$vg"
|
||
|
vgremove "$vg"
|
||
|
} > /dev/null
|
||
|
test -n "$d1" && losetup -d "$d1"
|
||
|
test -n "$d2" && losetup -d "$d2"
|
||
|
rm -f "$f1" "$f2"
|
||
|
}
|
||
|
|
||
|
test_expect_success \
|
||
|
'set up temp files, loopback devices, PVs, VG, LV' \
|
||
|
'f1="$(pwd)/1" && d1=$(loop_setup_ "$f1") &&
|
||
|
f2="$(pwd)/2" && d2=$(loop_setup_ "$f2") &&
|
||
|
pvcreate $d1 $d2 &&
|
||
|
vg=pvmove-demo-vg-$$ &&
|
||
|
vgcreate "$vg" $d1 $d2 &&
|
||
|
lv=lv1 &&
|
||
|
lvcreate -L4 -n"$lv" "$vg"'
|
||
|
|
||
|
# Test for the bogus diagnostic reported in BZ 284771
|
||
|
# http://bugzilla.redhat.com/284771. Once the BZ is fixed,
|
||
|
# update the code below to expect an improved diagnostic.
|
||
|
test_expect_success \
|
||
|
'run pvmove with an unrecognized LV name to show bad diagnostic' \
|
||
|
'pvmove -v -nbogus $d1 $d2 2> err
|
||
|
test $? = 5 &&
|
||
|
tail -n1 err > out &&
|
||
|
echo " No data to move for $vg" > expected &&
|
||
|
diff -u out expected'
|
||
|
|
||
|
# With lvm-2.02.28 and earlier, on a system with 64-bit "long int",
|
||
|
# the PE range parsing code would accept values up to 2^64-1, but would
|
||
|
# silently truncate them to int32_t. I.e., $d1:$(echo 2^32|bc) would be
|
||
|
# treated just like $d1:0.
|
||
|
test_expect_failure \
|
||
|
'run the offending pvmove command' \
|
||
|
'pvmove -v -n$lv $d1:4294967296 $d2'
|
||
|
|
||
|
test_done
|
||
|
# Local Variables:
|
||
|
# indent-tabs-mode: nil
|
||
|
# End:
|