From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10513 invoked by alias); 23 Mar 2008 15:40:36 -0000 Received: (qmail 10497 invoked by uid 9657); 23 Mar 2008 15:40:36 -0000 Date: Sun, 23 Mar 2008 15:40:00 -0000 Message-ID: <20080323154036.10495.qmail@sourceware.org> From: wysochanski@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/test lvm-utils.sh t-vgsplit-usage.sh Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00014.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2008-03-23 15:40:35 Modified files: test : lvm-utils.sh t-vgsplit-usage.sh Log message: Add vgsplit tests to verfy attributes of new VG match source VG. Author: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lvm-utils.sh.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgsplit-usage.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/test/lvm-utils.sh 2008/01/17 18:05:57 1.7 +++ LVM2/test/lvm-utils.sh 2008/03/23 15:40:35 1.8 @@ -50,6 +50,15 @@ return 0; } +compare_vg_field_() +{ +if test "$verbose" = "t" +then + echo "compare_vg_field_ VG1: `vgs --noheadings -o $3 $1` VG2: `vgs --noheadings -o $3 $2`" +fi + return $(test $(vgs --noheadings -o $3 $1) == $(vgs --noheadings -o $3 $2) ) +} + check_vg_field_() { if test "$verbose" = "t" --- LVM2/test/t-vgsplit-usage.sh 2008/03/21 22:00:29 1.2 +++ LVM2/test/t-vgsplit-usage.sh 2008/03/23 15:40:35 1.3 @@ -164,6 +164,36 @@ vgremove -f $vg1' test_expect_success \ + 'verify default - max_lv attribute from new VG is same as source VG' \ + 'vgcreate $vg1 $d1 $d2 && + lvcreate -l 4 -n $lv1 $vg1 && + vgchange -an $vg1 && + vgsplit $vg1 $vg2 $d1 && + compare_vg_field_ $vg1 $vg2 max_lv && + vgremove -f $vg2 && + vgremove -f $vg1' + +test_expect_success \ + 'verify default - max_pv attribute from new VG is same as source VG' \ + 'vgcreate $vg1 $d1 $d2 && + lvcreate -l 4 -n $lv1 $vg1 && + vgchange -an $vg1 && + vgsplit $vg1 $vg2 $d1 && + compare_vg_field_ $vg1 $vg2 max_pv && + vgremove -f $vg2 && + vgremove -f $vg1' + +test_expect_success \ + 'verify default - vg_fmt attribute from new VG is same as source VG' \ + 'vgcreate $vg1 $d1 $d2 && + lvcreate -l 4 -n $lv1 $vg1 && + vgchange -an $vg1 && + vgsplit $vg1 $vg2 $d1 && + compare_vg_field_ $vg1 $vg2 vg_fmt && + vgremove -f $vg2 && + vgremove -f $vg1' + +test_expect_success \ 'vgsplit rejects split because PV not in VG' \ 'vgcreate $vg1 $d1 $d2 && vgcreate $vg2 $d3 $d4 &&