2
0
Fork 0

tests: add vmm_x86 test

nix
Emery Hemingway 3 years ago
parent 1400dded7e
commit 1f5dfe4ef5
  1. 2
      packages/genodelabs/targets.nix
  2. 31
      packages/genodelabs/test-vmm_x86.patch
  3. 1
      tests/default.nix
  4. 25
      tests/vmm_x86.dhall
  5. 12
      tests/vmm_x86.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 = {

@ -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<Vmm> _destruct_handler;
- Genode::Reconstructible<Vm> _vm;
+ Genode::Env &_env;
+ Genode::Signal_handler<Vmm> _destruct_handler;
+ Genode::Reconstructible<Vm> _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)
{

@ -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;

@ -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 } }

@ -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" ];
}
Loading…
Cancel
Save