1 # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
3 # This copyrighted material is made available to anyone wishing to use,
4 # modify, copy, or redistribute it subject to the terms and conditions
5 # of the GNU General Public License v.2.
7 # You should have received a copy of the GNU General Public License
8 # along with this program; if not, write to the Free Software Foundation,
9 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12 # tests basic functionality of read-ahead and ra regressions
17 TEST_UUID="aaaaaa-aaaa-aaaa-aaaa-aaaa-aaaa-aaaaaa"
21 case $(lvs --units s --nosuffix --noheadings -o $1_read_ahead "$vg"/"$lv") in
30 pvcreate --metadatacopies 0 $dev2
31 pvcreate --metadatacopies 0 $dev3
33 pvcreate -u $TEST_UUID --metadatacopies 0 $dev5
34 vgcreate -c n $vg $devs
35 lvcreate -n $lv -l 5 -i5 -I256 $vg
37 # test *scan and *display tools
44 for i in h b s k m g t p e H B S K M G T P E ; do
45 pvdisplay --units "$i" "$dev1"
48 # test vgexport vgimport tools
54 # "-persistent y --major 254 --minor 20"
56 # test various lvm utils
57 for i in dumpconfig formats segtypes; do
61 for i in pr "p rw" an ay "-monitor y" "-monitor n" \
62 -resync -refresh "-addtag MYTAG" "-deltag MYETAG"; do
63 lvchange -$i "$vg"/"$lv"
68 lvrename "$vg" "$lv" "$lv-rename"
69 vgcfgbackup -f "$(pwd)/backup.$$" "$vg"
71 vgcfgrestore -f "$(pwd)/backup.$$" "$vg"
73 not vgcfgrestore -f "$(pwd)/backup.$$" "$vg"
74 pvcreate -u $TEST_UUID --restorefile "$(pwd)/backup.$$" $dev5
76 pvresize --setphysicalvolumesize 10M "$dev1"
78 # test various errors and obsoleted tools
81 not lvrename "$vg-xxx"
82 not lvrename "$vg" "$vg"/"$lv-rename" "$vg"/"$lv"