diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/00createnames | 3 | ||||
-rw-r--r-- | tests/templates/names_template | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/00createnames b/tests/00createnames index 064eeef2..a95e7d2b 100644 --- a/tests/00createnames +++ b/tests/00createnames @@ -39,3 +39,6 @@ mdadm -S "/dev/md0" names_create "/dev/md0" "name" names_verify "/dev/md0" "empty" "name" mdadm -S "/dev/md0" + +# Devnode is a special ignore keyword. Should be rejected. +names_create "<ignore>" "name", "true" diff --git a/tests/templates/names_template b/tests/templates/names_template index 8d2b5c81..6181bfaa 100644 --- a/tests/templates/names_template +++ b/tests/templates/names_template @@ -2,6 +2,7 @@ function names_create() { local DEVNAME=$1 local NAME=$2 + local NEG_TEST=$3 if [[ -z "$NAME" ]]; then mdadm -CR "$DEVNAME" -l0 -n 1 $dev0 --force @@ -9,6 +10,12 @@ function names_create() { mdadm -CR "$DEVNAME" --name="$NAME" --metadata=1.2 -l0 -n 1 $dev0 --force fi + if [[ "$NEG_TEST" == "true" ]]; then + [[ "$?" == "0" ]] && return 0 + echo "Negative verification failed" + exit 1 + fi + if [[ "$?" != "0" ]]; then echo "Cannot create device." exit 1 |