diff options
Diffstat (limited to 'test/shell/lvcreate-small-snap.sh')
-rw-r--r-- | test/shell/lvcreate-small-snap.sh | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/test/shell/lvcreate-small-snap.sh b/test/shell/lvcreate-small-snap.sh index 9b43868..09237ec 100644 --- a/test/shell/lvcreate-small-snap.sh +++ b/test/shell/lvcreate-small-snap.sh @@ -1,5 +1,6 @@ -#!/bin/sh -# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +#!/usr/bin/env bash + +# Copyright (C) 2010-2014 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 @@ -7,24 +8,31 @@ # # 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 +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + -. lib/test +SKIP_WITH_LVMPOLLD=1 -aux prepare_pvs 3 +. lib/inittest -vgcreate -c n -s 1k $vg $(cat DEVICES) +aux prepare_pvs +get_devs -lvcreate -n one -l 10 $vg -lvcreate -s -l 8 -n snapA $vg/one -lvcreate -s -c 4k -l 8 -n snapX1 $vg/one -lvcreate -s -c 8k -l 16 -n snapX2 $vg/one +vgcreate $SHARED -s 4k "$vg" "${DEVICES[@]}" + +# 3 Chunks +lvcreate -aey -n one -l 10 $vg +lvcreate -s -l 3 -n snapA $vg/one +lvcreate -s -c 4k -l 3 -n snapX1 $vg/one +lvcreate -s -c 8k -l 6 -n snapX2 $vg/one # Check that snapshots that are too small are caught with correct error. -not lvcreate -s -c 8k -l 8 -n snapX3 $vg/one 2>&1 | tee lvcreate.out +not lvcreate -s -c 8k -l 2 -n snapX3 $vg/one 2>&1 | tee lvcreate.out not grep "suspend origin one" lvcreate.out -grep "Unable to create a snapshot" lvcreate.out +grep "smaller" lvcreate.out -not lvcreate -s -l 4 -n snapB $vg/one 2>&1 | tee lvcreate.out +not lvcreate -s -l 1 -n snapB $vg/one 2>&1 | tee lvcreate.out not grep "suspend origin one" lvcreate.out -grep "Unable to create a snapshot" lvcreate.out +grep "smaller" lvcreate.out + +vgremove -ff $vg |