diff options
author | ngie <ngie@FreeBSD.org> | 2017-09-08 04:39:59 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-09-08 04:39:59 +0000 |
commit | 14e21938a71fc900b6845b92ca3d5458dcb9e932 (patch) | |
tree | 1d070c9cd327046bee944a28e88a9a12406afdfb /tests/sys | |
parent | a361ff283335faab9025f1d2048881f19547673d (diff) | |
download | FreeBSD-src-14e21938a71fc900b6845b92ca3d5458dcb9e932.zip FreeBSD-src-14e21938a71fc900b6845b92ca3d5458dcb9e932.tar.gz |
MFC r321702,r321703:
r321702:
Load geom_gate(4) if necessary before running tests; skip if it can't be loaded
The test code prior to r311893 loaded geom_gate at test start if necessary and
skipped the tests if it couldn't be loaded.
The ATF-ifcation of this test done in r311893 unfortunately dropped this
functionality.
This change restores the geom_gate module load and skips the test(s) if unavailable
in an ATF-like way.
PR: 220164
r321703:
Remove superfluous `exit 0` added in r321702
atf_skip triggers equivalent functionality, which means the `exit 0`
is unreachable code.
PR: 220164
MFC with: r321702
Diffstat (limited to 'tests/sys')
-rwxr-xr-x | tests/sys/geom/class/gate/ggate_test.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/sys/geom/class/gate/ggate_test.sh b/tests/sys/geom/class/gate/ggate_test.sh index 162744d..287d8c7 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,18 @@ 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}" + fi + fi +} + # Bug 204616: ggatel(8) creates /dev/ggate* asynchronously if `ggatel create` # isn't called with `-v`. wait_for_ggate_device() |