diff options
Diffstat (limited to 'test/shell/lvcreate-thin-snap.sh')
-rw-r--r-- | test/shell/lvcreate-thin-snap.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test/shell/lvcreate-thin-snap.sh b/test/shell/lvcreate-thin-snap.sh new file mode 100644 index 0000000..23f91f9 --- /dev/null +++ b/test/shell/lvcreate-thin-snap.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +# Copyright (C) 2012 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 + +. lib/test + +check_lv_field_modules_() +{ + mod=$1 + shift + + for d in $*; do + check lv_field $vg/$d modules $mod + done +} + + +# +# Main +# +aux have_thin 1 0 0 || skip + +aux prepare_pvs 2 64 + +vgcreate $vg -s 64K $(cat DEVICES) + +lvcreate -L10M -V10M -T $vg/pool --name $lv1 +mkfs.ext4 $DM_DEV_DIR/$vg/$lv1 +# create thin snapshot of thin LV +lvcreate -s $vg/$lv1 +# check snapshot filesystem was properly frozen before snapping +fsck -p $DM_DEV_DIR/$vg/lvol0 +lvcreate -s $vg/$lv1 --name $lv2 +lvcreate -s $vg/$lv1 --name $vg/$lv3 +lvcreate --type snapshot $vg/$lv1 +lvcreate --type snapshot $vg/$lv1 --name $lv4 +lvcreate --type snapshot $vg/$lv1 --name $vg/$lv5 + +# create old-style snapshot +lvcreate -s -L10M --name oldsnap1 $vg/$lv2 +lvcreate -s -L10M --name oldsnap2 $vg/$lv2 + +# thin snap of snap of snap... +lvcreate -s --name sn1 $vg/$lv2 +lvcreate -s --name sn2 $vg/sn1 +lvcreate -s --name sn3 $vg/sn2 +lvcreate -s --name sn4 $vg/sn3 + +vgremove -ff $vg |