The tests exercises the fsadm "add" functionality, by trying various combinations of arguments and checking the desired results. Signed-off-by: Lukas Czerner <lczerner@redhat.com> --- test/t-fsadm-add.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) create mode 100644 test/t-fsadm-add.sh diff --git a/test/t-fsadm-add.sh b/test/t-fsadm-add.sh new file mode 100644 index 0000000..c2d310e --- /dev/null +++ b/test/t-fsadm-add.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright (C) 2008-2010 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_description='Exercise fsadm add' + +. lib/test + +DEV_COUNT=10 +aux prepare_devs $DEV_COUNT 10 +TEST_DEVS=$(cat DEVICES) +export DEFAULT_POOL=$vg1 + +pool1=$vg2 +pool2=$vg3 + +# Create default pool with all devices at once +fsadm add $TEST_DEVS +check vg_field $DEFAULT_POOL pv_count $DEV_COUNT +fsadm -f remove $DEFAULT_POOL + +# Create default pool by adding devices one per a call +for i in $TEST_DEVS; do + fsadm add $i +done +check vg_field $DEFAULT_POOL pv_count $DEV_COUNT +fsadm -f remove $DEFAULT_POOL + +# Create different groups from different devices +fsadm add $dev1 $dev2 $dev3 $pool1 +fsadm add $dev4 $dev5 $dev6 +fsadm add $dev7 $dev8 $dev9 $pool2 +fsadm add $dev10 $pool2 +check vg_field $DEFAULT_POOL pv_count 3 +check vg_field $pool1 pv_count 3 +check vg_field $pool2 pv_count 4 + +# Simple remove check +fsadm -f remove $pool1 $pool2 +check vg_field $pool3 pv_count 4 +fsadm -f remove $pool3 -- 1.7.4.4 _______________________________________________ linux-lvm mailing list linux-lvm@redhat.com https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/