From fb0bbf08b591eed394028b2bcc42089d7a81f77c Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Thu, 18 Jul 2013 19:14:12 -0400 Subject: [PATCH] test: add shell/thin-snapshot-merge.sh --- test/shell/thin-snapshot-merge.sh | 43 +++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 test/shell/thin-snapshot-merge.sh diff --git a/test/shell/thin-snapshot-merge.sh b/test/shell/thin-snapshot-merge.sh new file mode 100644 index 0000000..1df9924 --- /dev/null +++ b/test/shell/thin-snapshot-merge.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2013 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 + +which mkfs.ext3 || skip + +aux have_thin 1 0 0 || skip + +aux prepare_pvs 2 64 + +vgcreate $vg -s 64K $(cat DEVICES) + +mkdir test_mnt + +lvcreate -L4M -T $vg/pool +lvcreate -V16M --name lvol0 -T $vg/pool + +# test the basic merge of a thin snapshot +# - format snapshot, mount it, then merge it into unformatted origin, mount origin +lvcreate -K -s $vg/lvol0 --name snap0 + +mkfs.ext3 $DM_DEV_DIR/$vg/snap0 +mount $DM_DEV_DIR/$vg/snap0 test_mnt +umount test_mnt + +not mount $DM_DEV_DIR/$vg/lvol0 test_mnt +lvconvert --merge $vg/snap0 +mount $DM_DEV_DIR/$vg/lvol0 test_mnt +umount test_mnt + +vgremove -ff $vg + +# FIXME: add more tests -- 1.7.1