diff --git a/packages/genodelabs/targets.nix b/packages/genodelabs/targets.nix index b075c28..89a0377 100644 --- a/packages/genodelabs/targets.nix +++ b/packages/genodelabs/targets.nix @@ -30,6 +30,8 @@ with ports; { "test-signal".patches = [ ./test-signal.patch ]; + "test-vmm_x86".patches = [ ./test-vmm_x86.patch ]; + usb_drv.portInputs = [ dde_linux ]; vbox5 = { diff --git a/packages/genodelabs/test-vmm_x86.patch b/packages/genodelabs/test-vmm_x86.patch new file mode 100644 index 0000000..1410502 --- /dev/null +++ b/packages/genodelabs/test-vmm_x86.patch @@ -0,0 +1,31 @@ +diff --git a/repos/os/src/test/vmm_x86/component.cc b/repos/os/src/test/vmm_x86/component.cc +index 1bfbd58db7..d56a561061 100644 +--- a/repos/os/src/test/vmm_x86/component.cc ++++ b/repos/os/src/test/vmm_x86/component.cc +@@ -492,8 +492,9 @@ class Vmm { + + private: + +- Genode::Signal_handler _destruct_handler; +- Genode::Reconstructible _vm; ++ Genode::Env &_env; ++ Genode::Signal_handler _destruct_handler; ++ Genode::Reconstructible _vm; + + void _destruct() + { +@@ -502,12 +503,14 @@ class Vmm { + _vm.destruct(); + + Genode::log("vmm test finished"); ++ _env.parent().exit(0); + } + + public: + + Vmm(Genode::Env &env) + : ++ _env(env), + _destruct_handler(env.ep(), *this, &Vmm::_destruct), + _vm(env, _destruct_handler) + { diff --git a/tests/default.nix b/tests/default.nix index 9c00c20..8fa1b19 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -27,6 +27,7 @@ let ((tests call) // { driver_manager = call ./driver_manager.nix { }; noux = call ./noux.nix { }; + vmm = call ./vmm_x86.nix { }; x86 = call ./x86.nix { }; } // call ./solo5 { })) (import ./driver-nova.nix { inherit apps addManifest buildPackages depot lib nixpkgs testPkgs; diff --git a/tests/vmm_x86.dhall b/tests/vmm_x86.dhall new file mode 100644 index 0000000..8175a30 --- /dev/null +++ b/tests/vmm_x86.dhall @@ -0,0 +1,25 @@ +-- SPDX-License-Identifier: CC0-1.0 + +let Test = ./test.dhall ? env:DHALL_GENODE_TEST + +let Genode = Test.Genode + +let Init = Genode.Init + +let Child = Init.Child + +let vmm = + Child.flat + Child.Attributes::{ + , binary = "test-vmm_x86" + , resources = Init.Resources::{ + , caps = 2048 + , ram = Genode.units.MiB 256 + } + , routes = + [ Genode.Init.ServiceRoute.parent "Timer" + , Genode.Init.ServiceRoute.parent "VM" + ] + } + +in Test::{ children = toMap { vmm = vmm } } diff --git a/tests/vmm_x86.nix b/tests/vmm_x86.nix new file mode 100644 index 0000000..e92b392 --- /dev/null +++ b/tests/vmm_x86.nix @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: CC0-1.0 + +{ testEnv, pkgs, ... }: +with pkgs; + +testEnv.mkTest { + name = "vmm"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ]; + + testConfig = ./vmm_x86.dhall; + testInputs = map pkgs.genodeSources.make [ "test/vmm_x86" ]; +}