diff --git a/tests/sys/geom/class/gate/ggate_test.sh b/tests/sys/geom/class/gate/ggate_test.sh index 162744d818df..7f853357be38 100755 --- a/tests/sys/geom/class/gate/ggate_test.sh +++ b/tests/sys/geom/class/gate/ggate_test.sh @@ -16,6 +16,8 @@ ggated_head() ggated_body() { + load_ggate + us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -57,6 +59,8 @@ ggatel_file_head() ggatel_file_body() { + load_ggate + us=$(alloc_ggate_dev) echo src work >> ${PLAINFILES} @@ -91,6 +95,8 @@ ggatel_md_head() ggatel_md_body() { + load_ggate + us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -195,6 +201,19 @@ common_cleanup() true } +load_ggate() +{ + local class=gate + + # If the geom class isn't already loaded, try loading it. + if ! kldstat -q -m g_${class}; then + if ! geom ${class} load; then + atf_skip "could not load module for geom class=${class}" + exit 0 + fi + fi +} + # Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` # isn't called with `-v`. wait_for_ggate_device()