summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2015-10-30 10:02:00 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2015-10-30 10:02:00 +0100
commit9a3b64e81ad1988f4143b5a4b4ac06eaf3035e58 (patch)
tree254fd74b9cafb6eb5a419b3b1973582af20bafe9
parentc2e88d1107c496d2c1b39bbbfb9795e88b3a6b60 (diff)
downloadlvm2-9a3b64e81ad1988f4143b5a4b4ac06eaf3035e58.tar.gz
tests: add test for minimum mda size
-rw-r--r--test/shell/pvcreate-usage.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/shell/pvcreate-usage.sh b/test/shell/pvcreate-usage.sh
index 5b74ed3d3..c6aab26d0 100644
--- a/test/shell/pvcreate-usage.sh
+++ b/test/shell/pvcreate-usage.sh
@@ -12,6 +12,8 @@
test_description='Test pvcreate option values'
SKIP_WITH_LVMPOLLD=1
PAGESIZE=$(getconf PAGESIZE)
+# MDA_SIZE_MIN defined in lib/format_text/layout.h
+MDA_SIZE_MIN=$((8*$PAGESIZE))
. lib/inittest
@@ -23,6 +25,13 @@ not pvcreate --setphysicalvolumesize -1024 "$dev1"
#COMM 'pvcreate rejects negative metadatasize'
not pvcreate --metadatasize -1024 "$dev1"
+#COMM 'pvcreate rejects metadatasize that is less than minimum size'
+not pvcreate --dataalignment $((${MDA_SIZE_MIN}/2))b --metadatasize $((${MDA_SIZE_MIN}/2))b "$dev1" 2>err
+grep "Metadata area size too small" err
+
+#COMM 'pvcreate accepts metadatasize that is at least the minimum size'
+pvcreate --dataalignment ${MDA_SIZE_MIN}b --metadatasize ${MDA_SIZE_MIN}b "$dev1"
+
# x. metadatasize 0, defaults to 255
# FIXME: unable to check default value, not in reporting cmds
# should default to 255 according to code