2
0
Forka 0

tests: add vmm_x86 test

This commit is contained in:
Emery Hemingway 2020-04-26 10:48:38 +05:30
parent 1400dded7e
commit 1f5dfe4ef5
5 ha cambiato i file con 71 aggiunte e 0 eliminazioni

Vedi File

@ -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 = {

Vedi File

@ -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)
{

Vedi File

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

25
tests/vmm_x86.dhall Normal file
Vedi File

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

12
tests/vmm_x86.nix Normal file
Vedi File

@ -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" ];
}