tests: add vmm_x86 test
This commit is contained in:
parent
f2defbb7cd
commit
dba4d80779
|
@ -25,6 +25,8 @@ with ports; {
|
||||||
|
|
||||||
"test-pci".patches = [ ./test-pci.patch ];
|
"test-pci".patches = [ ./test-pci.patch ];
|
||||||
|
|
||||||
|
"test-vmm_x86".patches = [ ./test-vmm_x86.patch ];
|
||||||
|
|
||||||
usb_drv.portInputs = [ dde_linux ];
|
usb_drv.portInputs = [ dde_linux ];
|
||||||
|
|
||||||
vbox5 = {
|
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)
|
||||||
|
{
|
|
@ -32,6 +32,7 @@ let
|
||||||
((tests call) // {
|
((tests call) // {
|
||||||
driver_manager = call ./driver_manager.nix { };
|
driver_manager = call ./driver_manager.nix { };
|
||||||
noux = call ./noux.nix { };
|
noux = call ./noux.nix { };
|
||||||
|
vmm = call ./vmm_x86.nix { };
|
||||||
x86 = call ./x86.nix { };
|
x86 = call ./x86.nix { };
|
||||||
})) (import ./driver-nova.nix {
|
})) (import ./driver-nova.nix {
|
||||||
inherit apps addManifest buildPackages depot lib nixpkgs testPkgs;
|
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…
Reference in New Issue