Browse Source

tests: add vmm_x86 test

routes
Emery Hemingway 5 months ago
parent
commit
1f5dfe4ef5

+ 2
- 0
packages/genodelabs/targets.nix View File

@@ -30,6 +30,8 @@ with ports; {
30 30
 
31 31
   "test-signal".patches = [ ./test-signal.patch ];
32 32
 
33
+  "test-vmm_x86".patches = [ ./test-vmm_x86.patch ];
34
+
33 35
   usb_drv.portInputs = [ dde_linux ];
34 36
 
35 37
   vbox5 = {

+ 31
- 0
packages/genodelabs/test-vmm_x86.patch View File

@@ -0,0 +1,31 @@
1
+diff --git a/repos/os/src/test/vmm_x86/component.cc b/repos/os/src/test/vmm_x86/component.cc
2
+index 1bfbd58db7..d56a561061 100644
3
+--- a/repos/os/src/test/vmm_x86/component.cc
4
++++ b/repos/os/src/test/vmm_x86/component.cc
5
+@@ -492,8 +492,9 @@ class Vmm {
6
+ 
7
+ 	private:
8
+ 
9
+-		Genode::Signal_handler<Vmm> _destruct_handler;
10
+-		Genode::Reconstructible<Vm> _vm;
11
++		Genode::Env                 &_env;
12
++		Genode::Signal_handler<Vmm>  _destruct_handler;
13
++		Genode::Reconstructible<Vm>  _vm;
14
+ 
15
+ 		void _destruct()
16
+ 		{
17
+@@ -502,12 +503,14 @@ class Vmm {
18
+ 			_vm.destruct();
19
+ 
20
+ 			Genode::log("vmm test finished");
21
++			_env.parent().exit(0);
22
+ 		}
23
+ 
24
+ 	public:
25
+ 
26
+ 		Vmm(Genode::Env &env)
27
+ 		:
28
++			_env(env),
29
+ 			_destruct_handler(env.ep(), *this, &Vmm::_destruct),
30
+ 			_vm(env, _destruct_handler)
31
+ 		{

+ 1
- 0
tests/default.nix View File

@@ -27,6 +27,7 @@ let
27 27
     ((tests call) // {
28 28
       driver_manager = call ./driver_manager.nix { };
29 29
       noux = call ./noux.nix { };
30
+      vmm = call ./vmm_x86.nix { };
30 31
       x86 = call ./x86.nix { };
31 32
     } // call ./solo5 { })) (import ./driver-nova.nix {
32 33
       inherit apps addManifest buildPackages depot lib nixpkgs testPkgs;

+ 25
- 0
tests/vmm_x86.dhall View File

@@ -0,0 +1,25 @@
1
+-- SPDX-License-Identifier: CC0-1.0
2
+
3
+let Test = ./test.dhall ? env:DHALL_GENODE_TEST
4
+
5
+let Genode = Test.Genode
6
+
7
+let Init = Genode.Init
8
+
9
+let Child = Init.Child
10
+
11
+let vmm =
12
+      Child.flat
13
+        Child.Attributes::{
14
+        , binary = "test-vmm_x86"
15
+        , resources = Init.Resources::{
16
+          , caps = 2048
17
+          , ram = Genode.units.MiB 256
18
+          }
19
+        , routes =
20
+          [ Genode.Init.ServiceRoute.parent "Timer"
21
+          , Genode.Init.ServiceRoute.parent "VM"
22
+          ]
23
+        }
24
+
25
+in  Test::{ children = toMap { vmm = vmm } }

+ 12
- 0
tests/vmm_x86.nix View File

@@ -0,0 +1,12 @@
1
+# SPDX-License-Identifier: CC0-1.0
2
+
3
+{ testEnv, pkgs, ... }:
4
+with pkgs;
5
+
6
+testEnv.mkTest {
7
+  name = "vmm";
8
+  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
9
+
10
+  testConfig = ./vmm_x86.dhall;
11
+  testInputs = map pkgs.genodeSources.make [ "test/vmm_x86" ];
12
+}

Loading…
Cancel
Save