Skip to contentSkip to conversation

master - test: more thin tests

PATCH Zdenek Kabelac 1 participant 1 message Oct 9, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=439989adab473b2fa867b1e492b205084471051a
Commit:        439989adab473b2fa867b1e492b205084471051a
Parent:        d7b3179669dd82de7dab88309a9234d4cdbc6554
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Oct 9 16:32:11 2012 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Oct 9 16:38:42 2012 +0200

test: more thin tests

---
 test/shell/discards-thin.sh      |   56 +++++++++++++++++++++++++++++++++
 test/shell/lvconvert-thin.sh     |   49 +++++++++++++++++++++++++++++
 test/shell/lvcreate-thin-snap.sh |   63 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 168 insertions(+), 0 deletions(-)
test/shell/discards-thin.sh new file +56 -0
new file mode 100644
index 0000000..28300d9
@@ -0,0 +1,56 @@
+#!/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
+#
+# test support of thin discards
+#
+
+. lib/test
+
+#
+# Main
+#
+aux target_at_least dm-thin-pool 1 1 0 || skip
+
+aux prepare_pvs 2 64
+
+# disable thin_check if not present in system
+which thin_check || aux lvmconf 'global/thin_check_executable = ""'
+
+clustered=
+test -e LOCAL_CLVMD && clustered="--clustered y"
+
+vgcreate $clustered $vg -s 64K $(cat DEVICES)
+
+# Create named pool only
+lvcreate -l1 --discards ignore -T $vg/pool
+check lv_field $vg/pool discards "ignore"
+lvcreate -l1 --discards nopassdown -T $vg/pool1
+check lv_field $vg/pool1 discards "nopassdown"
+lvcreate -l1 --discards passdown -T $vg/pool2
+check lv_field $vg/pool2 discards "passdown"
+
+lvchange --discards nopassdown $vg/pool2
+
+# cannot convert active  ignore -> passdown
+not lvchange --discards passdown $vg/pool
+
+# cannot convert active  nopassdown -> ignore
+not lvchange --discards ignore $vg/pool1
+
+# deactivate
+lvchange -an $vg/pool $vg/pool1
+lvchange --discards passdown $vg/pool
+check lv_field $vg/pool discards "passdown"
+lvchange --discards ignore $vg/pool1
+check lv_field $vg/pool1 discards "ignore"
+
+vgremove -ff $vg
test/shell/lvconvert-thin.sh new file +49 -0

49 lines not on this page · raw message

test/shell/lvcreate-thin-snap.sh new file +63 -0

63 lines not on this page · raw message