From e72694acd0df2963bbe78de66f3259c1e018b50b Mon Sep 17 00:00:00 2001 From: markj Date: Fri, 15 Dec 2017 17:10:51 +0000 Subject: [PATCH] Skip gnop tests if the corresponding kernel module isn't available. Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13500 --- tests/sys/geom/class/nop/nop_test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/sys/geom/class/nop/nop_test.sh b/tests/sys/geom/class/nop/nop_test.sh index 35cc191de170..edf5ac7ebacb 100644 --- a/tests/sys/geom/class/nop/nop_test.sh +++ b/tests/sys/geom/class/nop/nop_test.sh @@ -36,6 +36,7 @@ diskinfo_head() } diskinfo_body() { + load_gnop us=$(alloc_md) atf_check gnop create /dev/${us} md_secsize=$(diskinfo ${us} | cut -wf 2) @@ -62,6 +63,7 @@ io_head() } io_body() { + load_gnop us=$(alloc_md) atf_check gnop create /dev/${us} @@ -87,6 +89,7 @@ size_head() } size_body() { + load_gnop us=$(alloc_md) for mediasize in 65536 524288 1048576; do atf_check gnop create -s ${mediasize} /dev/${us} @@ -111,6 +114,7 @@ stripesize_head() } stripesize_body() { + load_gnop us=$(alloc_md) for ss in 512 1024 2048 4096 8192; do for sofs in `seq 0 512 ${ss}`; do @@ -164,3 +168,10 @@ common_cleanup() fi true } + +load_gnop() +{ + if ! kldstat -q -m g_nop; then + geom nop load || atf_skip "could not load module for geom nop" + fi +}