summaryrefslogtreecommitdiff
path: root/tests/dev/raidframe
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2010-12-18 09:44:41 +0000
committerpooka <pooka@NetBSD.org>2010-12-18 09:44:41 +0000
commit60f66e94e08a4b3602ee5d05d3a082d025bd24ba (patch)
treeef07413b6dea48dcbc272a4d10aa8bcf1274e4a8 /tests/dev/raidframe
parent191dbf11a49fe49e3c08a9068151fec39034443e (diff)
test case for PR kern/44251
Diffstat (limited to 'tests/dev/raidframe')
-rw-r--r--tests/dev/raidframe/t_raid.sh53
1 files changed, 43 insertions, 10 deletions
diff --git a/tests/dev/raidframe/t_raid.sh b/tests/dev/raidframe/t_raid.sh
index b0d4cc4881d..75e97d9a156 100644
--- a/tests/dev/raidframe/t_raid.sh
+++ b/tests/dev/raidframe/t_raid.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_raid.sh,v 1.3 2010/12/18 09:26:57 pooka Exp $
+# $NetBSD: t_raid.sh,v 1.4 2010/12/18 09:44:41 pooka Exp $
#
# Copyright (c) 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -47,14 +47,12 @@ makecfg()
atf_test_case smalldisk cleanup
smalldisk_head()
{
-
atf_set "descr" "Checks the raidframe works on small disks " \
"(PR kern/44239)"
}
smalldisk_body()
{
-
makecfg 1 2
export RUMP_SERVER=unix://sock
atf_check -s exit:0 rump_allserver \
@@ -68,25 +66,23 @@ smalldisk_body()
smalldisk_cleanup()
{
-
export RUMP_SERVER=unix://sock
rump.halt
: server dumps currently, so reset error. remove this line when fixed
}
+
# make this smaller once 44239 is fixed
export RAID_MEDIASIZE=32m
atf_test_case raid1_compfail cleanup
raid1_compfail_head()
{
-
atf_set "descr" "Checks that RAID1 works after component failure"
}
raid1_compfail_body()
{
-
makecfg 1 2
export RUMP_SERVER=unix://sock
atf_check -s exit:0 rump_allserver \
@@ -119,21 +115,58 @@ raid1_compfail_body()
raid1_compfail_cleanup()
{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+
+
+atf_test_case raid1_comp0fail cleanup
+raid1_comp0fail_head()
+{
+ atf_set "descr" "Checks configuring RAID1 after component 0 fails"
+}
+raid1_comp0fail_body()
+{
+ makecfg 1 2
export RUMP_SERVER=unix://sock
+ atf_check -s exit:0 rump_allserver \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_check -s exit:0 rump.raidctl -C raid.conf raid0
+ atf_check -s exit:0 rump.raidctl -I 12345 raid0
+ atf_check -s exit:0 -o ignore rump.raidctl -iv raid0
+
+ # restart server with failed component
rump.halt
+ rm disk0.img # FAIL
+ atf_check -s exit:0 rump_allserver \
+ -d key=/disk0,hostpath=disk0.img,size=${RAID_MEDIASIZE} \
+ -d key=/disk1,hostpath=disk1.img,size=${RAID_MEDIASIZE} \
+ ${RUMP_SERVER}
+
+ atf_expect_fail "PR kern/44251"
+ atf_check -s exit:0 rump.raidctl -c raid.conf raid0
}
+raid1_comp0fail_cleanup()
+{
+ export RUMP_SERVER=unix://sock
+ rump.halt
+}
+
+
atf_test_case raid5_compfail cleanup
raid5_compfail_head()
{
-
atf_set "descr" "Checks that RAID5 works after component failure"
}
raid5_compfail_body()
{
-
makecfg 5 3
export RUMP_SERVER=unix://sock
atf_check -s exit:0 rump_allserver \
@@ -168,15 +201,15 @@ raid5_compfail_body()
raid5_compfail_cleanup()
{
-
export RUMP_SERVER=unix://sock
rump.halt
}
+
atf_init_test_cases()
{
-
atf_add_test_case smalldisk
+ atf_add_test_case raid1_comp0fail
atf_add_test_case raid1_compfail
atf_add_test_case raid5_compfail
}