186d7f5d3SJohn Marino#!/bin/sh 286d7f5d3SJohn Marino# Copyright (C) 2008 Red Hat, Inc. All rights reserved. 386d7f5d3SJohn Marino# 486d7f5d3SJohn Marino# This copyrighted material is made available to anyone wishing to use, 586d7f5d3SJohn Marino# modify, copy, or redistribute it subject to the terms and conditions 686d7f5d3SJohn Marino# of the GNU General Public License v.2. 786d7f5d3SJohn Marino# 886d7f5d3SJohn Marino# You should have received a copy of the GNU General Public License 986d7f5d3SJohn Marino# along with this program; if not, write to the Free Software Foundation, 1086d7f5d3SJohn Marino# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1186d7f5d3SJohn Marino 1286d7f5d3SJohn Marino# 'Test vgmerge command options for validity' 1386d7f5d3SJohn Marino 1486d7f5d3SJohn Marino. ./test-utils.sh 1586d7f5d3SJohn Marino 1686d7f5d3SJohn Marinoaux prepare_pvs 4 1786d7f5d3SJohn Marino 1886d7f5d3SJohn Marino# 'vgmerge normal operation' 1986d7f5d3SJohn Marino# ensure ordering does not matter 2086d7f5d3SJohn Marinovgcreate $vg1 $dev1 $dev2 2186d7f5d3SJohn Marinovgcreate $vg2 $dev3 $dev4 2286d7f5d3SJohn Marinovgmerge $vg1 $vg2 2386d7f5d3SJohn Marinovgremove $vg1 2486d7f5d3SJohn Marinovgcreate $vg2 $dev1 $dev2 2586d7f5d3SJohn Marinovgcreate $vg1 $dev3 $dev4 2686d7f5d3SJohn Marinovgmerge $vg2 $vg1 2786d7f5d3SJohn Marinovgremove $vg2 2886d7f5d3SJohn Marino 2986d7f5d3SJohn Marino# 'vgmerge rejects duplicate vg name' 3086d7f5d3SJohn Marinovgcreate $vg1 $dev1 $dev2 3186d7f5d3SJohn Marinovgcreate $vg2 $dev3 $dev4 3286d7f5d3SJohn Marinonot vgmerge $vg1 $vg1 2>err 3386d7f5d3SJohn Marinogrep "^ Duplicate volume group name \"$vg1\"\$" err 3486d7f5d3SJohn Marinovgremove $vg2 3586d7f5d3SJohn Marinovgremove $vg1 3686d7f5d3SJohn Marino 3786d7f5d3SJohn Marino# 'vgmerge rejects vgs with incompatible extent_size' 3886d7f5d3SJohn Marinovgcreate --physicalextentsize 4M $vg1 $dev1 $dev2 3986d7f5d3SJohn Marinovgcreate --physicalextentsize 8M $vg2 $dev3 $dev4 4086d7f5d3SJohn Marinonot vgmerge $vg1 $vg2 2>err 4186d7f5d3SJohn Marinogrep "^ Extent sizes differ" err 4286d7f5d3SJohn Marinovgremove $vg2 4386d7f5d3SJohn Marinovgremove $vg1 4486d7f5d3SJohn Marino 4586d7f5d3SJohn Marino# 'vgmerge rejects vgmerge because max_pv is exceeded' 4686d7f5d3SJohn Marinovgcreate --maxphysicalvolumes 2 $vg1 $dev1 $dev2 4786d7f5d3SJohn Marinovgcreate --maxphysicalvolumes 2 $vg2 $dev3 $dev4 4886d7f5d3SJohn Marinonot vgmerge $vg1 $vg2 2>err 4986d7f5d3SJohn Marinogrep "^ Maximum number of physical volumes (2) exceeded" err 5086d7f5d3SJohn Marinovgremove $vg2 5186d7f5d3SJohn Marinovgremove $vg1 5286d7f5d3SJohn Marino 5386d7f5d3SJohn Marino# 'vgmerge rejects vg with active lv' 5486d7f5d3SJohn Marinovgcreate $vg1 $dev1 $dev2 5586d7f5d3SJohn Marinovgcreate $vg2 $dev3 $dev4 5686d7f5d3SJohn Marinolvcreate -l 4 -n lv1 $vg2 5786d7f5d3SJohn Marinonot vgmerge $vg1 $vg2 2>err 5886d7f5d3SJohn Marinogrep "^ Logical volumes in \"$vg2\" must be inactive\$" err 5986d7f5d3SJohn Marinovgremove -f $vg2 6086d7f5d3SJohn Marinovgremove -f $vg1 6186d7f5d3SJohn Marino 6286d7f5d3SJohn Marino# 'vgmerge rejects vgmerge because max_lv is exceeded' 6386d7f5d3SJohn Marinovgcreate --maxlogicalvolumes 2 $vg1 $dev1 $dev2 6486d7f5d3SJohn Marinovgcreate --maxlogicalvolumes 2 $vg2 $dev3 $dev4 6586d7f5d3SJohn Marinolvcreate -l 4 -n lv1 $vg1 6686d7f5d3SJohn Marinolvcreate -l 4 -n lv2 $vg1 6786d7f5d3SJohn Marinolvcreate -l 4 -n lv3 $vg2 6886d7f5d3SJohn Marinovgchange -an $vg1 6986d7f5d3SJohn Marinovgchange -an $vg2 7086d7f5d3SJohn Marinonot vgmerge $vg1 $vg2 2>err 7186d7f5d3SJohn Marinogrep "^ Maximum number of logical volumes (2) exceeded" err 7286d7f5d3SJohn Marinovgremove -f $vg2 7386d7f5d3SJohn Marinovgremove -f $vg1 7486d7f5d3SJohn Marino 75