mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
tests: add some lvm shell testing
Check lvm shell for autocomplete functionality and error reporting.
This commit is contained in:
parent
cd56b04ef6
commit
2e6e752c3a
@ -31,6 +31,15 @@ pvcreate --metadatacopies 0 "$dev3"
|
|||||||
|
|
||||||
vgcreate $SHARED "$vg" "${DEVICES[@]}"
|
vgcreate $SHARED "$vg" "${DEVICES[@]}"
|
||||||
|
|
||||||
|
# discovers whether lvm2 is compiled with lvm shell support
|
||||||
|
echo "nonexisting" | lvm &>out && {
|
||||||
|
# shell is built-in, command should report this error
|
||||||
|
grep "No such command" out
|
||||||
|
|
||||||
|
# check whether lvm shell autocomplete works on \tab
|
||||||
|
printf "lvcr\t --si\t 10 -\tn $lv3 $vg" | lvm
|
||||||
|
}
|
||||||
|
|
||||||
lvcreate -l 5 -i5 -I256 -n $lv $vg
|
lvcreate -l 5 -i5 -I256 -n $lv $vg
|
||||||
lvcreate -aey -l 5 -n $lv1 $vg
|
lvcreate -aey -l 5 -n $lv1 $vg
|
||||||
lvcreate -s -l 5 -n $lv2 $vg/$lv1
|
lvcreate -s -l 5 -n $lv2 $vg/$lv1
|
||||||
@ -79,3 +88,9 @@ not lvm lvmchange
|
|||||||
not lvm lvmsadc
|
not lvm lvmsadc
|
||||||
not lvm lvmsar
|
not lvm lvmsar
|
||||||
not lvm pvdata
|
not lvm pvdata
|
||||||
|
|
||||||
|
if lvm nonexistingcommand ; then
|
||||||
|
die "lvm must fail"
|
||||||
|
elif [ "$?" != "2" ] ; then
|
||||||
|
die "lvm sould return code 2"
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user