summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>2010-12-26 21:59:14 +1100
committerNeilBrown <neilb@suse.de>2010-12-26 21:59:14 +1100
commit4f8a3e5baf77a3951b42d9522d75f0e7915912ec (patch)
tree9a3fe057807fc40cd25dc6d6cd0d30b3683064a7 /test
parenta06d022db41ed624125e343f9a5de278c5d32ae3 (diff)
Enable tests for OLCE, takeover, migrations for imsm metadata
Patch provides set of tests for On-line Capacity Expansion, takeover, migrations operations for imsm metadata type. Tests are grouped by operation type: 12 - On-line Capacity Expansion on one volume 13 - On-line Capacity Expansion on two volumes 14 - Negative tests for takeover, migrations 15 - Chunk size migrations 16 - raid0 -> raid5, raid5 -> raid0 migrations 18 - takeover operations To run particular test group, following command should be executed: (from mdadm's source code root directory) ./test <group number> Example: To run On-line Capacity Expansion on one volume tests: ./test 12 Tests execution results: - In case of test pass, "succeeded" word is printed on console - If test is failed, "FAILED" word is printed on console and logs are stored in <mdadm-root-dir>/tests/log/ directory Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'test')
-rwxr-xr-x[-rw-r--r--]test36
1 files changed, 18 insertions, 18 deletions
diff --git a/test b/test
index d1b45826..a94aef32 100644..100755
--- a/test
+++ b/test
@@ -50,12 +50,12 @@ ddfsize=65536
cleanup() {
udevadm settle
- $mdadm -Ssq
+ $mdadm -Ssq 2> /dev/null
for d in 0 1 2 3 4 5 6 7 8 9 10 11 12
do
losetup -d /dev/loop$d ; # rm -f $targetdir/mdtest$d
rm -f /dev/disk/by-path/loop*
- done
+ done
}
trap cleanup 0 1 2 3 15
@@ -117,45 +117,45 @@ check() {
;;
raid* | linear )
grep -s "active $1 " /proc/mdstat > /dev/null || {
- echo >&2 "ERROR active $1 not found" ; cat /proc/mdstat ; exit 1;}
+ echo >&2 "ERROR active $1 not found" ; cat /proc/mdstat ; exit 1;}
;;
resync | recovery | reshape)
sleep 0.5
grep -s $1 /proc/mdstat > /dev/null || {
- echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1; }
+ echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1; }
;;
-
+
nosync )
sleep 0.5
if grep -s -E '(resync|recovery|reshape) =' > /dev/null /proc/mdstat ; then
- echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1;
+ echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1;
fi
;;
-
+
wait )
sleep 0.1
while grep -E '(resync|recovery|reshape|check|repair) =' > /dev/null /proc/mdstat
do sleep 2;
done
;;
-
+
state )
grep -s "blocks.*\[$2\]\$" /proc/mdstat > /dev/null || {
- echo >&2 "ERROR state $2 not found!"; cat /proc/mdstat ; exit 1; }
+ echo >&2 "ERROR state $2 not found!"; cat /proc/mdstat ; exit 1; }
sleep 0.5
;;
bitmap )
grep -s bitmap > /dev/null /proc/mdstat || {
- echo >&2 ERROR no bitmap ; cat /proc/mdstat ; exit 1; }
+ echo >&2 ERROR no bitmap ; cat /proc/mdstat ; exit 1; }
;;
nobitmap )
- if grep -s "bitmap" > /dev/null /proc/mdstat
+ if grep -s "bitmap" > /dev/null /proc/mdstat
then
- echo >&2 ERROR bitmap present ; cat /proc/mdstat ; exit 1;
+ echo >&2 ERROR bitmap present ; cat /proc/mdstat ; exit 1;
fi
;;
-
+
* ) echo >&2 ERROR unknown check $1 ; exit 1;
esac
}
@@ -218,18 +218,18 @@ do
then
rm -f $targetdir/stderr
# stop all arrays, just incase some script left an array active.
- mdadm -Ssq
+ $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 "$script succeeded"
- else cat $targetdir/log ; cat $targetdir/stderr
- echo "$script failed"
- reset_environment $environment
+ then echo "succeeded"
+ else echo "FAILED"
+ reset_environment $environment
exit 1
fi
reset_environment $environment