summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-08-03 10:49:21 -0400
committerDan McDonald <danmcd@mnx.io>2022-08-03 16:16:28 -0400
commitcef7020412fbcaba82b6bbbc172e0f614dde1e80 (patch)
tree24d83240b507d987b70a273ad24cc257becc8640
parentf95a62f2017c7b3bed85baacf345d478ee4917ba (diff)
downloadillumos-joyent-cef7020412fbcaba82b6bbbc172e0f614dde1e80.tar.gz
OS-8401 vmm_drv_test needs to be less IPS-dependent
-rw-r--r--usr/src/pkg/manifests/system-bhyve-tests.p5m4
-rw-r--r--usr/src/test/bhyve-tests/runfiles/default.run5
-rw-r--r--usr/src/test/bhyve-tests/tests/vmm/Makefile6
-rwxr-xr-xusr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_fini23
-rwxr-xr-xusr/src/test/bhyve-tests/tests/vmm/vmm_drv_test_init24
5 files changed, 60 insertions, 2 deletions
diff --git a/usr/src/pkg/manifests/system-bhyve-tests.p5m b/usr/src/pkg/manifests/system-bhyve-tests.p5m
index 697b77f6cd..aa9522d2d6 100644
--- a/usr/src/pkg/manifests/system-bhyve-tests.p5m
+++ b/usr/src/pkg/manifests/system-bhyve-tests.p5m
@@ -60,12 +60,12 @@ file path=opt/bhyve-tests/tests/vmm/interface_version mode=0555
file path=opt/bhyve-tests/tests/vmm/mem_devmem mode=0555
file path=opt/bhyve-tests/tests/vmm/mem_partial mode=0555
file path=opt/bhyve-tests/tests/vmm/mem_seg_map mode=0555
+file path=opt/bhyve-tests/tests/vmm/vmm_drv_test_fini mode=0555
+file path=opt/bhyve-tests/tests/vmm/vmm_drv_test_init mode=0555
dir path=usr/kernel/drv group=sys
dir path=usr/kernel/drv/$(ARCH64) group=sys
file path=usr/kernel/drv/$(ARCH64)/vmm_drv_test
file path=usr/kernel/drv/vmm_drv_test.conf
-driver name=vmm_drv_test perms="* 0666 root sys" \
- policy="read_priv_set=sys_devices write_priv_set=sys_devices"
license lic_CDDL license=lic_CDDL
depend type=require fmri=system/bhyve
depend type=require fmri=system/test/testrunner
diff --git a/usr/src/test/bhyve-tests/runfiles/default.run b/usr/src/test/bhyve-tests/runfiles/default.run
index 25f7aa5f6d..30262dee86 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',
'drv_hold',
@@ -30,6 +34,7 @@ tests = [
'mem_partial',
'mem_seg_map'
]
+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 b249921d89..51f55d0147 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
@@ -24,6 +27,8 @@ PROG = mem_partial \
auto_destruct \
drv_hold
+SCRIPT = vmm_drv_test_fini vmm_drv_test_init
+
COMMON_OBJS = common.o
CLEAN_OBJS = $(PROG:%=%.o)
@@ -31,6 +36,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