1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Minor code and documentation cleanups and changes by jstava.

This commit is contained in:
Petr Rockai 2008-11-10 12:43:35 +00:00
parent 024acb0335
commit b6f3ef938a
8 changed files with 42 additions and 23 deletions

View File

@ -11,6 +11,8 @@
. ./test-utils.sh
aux prepare_pvs 3
# not required, just testing
aux pvcreate --metadatacopies 0 $dev1
vgcreate $vg $devs
pvchange --addtag fast $devs

View File

@ -15,7 +15,7 @@ aux prepare_devs 4
for mdatype in 1 2
do
# pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg)
# pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg) (bz178216)
pvcreate -M$mdatype $dev1
pvcreate -M$mdatype $dev1
pvremove -f $dev1

View File

@ -31,7 +31,6 @@ pvremove $dev1
# x. metadatasize too large
# For some reason we allow this, even though there's no room for data?
#test_expect_success \
##COMM 'pvcreate rejects metadatasize too large'
#not pvcreate --metadatasize 100000000000000 $dev1

View File

@ -19,7 +19,11 @@ test_description='Test read-ahead functionality'
get_lvs_() {
case $(lvs --units s --nosuffix --noheadings -o $1_read_ahead "$vg"/"$lv") in
lvs --units s --nosuffix --noheadings -o $1 "$vg"/"$lv"
}
check_lvs_() {
case $(get_lvs_ $1) in
*$2) true ;;
*) false ;;
esac
@ -27,13 +31,15 @@ get_lvs_() {
aux prepare_vg 5
#COMM "test various read ahead settings"
#COMM "test various read ahead settings (bz450922)"
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
get_lvs_ lv auto
get_lvs_ lv_kernel 5120
check_lvs_ lv_read_ahead auto
check_lvs_ lv_kernel_read_ahead 5120
lvchange -r 400 "$vg/$lv"
get_lvs_ lv 400
vgremove -f "$vg"
check_lvs_ lv_read_ahead 400
lvremove -ff "$vg"

View File

@ -1,3 +1,14 @@
#!/bin/sh
# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./test-utils.sh
aux prepare_vg 3
@ -12,7 +23,7 @@ vgscan 2>&1 | tee vgscan.out
not grep "Inconsistent metadata found for VG $vg" vgscan.out
}
# try orphaning a missing PV
# try orphaning a missing PV (bz45867)
disable_dev $dev1
vgreduce --removemissing --force $vg
enable_dev $dev1

View File

@ -55,7 +55,7 @@ grep "New volume group name \"$vginvalid\" is invalid\$" err
#not vgcreate $vg $dev1 $dev2 2>err
#grep "New volume group name \"$vg\" is invalid\$" err
#COMM "vgcreate rejects repeated invocation (run 2 times)"
#COMM "vgcreate rejects repeated invocation (run 2 times) (bz178216)"
vgcreate $vg $dev1 $dev2
not vgcreate $vg $dev1 $dev2
vgremove -ff $vg

View File

@ -43,43 +43,43 @@ mdatype=2 # we only expect the following to work for lvm2 metadata
pvcreate -M$mdatype $dev1 $dev2
pvcreate --metadatacopies 0 -M$mdatype $dev3 $dev4
# (lvm$mdatype) vgreduce rejects removing pv with the last mda copy
# (lvm$mdatype) vgreduce rejects removing pv with the last mda copy (bz247448)
vgcreate -M$mdatype $vg1 $dev1 $dev3
not vgreduce $vg1 $dev1
vgremove -f $vg1
#COMM "(lvm$mdatype) vgreduce --removemissing --force repares to linear (bz221921)"
# (lvm$mdatype) setup: create mirror & damage one pv
vgcreate -M$mdatype $vg1 $dev1 $dev2 $dev3
lvcreate -n $lv1 -m1 -l 4 $vg1
lvcreate -n $lv2 -l 4 $vg1 $dev2
lvcreate -n $lv3 -l 4 $vg1 $dev3
vgchange -an $vg1
pvcreate -ff -y $dev1
aux disable_dev $dev1
# (lvm$mdatype) vgreduce --removemissing --force repares to linear
vgreduce --removemissing --force $vg1
check_lv_field_ $vg1/$lv1 segtype linear
vg_validate_pvlv_counts_ $vg1 2 3 0
# cleanup
aux enable_dev $dev1
vgremove -ff $vg1
#COMM "vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too"
# (lvm$mdatype) setup: create mirror + linear lvs
vgcreate -M$mdatype $vg1 $dev1
vgcreate -M$mdatype $vg1 $devs
lvcreate -n $lv2 -l 4 $vg1
lvcreate -n $lv1 -l 4 $vg1
vgextend $vg1 $dev2 $dev3
lvcreate -m1 -n $lv1 -l 4 $vg1 $dev1 $dev2 $dev3
lvcreate -n $lv3 -l 4 $vg1 $dev3
lvconvert -m1 $vg1/$lv1
pvs --segments -o +lv_name # for record only
# (lvm$mdatype) setup: damage one pv
vgchange -an $vg1 &&
pvcreate -ff -y $dev1
vgchange -an $vg1
aux disable_dev $dev1
#pvcreate -ff -y $dev1
# vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too
not vgreduce --removemissing --mirrorsonly --force $vg1
aux enable_dev $dev1
pvs -P # for record
lvs -P # for record
vgs -P # for record

View File

@ -25,6 +25,7 @@ do
pvcreate -M$mdatype $devs
# vgsplit accepts new vg as destination of split
# lvm1 -- bz244792
vgcreate -M$mdatype $vg1 $devs
vgsplit $vg1 $vg2 $dev1 1>err
grep "New volume group \"$vg2\" successfully split from \"$vg1\"" err