summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2019-06-05 15:46:43 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2019-06-05 15:48:44 +0200
commit4d9f41b11945df83b37b55439a44372b894a78f5 (patch)
tree5aed953c90043826b38fac9c09b26a6db8105f0d
parentddd68fbeadb42d5cc0fdae49e133524bab049f49 (diff)
downloadlvm2-4d9f41b11945df83b37b55439a44372b894a78f5.tar.gz
tests: check no_discard_passdown
Check reporting works
-rw-r--r--test/shell/cache-no-discard.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/shell/cache-no-discard.sh b/test/shell/cache-no-discard.sh
new file mode 100644
index 000000000..3ab059447
--- /dev/null
+++ b/test/shell/cache-no-discard.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2019 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Check reporting of no_discard_passdown
+
+SKIP_WITH_LVMPOLLD=1
+
+# Until new version of cache_check tools - no integrity validation
+LVM_TEST_CACHE_CHECK_CMD=""
+
+. lib/inittest
+
+aux kernel_at_least 5 1 || skip
+
+aux have_cache 2 0
+
+aux prepare_vg 1
+
+# Create thinLV without discard
+lvcreate --discards=ignore -T -V20 -L20 -n $lv $vg/pool
+
+aux extend_filter_LVMTEST
+
+# Use discard-less LV as PV for $vg1
+pvcreate "$DM_DEV_DIR/$vg/$lv"
+vgcreate -s 128K $vg1 "$DM_DEV_DIR/$vg/$lv"
+
+# Create simple cache LV
+lvcreate -L2 -n $lv1 $vg1
+lvcreate -H -L2 $vg1/$lv1
+
+#lvs -ao+kernel_discards $vg1
+check lv_field $vg1/$lv1 kernel_discards "nopassdown"
+
+vgremove -f $vg1
+vgremove -f $vg