diff options
author | NeilBrown <neilb@suse.de> | 2011-02-01 14:43:59 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-02-01 14:43:59 +1100 |
commit | 3cdcfda4b0d0f1cd94ab1d7e287765c82f15d4e4 (patch) | |
tree | 13f4938f23efb8ea5f3d316d5b74b258bfddffac | |
parent | e5e5d7cea390fd33d6be09ee6d8a47bc7695eb50 (diff) | |
download | mdadm-3cdcfda4b0d0f1cd94ab1d7e287765c82f15d4e4.tar.gz |
test: remove all the environment handling.
Instead, just include the environ explicitly in the test file
or, where shared, source the shared file.
Signed-off-by: NeilBrown <neilb@suse.de>
84 files changed, 248 insertions, 288 deletions
@@ -197,21 +197,6 @@ rotest() { fsck -fn $dev >&2 } -setup_environment() { - if [ -f $1 ]; then - . $environment - setup_env - fi -} - -reset_environment() { - if [ -f $1 ]; then - reset_env - unset setup_env - unset reset_env - fi -} - for script in tests/$prefix tests/$prefix*[^~] do if [ -f "$script" ] @@ -221,18 +206,14 @@ do $mdadm -Ssq 2> /dev/null mdadm --zero $devlist 2> /dev/null mdadm --zero $devlist 2> /dev/null - environment="tests/env-`basename $script`" - setup_environment $environment # source script in a subshell, so it has access to our # namespace, but cannot change it. echo -ne "$script... " if ( set -ex ; . $script ) 2> $targetdir/log then echo "succeeded" else echo "FAILED" - reset_environment $environment exit 1 fi - reset_environment $environment fi done exit 0 diff --git a/tests/08imsm-overlap b/tests/08imsm-overlap index 1a071ef..30abd64 100644 --- a/tests/08imsm-overlap +++ b/tests/08imsm-overlap @@ -1,3 +1,59 @@ +imsm_check() { + case $1 in + container ) + grep -s "$(((418 * $2)/2)) blocks super external:imsm" /proc/mdstat > /dev/null || { + echo >&2 "ERROR correctly formed container not found"; cat /proc/mdstat; exit 1;} + ;; + member ) + member=$2 + num_disks=$3 + level=$4 + size=$5 + offset=$6 + err=0 + + eval `stat -L -c "let major=0x%t; let minor=0x%T;" $member` + sysfs=/sys/dev/block/${major}:${minor} + if [ ! -f ${sysfs}/md/array_state ]; then + echo "member array $member not found" >&2 + cat /proc/mdstat >&2 + exit 1 + fi + for i in `seq 0 $((num_disks-1))` + do + _offset=`cat ${sysfs}/md/rd${i}/offset` + if [ $offset -ne $((_offset/2)) ]; then + echo "offset mismatch expected $offset got $_offset" >&2 + err=$((err+1)) + fi + _size=`cat ${sysfs}/md/rd${i}/size` + if [ $size -ne $_size ]; then + echo "offset mismatch expected $size got $_size" >&2 + err=$((err+1)) + fi + done + + if [ $err -gt 0 ]; then + echo "$member failed check" >&2 + cat /proc/mdstat >&2 + mdadm -E /dev/loop0 >&2 + exit 1 + fi + ;; + * ) echo >&2 ERROR unknown check $1 ; exit 1; + esac +} + +export IMSM_DEVNAME_AS_SERIAL=1 +export IMSM_NO_PLATFORM=1 +container=/dev/md/container +member0=/dev/md/vol0 +member1=/dev/md/vol1 +member2=/dev/md/vol2 +member3=/dev/md/vol3 +member4=/dev/md/vol4 + + # create raid arrays with varying degress of overlap mdadm -CR $container -e imsm -n 6 $dev0 $dev1 $dev2 $dev3 $dev4 $dev5 imsm_check container 6 diff --git a/tests/09imsm-assemble b/tests/09imsm-assemble index 46e15bc..2b62e02 100644 --- a/tests/09imsm-assemble +++ b/tests/09imsm-assemble @@ -1,5 +1,31 @@ # validate the prodigal member disk scenario i.e. a former container # member is returned after having been rebuilt on another system + + +imsm_check_hold() { + if mdadm --remove $1 $2; then + echo "$2 removal from $1 should have been blocked" >&2 + cat /proc/mdstat >&2 + mdadm -E $2 + exit 1 + fi +} + +imsm_check_removal() { + if ! mdadm --remove $1 $2 ; then + echo "$2 removal from $1 should have succeeded" >&2 + cat /proc/mdstat >&2 + mdadm -E $2 + exit 1 + fi +} + +export IMSM_DEVNAME_AS_SERIAL=1 +export IMSM_TEST_OROM=1 +container=/dev/md/container +member=/dev/md/vol0 + + num_disks=4 size=$((10*1024)) mdadm -CR $container -e imsm -n $num_disks $dev0 $dev1 $dev2 $dev3 diff --git a/tests/09imsm-create-fail-rebuild b/tests/09imsm-create-fail-rebuild index 68fdd09..d96496e 100644 --- a/tests/09imsm-create-fail-rebuild +++ b/tests/09imsm-create-fail-rebuild @@ -1,5 +1,90 @@ # sanity check array creation +imsm_check_hold() { + if mdadm --remove $1 $2; then + echo "$2 removal from $1 should have been blocked" >&2 + cat /proc/mdstat >&2 + mdadm -E $2 + exit 1 + fi +} + +imsm_check_removal() { + if ! mdadm --remove $1 $2 ; then + echo "$2 removal from $1 should have succeeded" >&2 + cat /proc/mdstat >&2 + mdadm -E $2 + exit 1 + fi +} + +imsm_check() { + udevadm settle + case $1 in + container ) + grep -s "$(((418 * $2)/2)) blocks super external:imsm" /proc/mdstat > /dev/null || { + echo >&2 "ERROR correctly formed container not found"; cat /proc/mdstat; exit 1;} + ;; + member ) + member=$2 + num_disks=$3 + level=$4 + size=$5 + offset=$6 + chunk=$7 + err=0 + + if [ $level -ne 1 ]; then + size=$((size & ~(chunk - 1))) + else + chunk=64 + fi + eval `stat -L -c "let major=0x%t; let minor=0x%T;" $member` + sysfs=/sys/dev/block/${major}:${minor} + if [ ! -f ${sysfs}/md/array_state ]; then + echo "member array $member not found" >&2 + cat /proc/mdstat >&2 + exit 1 + fi + _chunk=`cat ${sysfs}/md/chunk_size` + if [ $chunk -ne $((_chunk/1024)) ]; then + echo "chunk mismatch expected $chunk got $_chunk" >&2 + err=$((err+1)) + fi + for i in `seq 0 $((num_disks-1))` + do + _offset=`cat ${sysfs}/md/rd${i}/offset` + if [ $offset -ne $((_offset/2)) ]; then + echo "offset mismatch expected $offset got $_offset" >&2 + err=$((err+1)) + fi + _size=`cat ${sysfs}/md/rd${i}/size` + if [ $size -ne $_size ]; then + echo "size mismatch expected $size got $_size" >&2 + err=$((err+1)) + fi + done + + if [ $err -gt 0 ]; then + echo "$member failed check" >&2 + cat /proc/mdstat >&2 + mdadm -E /dev/loop0 >&2 + exit 1 + fi + ;; + * ) echo >&2 ERROR unknown check $1 ; exit 1; + esac +} + +export IMSM_DEVNAME_AS_SERIAL=1 +export IMSM_TEST_OROM=1 +container=/dev/md/container +member0=/dev/md/vol0 +member1=/dev/md/vol1 +member2=/dev/md/vol2 +member3=/dev/md/vol3 +member4=/dev/md/vol4 + # IMSM rounds to multiples of one mebibyte - 1024K DEV_ROUND_K=1024 diff --git a/tests/11spare-migration b/tests/11spare-migration index 01693e4..c8ef362 100644 --- a/tests/11spare-migration +++ b/tests/11spare-migration @@ -3,6 +3,10 @@ # above number 7 bigger again by any amount (this is not changed for now as it # could affect other tests) +export IMSM_DEVNAME_AS_SERIAL=1 +export IMSM_TEST_OROM=1 +export IMSM_NO_PLATFORM=1 + . tests/utils set -ex verbose="yes" diff --git a/tests/12imsm-r0_2d-grow-r0_3d b/tests/12imsm-r0_2d-grow-r0_3d index 7f3d38f..3c6cf74 100644 --- a/tests/12imsm-r0_2d-grow-r0_3d +++ b/tests/12imsm-r0_2d-grow-r0_3d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume, 2 disks grow to RAID 0 volume, 3 disks # POSITIVE test diff --git a/tests/12imsm-r0_2d-grow-r0_4d b/tests/12imsm-r0_2d-grow-r0_4d index de76920..e4fccda 100644 --- a/tests/12imsm-r0_2d-grow-r0_4d +++ b/tests/12imsm-r0_2d-grow-r0_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume, 2 disks grow to RAID 0 volume, 4 disks # POSITIVE test diff --git a/tests/12imsm-r0_2d-grow-r0_5d b/tests/12imsm-r0_2d-grow-r0_5d index ffa4cc1..388a5bb 100644 --- a/tests/12imsm-r0_2d-grow-r0_5d +++ b/tests/12imsm-r0_2d-grow-r0_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume, 2 disks grow to RAID 0 volume, 5 disks # POSITIVE test diff --git a/tests/12imsm-r0_3d-grow-r0_4d b/tests/12imsm-r0_3d-grow-r0_4d index d1fa584..7065f07 100644 --- a/tests/12imsm-r0_3d-grow-r0_4d +++ b/tests/12imsm-r0_3d-grow-r0_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume, 3 disks grow to RAID 0 volume, 4 disks # POSITIVE test diff --git a/tests/12imsm-r5_3d-grow-r5_4d b/tests/12imsm-r5_3d-grow-r5_4d index a87ef8c..097da0a 100644 --- a/tests/12imsm-r5_3d-grow-r5_4d +++ b/tests/12imsm-r5_3d-grow-r5_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume, 3 disks grow to RAID 5 volume, 4 disks # POSITIVE test diff --git a/tests/12imsm-r5_3d-grow-r5_5d b/tests/12imsm-r5_3d-grow-r5_5d index 2fa3711..2e5c7d2 100644 --- a/tests/12imsm-r5_3d-grow-r5_5d +++ b/tests/12imsm-r5_3d-grow-r5_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume, 3 disks grow to RAID 5 volume, 5 disks # POSITIVE test diff --git a/tests/13imsm-r0_r0_2d-grow-r0_r0_4d b/tests/13imsm-r0_r0_2d-grow-r0_r0_4d index 9b6256b..f85efa5 100644 --- a/tests/13imsm-r0_r0_2d-grow-r0_r0_4d +++ b/tests/13imsm-r0_r0_2d-grow-r0_r0_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow the container (arrays inside) from 2 disks to 4 disks # POSITIVE test diff --git a/tests/13imsm-r0_r0_2d-grow-r0_r0_5d b/tests/13imsm-r0_r0_2d-grow-r0_r0_5d index 05364f5..80e0cf0 100644 --- a/tests/13imsm-r0_r0_2d-grow-r0_r0_5d +++ b/tests/13imsm-r0_r0_2d-grow-r0_r0_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow both members from 2 disks to 5 disks # POSITIVE test diff --git a/tests/13imsm-r0_r0_3d-grow-r0_r0_4d b/tests/13imsm-r0_r0_3d-grow-r0_r0_4d index 26b69f1..17f24d7 100644 --- a/tests/13imsm-r0_r0_3d-grow-r0_r0_4d +++ b/tests/13imsm-r0_r0_3d-grow-r0_r0_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow a container (arrays inside) from 3 disks to 4 disks # POSITIVE test diff --git a/tests/13imsm-r0_r5_3d-grow-r0_r5_4d b/tests/13imsm-r0_r5_3d-grow-r0_r5_4d index e2ce5d0..b4bde44 100644 --- a/tests/13imsm-r0_r5_3d-grow-r0_r5_4d +++ b/tests/13imsm-r0_r5_3d-grow-r0_r5_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow the container (arrays inside) from 3 disks to 4 disks # POSITIVE test diff --git a/tests/13imsm-r0_r5_3d-grow-r0_r5_5d b/tests/13imsm-r0_r5_3d-grow-r0_r5_5d index 47d3f37..6462d6b 100644 --- a/tests/13imsm-r0_r5_3d-grow-r0_r5_5d +++ b/tests/13imsm-r0_r5_3d-grow-r0_r5_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow the container (arrays inside) from 3 disks to 5 disks # POSITIVE test diff --git a/tests/13imsm-r5_r0_3d-grow-r5_r0_4d b/tests/13imsm-r5_r0_3d-grow-r5_r0_4d index 79115a3..32ebc92 100644 --- a/tests/13imsm-r5_r0_3d-grow-r5_r0_4d +++ b/tests/13imsm-r5_r0_3d-grow-r5_r0_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow the container (arrays inside) from 3 disks to 4 disks # POSITIVE test diff --git a/tests/13imsm-r5_r0_3d-grow-r5_r0_5d b/tests/13imsm-r5_r0_3d-grow-r5_r0_5d index 990c828..a97002d 100644 --- a/tests/13imsm-r5_r0_3d-grow-r5_r0_5d +++ b/tests/13imsm-r5_r0_3d-grow-r5_r0_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Grow the container (arrays inside) from 3 disks to 5 disks # POSITIVE test diff --git a/tests/14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d b/tests/14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d index 378d343..386abee 100644 --- a/tests/14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d +++ b/tests/14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 and RAID 5 volumes (3 disks) migrate to RAID 5 and RAID 5 volumes (4 disks) # NEGATIVE test - migration is not allowed if there is more then one array in a container diff --git a/tests/14imsm-r0_3d_no_spares-migrate-r5_3d b/tests/14imsm-r0_3d_no_spares-migrate-r5_3d index 44b3f42..10bbab6 100644 --- a/tests/14imsm-r0_3d_no_spares-migrate-r5_3d +++ b/tests/14imsm-r0_3d_no_spares-migrate-r5_3d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume (3 disks, no spares) migrate to RAID 5 volume (3 disks) # NEGATIVE test diff --git a/tests/14imsm-r0_r0_2d-takeover-r10_4d b/tests/14imsm-r0_r0_2d-takeover-r10_4d index da1a892..89d63a6 100644 --- a/tests/14imsm-r0_r0_2d-takeover-r10_4d +++ b/tests/14imsm-r0_r0_2d-takeover-r10_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Two RAID 0 volumes (2 disks) migrate to RAID 10 volume (4 disks) # NEGATIVE test diff --git a/tests/14imsm-r10_4d-grow-r10_5d b/tests/14imsm-r10_4d-grow-r10_5d index efffb9a..bcbe147 100644 --- a/tests/14imsm-r10_4d-grow-r10_5d +++ b/tests/14imsm-r10_4d-grow-r10_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 10 volume, 4 disks grow to RAID 10 volume, 5 disks # NEGATIVE test diff --git a/tests/14imsm-r10_r5_4d-takeover-r0_2d b/tests/14imsm-r10_r5_4d-takeover-r0_2d index b0a8331..9e5205e 100644 --- a/tests/14imsm-r10_r5_4d-takeover-r0_2d +++ b/tests/14imsm-r10_r5_4d-takeover-r0_2d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Two RAID volumes: RAID10 and RAID5 (4 disks) migrate to RAID 0 volume (2 disks) # NEGATIVE test diff --git a/tests/14imsm-r1_2d-grow-r1_3d b/tests/14imsm-r1_2d-grow-r1_3d index d0d51eb..1edd50e 100644 --- a/tests/14imsm-r1_2d-grow-r1_3d +++ b/tests/14imsm-r1_2d-grow-r1_3d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 1 volume, 2 disks grow to RAID 1 volume, 3 disks # NEGATIVE test diff --git a/tests/14imsm-r1_2d-takeover-r0_2d b/tests/14imsm-r1_2d-takeover-r0_2d index 7f57ebf..d829681 100644 --- a/tests/14imsm-r1_2d-takeover-r0_2d +++ b/tests/14imsm-r1_2d-takeover-r0_2d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 1 volume, 2 disks change to RAID 0 volume, 2 disks # #NEGATIVE test diff --git a/tests/14imsm-r5_3d-grow-r5_5d-no-spares b/tests/14imsm-r5_3d-grow-r5_5d-no-spares index ff3cd59..ed18e72 100644 --- a/tests/14imsm-r5_3d-grow-r5_5d-no-spares +++ b/tests/14imsm-r5_3d-grow-r5_5d-no-spares @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume, 3 disks grow to RAID 5 volume, 4 disks # NEGATIVE test diff --git a/tests/14imsm-r5_3d-migrate-r4_3d b/tests/14imsm-r5_3d-migrate-r4_3d index 506772e..e3b971c 100644 --- a/tests/14imsm-r5_3d-migrate-r4_3d +++ b/tests/14imsm-r5_3d-migrate-r4_3d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume (3 disks) migrate to RAID 4 volume (3 disks) # NEGATIVE test diff --git a/tests/15imsm-r0_3d_64k-migrate-r0_3d_256k b/tests/15imsm-r0_3d_64k-migrate-r0_3d_256k index 03b19ff..be59e3d 100644 --- a/tests/15imsm-r0_3d_64k-migrate-r0_3d_256k +++ b/tests/15imsm-r0_3d_64k-migrate-r0_3d_256k @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume, Migration from 64k to 256k chunk size. # POSITIVE test diff --git a/tests/15imsm-r5_3d_4k-migrate-r5_3d_256k b/tests/15imsm-r5_3d_4k-migrate-r5_3d_256k index 14106e0..025e9ef 100644 --- a/tests/15imsm-r5_3d_4k-migrate-r5_3d_256k +++ b/tests/15imsm-r5_3d_4k-migrate-r5_3d_256k @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume, Migration from 4k to 256 chunk size. # POSITIVE test diff --git a/tests/15imsm-r5_3d_64k-migrate-r5_3d_256k b/tests/15imsm-r5_3d_64k-migrate-r5_3d_256k index 9c447a5..37547b7 100644 --- a/tests/15imsm-r5_3d_64k-migrate-r5_3d_256k +++ b/tests/15imsm-r5_3d_64k-migrate-r5_3d_256k @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume, Migration from 64k to 256k chunk size. # POSITIVE test diff --git a/tests/15imsm-r5_6d_4k-migrate-r5_6d_256k b/tests/15imsm-r5_6d_4k-migrate-r5_6d_256k index baaa182..d2f6c70 100644 --- a/tests/15imsm-r5_6d_4k-migrate-r5_6d_256k +++ b/tests/15imsm-r5_6d_4k-migrate-r5_6d_256k @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume, Migration from 4k to 256k chunk size. # POSITIVE test diff --git a/tests/15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k b/tests/15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k index 5508036..da218ef 100644 --- a/tests/15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k +++ b/tests/15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Member 0: RAID 5 volume, Member 1: RAID 0 volume # Migration from 64k to 256k chunk size (both members) # POSITIVE test diff --git a/tests/16imsm-r0_3d-migrate-r5_4d b/tests/16imsm-r0_3d-migrate-r5_4d index cef4512..4f45479 100644 --- a/tests/16imsm-r0_3d-migrate-r5_4d +++ b/tests/16imsm-r0_3d-migrate-r5_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume (3 disks) migrate to RAID 5 volume (4 disks) # POSITIVE test diff --git a/tests/16imsm-r0_5d-migrate-r5_6d b/tests/16imsm-r0_5d-migrate-r5_6d index 1c83da1..bee505b 100644 --- a/tests/16imsm-r0_5d-migrate-r5_6d +++ b/tests/16imsm-r0_5d-migrate-r5_6d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume (5 disks) migrate to RAID 5 volume (6 disks) # POSITIVE test diff --git a/tests/16imsm-r5_3d-migrate-r0_3d b/tests/16imsm-r5_3d-migrate-r0_3d index 28ea863..5a83c41 100644 --- a/tests/16imsm-r5_3d-migrate-r0_3d +++ b/tests/16imsm-r5_3d-migrate-r0_3d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume (3 disks) migrate to RAID 0 volume (3 disks) # POSITIVE test diff --git a/tests/16imsm-r5_5d-migrate-r0_5d b/tests/16imsm-r5_5d-migrate-r0_5d index f035b74..ff5a2d8 100644 --- a/tests/16imsm-r5_5d-migrate-r0_5d +++ b/tests/16imsm-r5_5d-migrate-r0_5d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 5 volume (5 disks) migration to RAID 0 volume (5 disks) # POSITIVE test diff --git a/tests/18imsm-1d-takeover-r0_1d b/tests/18imsm-1d-takeover-r0_1d index 82401fc..bf462e2 100644 --- a/tests/18imsm-1d-takeover-r0_1d +++ b/tests/18imsm-1d-takeover-r0_1d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Create RAID 0 from a single disk. # POSITIVE test diff --git a/tests/18imsm-1d-takeover-r1_2d b/tests/18imsm-1d-takeover-r1_2d index e965cbd..fa02b6c 100644 --- a/tests/18imsm-1d-takeover-r1_2d +++ b/tests/18imsm-1d-takeover-r1_2d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # Create RAID 1 from a single disk # POSITIVE test diff --git a/tests/18imsm-r0_2d-takeover-r10_4d b/tests/18imsm-r0_2d-takeover-r10_4d index fd825d9..a1c395b 100644 --- a/tests/18imsm-r0_2d-takeover-r10_4d +++ b/tests/18imsm-r0_2d-takeover-r10_4d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 0 volume, 2 disks change to RAID 10 volume, 4 disks # POSITIVE test diff --git a/tests/18imsm-r10_4d-takeover-r0_2d b/tests/18imsm-r10_4d-takeover-r0_2d index 19a1160..8a9606b 100644 --- a/tests/18imsm-r10_4d-takeover-r0_2d +++ b/tests/18imsm-r10_4d-takeover-r0_2d @@ -1,3 +1,5 @@ +. tests/env-imsm-template + # RAID 10 volume, 4 disks change to RAID 0 volume, 2 disks # POSITIVE test diff --git a/tests/env-08imsm-overlap b/tests/env-08imsm-overlap deleted file mode 100644 index 83557d3..0000000 --- a/tests/env-08imsm-overlap +++ /dev/null @@ -1,68 +0,0 @@ -imsm_check() { - case $1 in - container ) - grep -s "$(((418 * $2)/2)) blocks super external:imsm" /proc/mdstat > /dev/null || { - echo >&2 "ERROR correctly formed container not found"; cat /proc/mdstat; exit 1;} - ;; - member ) - member=$2 - num_disks=$3 - level=$4 - size=$5 - offset=$6 - err=0 - - eval `stat -L -c "let major=0x%t; let minor=0x%T;" $member` - sysfs=/sys/dev/block/${major}:${minor} - if [ ! -f ${sysfs}/md/array_state ]; then - echo "member array $member not found" >&2 - cat /proc/mdstat >&2 - exit 1 - fi - for i in `seq 0 $((num_disks-1))` - do - _offset=`cat ${sysfs}/md/rd${i}/offset` - if [ $offset -ne $((_offset/2)) ]; then - echo "offset mismatch expected $offset got $_offset" >&2 - err=$((err+1)) - fi - _size=`cat ${sysfs}/md/rd${i}/size` - if [ $size -ne $_size ]; then - echo "offset mismatch expected $size got $_size" >&2 - err=$((err+1)) - fi - done - - if [ $err -gt 0 ]; then - echo "$member failed check" >&2 - cat /proc/mdstat >&2 - mdadm -E /dev/loop0 >&2 - exit 1 - fi - ;; - * ) echo >&2 ERROR unknown check $1 ; exit 1; - esac -} - -setup_env() { - export IMSM_DEVNAME_AS_SERIAL=1 - export IMSM_NO_PLATFORM=1 - container=/dev/md/container - member0=/dev/md/vol0 - member1=/dev/md/vol1 - member2=/dev/md/vol2 - member3=/dev/md/vol3 - member4=/dev/md/vol4 -} - -reset_env() { - unset IMSM_DEVNAME_AS_SERIAL - unset IMSM_NO_PLATFORM - unset imsm_check - unset container - unset member0 - unset member1 - unset member2 - unset member3 - unset member4 -} diff --git a/tests/env-09imsm-assemble b/tests/env-09imsm-assemble deleted file mode 100644 index b12954b..0000000 --- a/tests/env-09imsm-assemble +++ /dev/null @@ -1,32 +0,0 @@ -imsm_check_hold() { - if mdadm --remove $1 $2; then - echo "$2 removal from $1 should have been blocked" >&2 - cat /proc/mdstat >&2 - mdadm -E $2 - exit 1 - fi -} - -imsm_check_removal() { - if ! mdadm --remove $1 $2 ; then - echo "$2 removal from $1 should have succeeded" >&2 - cat /proc/mdstat >&2 - mdadm -E $2 - exit 1 - fi -} - -setup_env() { - export IMSM_DEVNAME_AS_SERIAL=1 - export IMSM_TEST_OROM=1 - container=/dev/md/container - member=/dev/md/vol0 -} - -reset_env() { - unset IMSM_DEVNAME_AS_SERIAL - unset IMSM_TEST_OROM - unset imsm_check - unset container - unset member -} diff --git a/tests/env-09imsm-create-fail-rebuild b/tests/env-09imsm-create-fail-rebuild deleted file mode 100644 index b44746c..0000000 --- a/tests/env-09imsm-create-fail-rebuild +++ /dev/null @@ -1,98 +0,0 @@ -imsm_check_hold() { - if mdadm --remove $1 $2; then - echo "$2 removal from $1 should have been blocked" >&2 - cat /proc/mdstat >&2 - mdadm -E $2 - exit 1 - fi -} - -imsm_check_removal() { - if ! mdadm --remove $1 $2 ; then - echo "$2 removal from $1 should have succeeded" >&2 - cat /proc/mdstat >&2 - mdadm -E $2 - exit 1 - fi -} - -imsm_check() { - udevadm settle - case $1 in - container ) - grep -s "$(((418 * $2)/2)) blocks super external:imsm" /proc/mdstat > /dev/null || { - echo >&2 "ERROR correctly formed container not found"; cat /proc/mdstat; exit 1;} - ;; - member ) - member=$2 - num_disks=$3 - level=$4 - size=$5 - offset=$6 - chunk=$7 - err=0 - - if [ $level -ne 1 ]; then - size=$((size & ~(chunk - 1))) - else - chunk=64 - fi - eval `stat -L -c "let major=0x%t; let minor=0x%T;" $member` - sysfs=/sys/dev/block/${major}:${minor} - if [ ! -f ${sysfs}/md/array_state ]; then - echo "member array $member not found" >&2 - cat /proc/mdstat >&2 - exit 1 - fi - _chunk=`cat ${sysfs}/md/chunk_size` - if [ $chunk -ne $((_chunk/1024)) ]; then - echo "chunk mismatch expected $chunk got $_chunk" >&2 - err=$((err+1)) - fi - for i in `seq 0 $((num_disks-1))` - do - _offset=`cat ${sysfs}/md/rd${i}/offset` - if [ $offset -ne $((_offset/2)) ]; then - echo "offset mismatch expected $offset got $_offset" >&2 - err=$((err+1)) - fi - _size=`cat ${sysfs}/md/rd${i}/size` - if [ $size -ne $_size ]; then - echo "size mismatch expected $size got $_size" >&2 - err=$((err+1)) - fi - done - - if [ $err -gt 0 ]; then - echo "$member failed check" >&2 - cat /proc/mdstat >&2 - mdadm -E /dev/loop0 >&2 - exit 1 - fi - ;; - * ) echo >&2 ERROR unknown check $1 ; exit 1; - esac -} - -setup_env() { - export IMSM_DEVNAME_AS_SERIAL=1 - export IMSM_TEST_OROM=1 - container=/dev/md/container - member0=/dev/md/vol0 - member1=/dev/md/vol1 - member2=/dev/md/vol2 - member3=/dev/md/vol3 - member4=/dev/md/vol4 -} - -reset_env() { - unset IMSM_DEVNAME_AS_SERIAL - unset IMSM_TEST_OROM - unset imsm_check - unset container - unset member0 - unset member1 - unset member2 - unset member3 - unset member4 -} diff --git a/tests/env-11spare-migration b/tests/env-11spare-migration deleted file mode 100644 index d5eb76d..0000000 --- a/tests/env-11spare-migration +++ /dev/null @@ -1,11 +0,0 @@ -setup_env() { - export IMSM_DEVNAME_AS_SERIAL=1 - export IMSM_TEST_OROM=1 - export IMSM_NO_PLATFORM=1 - } - -reset_env() { - unset IMSM_DEVNAME_AS_SERIAL - unset IMSM_TEST_OROM - unset IMSM_NO_PLATFORM -} diff --git a/tests/env-12imsm-r0_2d-grow-r0_3d b/tests/env-12imsm-r0_2d-grow-r0_3d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-12imsm-r0_2d-grow-r0_3d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-12imsm-r0_2d-grow-r0_4d b/tests/env-12imsm-r0_2d-grow-r0_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-12imsm-r0_2d-grow-r0_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-12imsm-r0_2d-grow-r0_5d b/tests/env-12imsm-r0_2d-grow-r0_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-12imsm-r0_2d-grow-r0_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-12imsm-r0_3d-grow-r0_4d b/tests/env-12imsm-r0_3d-grow-r0_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-12imsm-r0_3d-grow-r0_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-12imsm-r5_3d-grow-r5_4d b/tests/env-12imsm-r5_3d-grow-r5_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-12imsm-r5_3d-grow-r5_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-12imsm-r5_3d-grow-r5_5d b/tests/env-12imsm-r5_3d-grow-r5_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-12imsm-r5_3d-grow-r5_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r0_r0_2d-grow-r0_r0_4d b/tests/env-13imsm-r0_r0_2d-grow-r0_r0_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r0_r0_2d-grow-r0_r0_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r0_r0_2d-grow-r0_r0_5d b/tests/env-13imsm-r0_r0_2d-grow-r0_r0_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r0_r0_2d-grow-r0_r0_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r0_r0_3d-grow-r0_r0_4d b/tests/env-13imsm-r0_r0_3d-grow-r0_r0_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r0_r0_3d-grow-r0_r0_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r0_r5_3d-grow-r0_r5_4d b/tests/env-13imsm-r0_r5_3d-grow-r0_r5_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r0_r5_3d-grow-r0_r5_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r0_r5_3d-grow-r0_r5_5d b/tests/env-13imsm-r0_r5_3d-grow-r0_r5_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r0_r5_3d-grow-r0_r5_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r5_r0_3d-grow-r5_r0_4d b/tests/env-13imsm-r5_r0_3d-grow-r5_r0_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r5_r0_3d-grow-r5_r0_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-13imsm-r5_r0_3d-grow-r5_r0_5d b/tests/env-13imsm-r5_r0_3d-grow-r5_r0_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-13imsm-r5_r0_3d-grow-r5_r0_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d b/tests/env-14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r0_3d-r5_3d-migrate-r5_4d-r5_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r0_3d_no_spares-migrate-r5_3d b/tests/env-14imsm-r0_3d_no_spares-migrate-r5_3d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r0_3d_no_spares-migrate-r5_3d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r0_r0_2d-takeover-r10_4d b/tests/env-14imsm-r0_r0_2d-takeover-r10_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r0_r0_2d-takeover-r10_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r10_4d-grow-r10_5d b/tests/env-14imsm-r10_4d-grow-r10_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r10_4d-grow-r10_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r10_r5_4d-takeover-r0_2d b/tests/env-14imsm-r10_r5_4d-takeover-r0_2d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r10_r5_4d-takeover-r0_2d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r1_2d-grow-r1_3d b/tests/env-14imsm-r1_2d-grow-r1_3d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r1_2d-grow-r1_3d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r1_2d-takeover-r0_2d b/tests/env-14imsm-r1_2d-takeover-r0_2d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r1_2d-takeover-r0_2d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r5_3d-grow-r5_4d-no-spares b/tests/env-14imsm-r5_3d-grow-r5_4d-no-spares deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r5_3d-grow-r5_4d-no-spares +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r5_3d-grow-r5_5d-no-spares b/tests/env-14imsm-r5_3d-grow-r5_5d-no-spares deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r5_3d-grow-r5_5d-no-spares +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-14imsm-r5_3d-migrate-r4_3d b/tests/env-14imsm-r5_3d-migrate-r4_3d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-14imsm-r5_3d-migrate-r4_3d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-15imsm-r0_3d_64k-migrate-r0_3d_256k b/tests/env-15imsm-r0_3d_64k-migrate-r0_3d_256k deleted file mode 120000 index 1801784..0000000 --- a/tests/env-15imsm-r0_3d_64k-migrate-r0_3d_256k +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-15imsm-r5_3d_4k-migrate-r5_3d_256k b/tests/env-15imsm-r5_3d_4k-migrate-r5_3d_256k deleted file mode 120000 index 1801784..0000000 --- a/tests/env-15imsm-r5_3d_4k-migrate-r5_3d_256k +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-15imsm-r5_3d_64k-migrate-r5_3d_256k b/tests/env-15imsm-r5_3d_64k-migrate-r5_3d_256k deleted file mode 120000 index 1801784..0000000 --- a/tests/env-15imsm-r5_3d_64k-migrate-r5_3d_256k +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-15imsm-r5_6d_4k-migrate-r5_6d_256k b/tests/env-15imsm-r5_6d_4k-migrate-r5_6d_256k deleted file mode 120000 index 1801784..0000000 --- a/tests/env-15imsm-r5_6d_4k-migrate-r5_6d_256k +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_128k b/tests/env-15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_128k deleted file mode 120000 index 1801784..0000000 --- a/tests/env-15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_128k +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k b/tests/env-15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k deleted file mode 120000 index 1801784..0000000 --- a/tests/env-15imsm-r5_r0_3d_64k-migrate-r5_r0_3d_256k +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-16imsm-r0_3d-migrate-r5_4d b/tests/env-16imsm-r0_3d-migrate-r5_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-16imsm-r0_3d-migrate-r5_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-16imsm-r0_5d-migrate-r5_6d b/tests/env-16imsm-r0_5d-migrate-r5_6d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-16imsm-r0_5d-migrate-r5_6d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-16imsm-r5_3d-migrate-r0_3d b/tests/env-16imsm-r5_3d-migrate-r0_3d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-16imsm-r5_3d-migrate-r0_3d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-16imsm-r5_5d-migrate-r0_5d b/tests/env-16imsm-r5_5d-migrate-r0_5d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-16imsm-r5_5d-migrate-r0_5d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-17imsm-r5_3d-migrate-r4_3d b/tests/env-17imsm-r5_3d-migrate-r4_3d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-17imsm-r5_3d-migrate-r4_3d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-18imsm-1d-takeover-r0_1d b/tests/env-18imsm-1d-takeover-r0_1d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-18imsm-1d-takeover-r0_1d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-18imsm-1d-takeover-r1_2d b/tests/env-18imsm-1d-takeover-r1_2d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-18imsm-1d-takeover-r1_2d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-18imsm-r0_2d-takeover-r10_4d b/tests/env-18imsm-r0_2d-takeover-r10_4d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-18imsm-r0_2d-takeover-r10_4d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-18imsm-r10_4d-takeover-r0_2d b/tests/env-18imsm-r10_4d-takeover-r0_2d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-18imsm-r10_4d-takeover-r0_2d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-18imsm-r1_2d-takeover-r0_2d b/tests/env-18imsm-r1_2d-takeover-r0_2d deleted file mode 120000 index 1801784..0000000 --- a/tests/env-18imsm-r1_2d-takeover-r0_2d +++ /dev/null @@ -1 +0,0 @@ -env-imsm-template
\ No newline at end of file diff --git a/tests/env-imsm-template b/tests/env-imsm-template index 8238ddd..74c43c6 100644 --- a/tests/env-imsm-template +++ b/tests/env-imsm-template @@ -62,24 +62,10 @@ imsm_check() { esac } -setup_env() { - export IMSM_NO_PLATFORM=1 - export IMSM_DEVNAME_AS_SERIAL=1 - export IMSM_TEST_OROM=1 - export MDADM_EXPERIMENTAL=1 - container=/dev/md/container - member0=/dev/md/vol0 - member1=/dev/md/vol1 -} - -reset_env() { - unset IMSM_NO_PLATFORM - unset IMSM_DENAME_AS_SERIAL - unset IMSM_TEST_OROM - unset MDADM_EXPERIMENTAL - unset member0 - unset member1 - unset imsm_check - unset container - rm -f /tmp/backup_imsm -} +export IMSM_NO_PLATFORM=1 +export IMSM_DEVNAME_AS_SERIAL=1 +export IMSM_TEST_OROM=1 +export MDADM_EXPERIMENTAL=1 +container=/dev/md/container +member0=/dev/md/vol0 +member1=/dev/md/vol1 |