Skip to contentSkip to conversation

master - test: lvm2api thin data_percent

PATCH Zdenek Kabelac 1 participant 1 message Oct 5, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7f4f7f70ce94e9692b84a3568aedfceb13466ece
Commit:        7f4f7f70ce94e9692b84a3568aedfceb13466ece
Parent:        39f3c9de0babbe54cecb4cee5b163bf72eab61f4
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Oct 5 10:33:41 2012 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Oct 5 10:37:41 2012 +0200

test: lvm2api thin data_percent

---
 test/api/Makefile.in     |   18 +++++++++++--
 test/api/thin_percent.c  |   60 ++++++++++++++++++++++++++++++++++++++++++++++
 test/api/thin_percent.sh |   37 ++++++++++++++++++++++++++++
 3 files changed, 112 insertions(+), 3 deletions(-)
test/api/Makefile.in +15 -3
index 58d0a23..7ad6743 100644
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009-2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2009-2012 Red Hat, Inc. All rights reserved.
 #
 # This file is part of LVM2.
 #
@@ -20,8 +20,20 @@ ifeq ("@APPLIB@", "yes")
 TARGETS += test
 SOURCES = test.c
 
-TARGETS += vgtest.t percent.t pe_start.t lvtest.t
-SOURCES2 = vgtest.c percent.c pe_start.c lvtest.c
+TARGETS += \
+	lvtest.t \
+	percent.t \
+	pe_start.t \
+	thin_percent.t \
+	vgtest.t
+
+SOURCES2 = \
+	lvtest.c \
+	percent.c \
+	pe_start.c \
+	thin_percent.c \
+	vgtest.c
+
 endif
 
 include $(top_builddir)/make.tmpl
test/api/thin_percent.c new file +60 -0

60 lines not on this page · raw message

test/api/thin_percent.sh new file +37 -0
new file mode 100644
index 0000000..bba33ba
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+#
+# This file is part of LVM2.
+#
+# 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
+
+aux target_at_least dm-thin-pool 1 0 0 || skip
+
+# disable thin_check if not present in system
+which thin_check || aux lvmconf 'global/thin_check_executable = ""'
+
+aux prepare_devs 2
+
+vgcreate -s 64k $vg $(cat DEVICES)
+
+lvcreate -L5M -T $vg/pool
+
+lvcreate -V1M -T $vg/pool -n thin
+dd if=/dev/urandom of="$DM_DEV_DIR/$vg/thin" count=2 bs=256K
+
+lvcreate -s $vg/thin -n snap
+dd if=/dev/urandom of="$DM_DEV_DIR/$vg/snap" count=3 bs=256K
+
+lvs $vg
+
+aux apitest thin_percent $vg
+
+vgremove -ff $vg