From 9a3b64e81ad1988f4143b5a4b4ac06eaf3035e58 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Fri, 30 Oct 2015 10:02:00 +0100 Subject: [PATCH] tests: add test for minimum mda size --- test/shell/pvcreate-usage.sh | 9 +++++++++ 1 file changed, 9 insertions(+) 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