diff options
Diffstat (limited to 'usr/src/test/bhyve-tests')
-rw-r--r-- | usr/src/test/bhyve-tests/runfiles/default.run | 5 | ||||
-rw-r--r-- | usr/src/test/bhyve-tests/tests/vmm/Makefile | 6 | ||||
-rwxr-xr-x | usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_fini | 23 | ||||
-rwxr-xr-x | usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_init | 24 |
4 files changed, 58 insertions, 0 deletions
diff --git a/usr/src/test/bhyve-tests/runfiles/default.run b/usr/src/test/bhyve-tests/runfiles/default.run index 93101811a5..b59d10ba67 100644 --- a/usr/src/test/bhyve-tests/runfiles/default.run +++ b/usr/src/test/bhyve-tests/runfiles/default.run @@ -9,7 +9,10 @@ # http://www.illumos.org/license/CDDL. # +# # Copyright 2022 Oxide Computer Company +# Copyright 2022 MNX Cloud, Inc. +# [DEFAULT] pre = @@ -21,6 +24,7 @@ outputdir = /var/tmp/test_results [/opt/bhyve-tests/tests/vmm] user = root +pre = vmm_drv_test_init tests = [ 'auto_destruct', 'cpuid_ioctl', @@ -36,6 +40,7 @@ tests = [ 'pause_resume', 'self_destruct' ] +post = vmm_drv_test_fini [/opt/bhyve-tests/tests/kdev] user = root diff --git a/usr/src/test/bhyve-tests/tests/vmm/Makefile b/usr/src/test/bhyve-tests/tests/vmm/Makefile index e557aa2407..658a6b6b64 100644 --- a/usr/src/test/bhyve-tests/tests/vmm/Makefile +++ b/usr/src/test/bhyve-tests/tests/vmm/Makefile @@ -9,7 +9,10 @@ # http://www.illumos.org/license/CDDL. # +# # Copyright 2022 Oxide Computer Company +# Copyright 2022 MNX Cloud, Inc. +# include $(SRC)/cmd/Makefile.cmd include $(SRC)/cmd/Makefile.cmd.64 @@ -30,6 +33,8 @@ PROG = mem_partial \ datarw_constraints \ pause_resume +SCRIPT = vmm_drv_test_fini vmm_drv_test_init + COMMON_OBJS = common.o CLEAN_OBJS = $(PROG:%=%.o) @@ -37,6 +42,7 @@ ROOTOPTPKG = $(ROOT)/opt/bhyve-tests TESTDIR = $(ROOTOPTPKG)/tests/vmm CMDS = $(PROG:%=$(TESTDIR)/%) +CMDS += $(SCRIPT:%=$(TESTDIR)/%) $(CMDS) := FILEMODE = 0555 CSTD= $(CSTD_GNU99) diff --git a/usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_fini b/usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_fini new file mode 100755 index 0000000000..79f9b6bcfb --- /dev/null +++ b/usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_fini @@ -0,0 +1,23 @@ +#!/usr/bin/ksh +# +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2022 MNX Cloud, Inc. +# + +if ! rem_drv vmm_drv_test; then + printf "failed to remove vmm_drv_test driver\n" 2>&1 + exit 1 +fi + +exit 0 diff --git a/usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_init b/usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_init new file mode 100755 index 0000000000..277538432b --- /dev/null +++ b/usr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_init @@ -0,0 +1,24 @@ +#!/usr/bin/ksh +# +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2022 MNX Cloud, Inc. +# + +if ! add_drv -m '* 0666 root sys' \ + -p 'read_priv_set=sys_devices write_priv_set=sys_devices' vmm_drv_test; then + printf "failed to add vmm_drv_test driver\n" 2>&1 + exit 1 +fi + +exit 0 |