4 Commits

Author SHA1 Message Date
  Emery Hemingway f374b4362c tests: consolidate sotest to a single project 5 months ago
  Emery Hemingway 1f5dfe4ef5 tests: add vmm_x86 test 5 months ago
  Emery Hemingway 1400dded7e fixup! tests: consolidate rtc, signal, pci into x86 test 5 months ago
  Emery Hemingway ae135e118d Genodelabs/init: always route "ld.lib.so" ROM to parent 5 months ago

+ 1
- 0
flake.nix View File

@@ -120,6 +120,7 @@
120 120
       checks = let
121 121
         checks' = forAllCrossSystems ({ system, localSystem, crossSystem }:
122 122
           import ./tests {
123
+            inherit self;
123 124
             apps = self.apps.${system};
124 125
             buildPackages = nixpkgsFor.${localSystem};
125 126
             depot = genode-depot.packages.${system};

+ 5
- 2
packages/genodelabs/default.nix View File

@@ -251,10 +251,13 @@ in genodeSources // {
251 251
   inherit buildUpstream buildDepot ports specs toolchain genodeBase;
252 252
 
253 253
   make = target:
254
-    buildUpstream {
254
+    let
255 255
       name = builtins.replaceStrings [ "/" ] [ "-" ] target;
256
+      attrs = buildOverrides.${name} or { };
257
+    in buildUpstream ({
258
+      inherit name;
256 259
       targets = [ target ];
257
-    };
260
+    } // attrs);
258 261
 
259 262
   depot = name:
260 263
     let attrs = buildOverrides.${name} or { };

+ 56
- 0
packages/genodelabs/sandbox.patch View File

@@ -0,0 +1,56 @@
1
+commit 20abcefd185d72ecc55e87ff78f8f784d927653d
2
+Author: Emery Hemingway <ehmry@posteo.net>
3
+Date:   Sat Apr 25 16:08:45 2020 +0530
4
+
5
+    Init/sandbox: always route "ld.lib.so" ROM to parent
6
+    
7
+    A livelock may occur if init router the "ld.lib.so" ROM request of a
8
+    child to another child, and the child providing the ROM interacts with
9
+    Init during the creation of the session.
10
+
11
+diff --git a/repos/os/src/lib/sandbox/child.cc b/repos/os/src/lib/sandbox/child.cc
12
+index 5361665eac..fa09cca31a 100644
13
+--- a/repos/os/src/lib/sandbox/child.cc
14
++++ b/repos/os/src/lib/sandbox/child.cc
15
+@@ -448,6 +448,8 @@ Sandbox::Child::Route
16
+ Sandbox::Child::resolve_session_request(Service::Name const &service_name,
17
+                                         Session_label const &label)
18
+ {
19
++	auto no_filter = [] (Service &) -> bool { return false; };
20
++
21
+ 	/* check for "config" ROM request */
22
+ 	if (service_name == Rom_session::service_name() &&
23
+ 	    label.last_element() == "config") {
24
+@@ -498,9 +500,20 @@ Sandbox::Child::resolve_session_request(Service::Name const &service_name,
25
+ 	    label == _unique_name && _unique_name != _binary_name)
26
+ 		return resolve_session_request(service_name, _binary_name);
27
+ 
28
+-	/* supply binary as dynamic linker if '<start ld="no">' */
29
+-	if (!_use_ld && service_name == Rom_session::service_name() && label == "ld.lib.so")
30
+-		return resolve_session_request(service_name, _binary_name);
31
++	/*
32
++	 * Check for the "ld.lib.so" ROM request
33
++	 */
34
++	if (service_name == Rom_session::service_name() && label == "ld.lib.so") {
35
++		if (_use_ld) {
36
++			/* forward request to parent */
37
++			return Route {
38
++				find_service(_parent_services, Rom_session::service_name(), no_filter),
39
++				Session_label("ld.lib.so"), Session::Diag { false} };
40
++		} else {
41
++			/* supply binary as dynamic linker if '<start ld="no">' */
42
++			return resolve_session_request(service_name, _binary_name);
43
++		}
44
++	}
45
+ 
46
+ 	/* check for "session_requests" ROM request */
47
+ 	if (service_name == Rom_session::service_name()
48
+@@ -541,8 +554,6 @@ Sandbox::Child::resolve_session_request(Service::Name const &service_name,
49
+ 				Session::Diag const
50
+ 					target_diag { target.attribute_value("diag", false) };
51
+ 
52
+-				auto no_filter = [] (Service &) -> bool { return false; };
53
+-
54
+ 				if (target.has_type("parent")) {
55
+ 
56
+ 					try {

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

@@ -3,6 +3,8 @@ with ports; {
3 3
 
4 4
   gpt_write.portInputs = [ jitterentropy ];
5 5
 
6
+  init.patches = [ ./sandbox.patch ];
7
+
6 8
   intel_fb_drv = {
7 9
     BOARD = "pc";
8 10
     portInputs = [ dde_linux ];
@@ -21,6 +23,15 @@ with ports; {
21 23
     buildInputs = with buildPackages; [ zlib ];
22 24
   };
23 25
 
26
+  # The following are tests that never exit
27
+  # and have no conventions on log output.
28
+
29
+  "test-pci".patches = [ ./test-pci.patch ];
30
+
31
+  "test-signal".patches = [ ./test-signal.patch ];
32
+
33
+  "test-vmm_x86".patches = [ ./test-vmm_x86.patch ];
34
+
24 35
   usb_drv.portInputs = [ dde_linux ];
25 36
 
26 37
   vbox5 = {

+ 10
- 0
packages/genodelabs/test-pci.patch View File

@@ -0,0 +1,10 @@
1
+diff --git a/repos/os/src/test/pci/test.cc b/repos/os/src/test/pci/test.cc
2
+index c6d9e2012b..050de6136c 100644
3
+--- a/repos/os/src/test/pci/test.cc
4
++++ b/repos/os/src/test/pci/test.cc
5
+@@ -92,4 +92,5 @@ void Component::construct(Genode::Env &env)
6
+ 	pci.release_device(prev_device_cap);
7
+ 
8
+ 	log("--- Platform test finished ---");
9
++	env.parent().exit(0);
10
+ }

+ 12
- 0
packages/genodelabs/test-signal.patch View File

@@ -0,0 +1,12 @@
1
+diff --git a/repos/os/src/test/signal/main.cc b/repos/os/src/test/signal/main.cc
2
+index 4e16765ada..88769a2399 100644
3
+--- a/repos/os/src/test/signal/main.cc
4
++++ b/repos/os/src/test/signal/main.cc
5
+@@ -693,6 +693,7 @@ struct Main
6
+ 	{
7
+ 		test_8.destruct();
8
+ 		log("--- Signalling test finished ---");
9
++		env.parent().exit(0);
10
+ 	}
11
+ 
12
+ 	Main(Env &env) : env(env)

+ 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
+ 		{

+ 45
- 25
tests/default.nix View File

@@ -1,13 +1,8 @@
1 1
 # SPDX-License-Identifier: CC0-1.0
2 2
 
3
-let
4
-  tests = call:
5
-    {
6
-      log = call ./log.nix { };
7
-      signal = call ./signal.nix { };
8
-    } // call ./solo5 { };
3
+let tests = call: { log = call ./log.nix { }; };
9 4
 
10
-in { apps, buildPackages, depot, genodepkgs, lib, nixpkgs }:
5
+in { self, apps, buildPackages, depot, genodepkgs, lib, nixpkgs }:
11 6
 
12 7
 let
13 8
   testPkgs = genodepkgs;
@@ -32,18 +27,17 @@ let
32 27
     ((tests call) // {
33 28
       driver_manager = call ./driver_manager.nix { };
34 29
       noux = call ./noux.nix { };
35
-      pci = call ./pci.nix { };
36
-      rtc = call ./rtc.nix { };
37
-    })) (import ./driver-nova.nix {
30
+      vmm = call ./vmm_x86.nix { };
31
+      x86 = call ./x86.nix { };
32
+    } // call ./solo5 { })) (import ./driver-nova.nix {
38 33
       inherit apps addManifest buildPackages depot lib nixpkgs testPkgs;
39 34
     }).callTest;
40 35
 
41 36
   hw = (call:
42 37
     ((tests call) // {
43 38
       # noux = call ./noux.nix { };
44
-      pci = call ./pci.nix { };
45
-      rtc = call ./rtc.nix { };
46
-    })) (import ./driver-hw.nix {
39
+      x86 = call ./x86.nix { };
40
+    } // call ./solo5 { })) (import ./driver-hw.nix {
47 41
       inherit apps addManifest buildPackages depot lib nixpkgs testPkgs;
48 42
     }).callTest;
49 43
 
@@ -53,17 +47,43 @@ let
53 47
       value = test;
54 48
     }) (builtins.attrValues tests);
55 49
 
56
-  hw-sotest = map ({ name, value }: {
57
-    name = name + "-sotest";
58
-    value = value.sotest;
59
-  }) (builtins.filter ({ name, value }: !isNull value.sotest) (testsToList hw));
50
+in with builtins;
51
+listToAttrs ((concatLists (map (testsToList) [ linux hw nova ]))) // {
52
+  sotest = let
53
+    hwTests = [ hw.multi hw.x86 ];
54
+    novaTests = [ nova.multi nova.x86 nova.vmm ];
55
+    allTests = hwTests ++ novaTests;
60 56
 
61
-  nova-sotest = map ({ name, value }: {
62
-    name = name + "-sotest";
63
-    value = value.sotest;
64
-  }) (builtins.filter ({ name, value }: !isNull value.sotest)
65
-    (testsToList nova));
57
+    projectCfg.boot_items =
66 58
 
67
-in with builtins;
68
-listToAttrs ((concatLists (map (testsToList) [ linux hw nova ])) ++ hw-sotest
69
-  ++ nova-sotest)
59
+      (map (test: {
60
+        inherit (test) name;
61
+        exec = "bender";
62
+        load = [ test.image.name ];
63
+      }) hwTests)
64
+
65
+      ++ (map (test: {
66
+        inherit (test) name;
67
+        exec = "bender";
68
+        load = [ "hypervisor serial novga iommu" test.image.name ];
69
+      }) novaTests);
70
+
71
+  in buildPackages.stdenv.mkDerivation {
72
+    pname = "sotest";
73
+    version = self.lastModified;
74
+    buildCommand = ''
75
+      mkdir zip; cd zip
76
+      cp "${testPkgs.bender}" bender
77
+      cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
78
+      ${concatStringsSep "\n"
79
+      (map (test: "cp ${test.image} ${test.image.name}") allTests)}
80
+      mkdir -p $out/nix-support
81
+      ${buildPackages.zip}/bin/zip "$out/binaries.zip" *
82
+      cat << EOF > "$out/project.json"
83
+      ${builtins.toJSON projectCfg}
84
+      EOF
85
+      echo file sotest-binaries $out/binaries.zip >> "$out/nix-support/hydra-build-products"
86
+      echo file sotest-config $out/project.json >> "$out/nix-support/hydra-build-products"
87
+    '';
88
+  };
89
+}

+ 6
- 21
tests/driver-hw.nix View File

@@ -35,20 +35,21 @@ let
35 35
     };
36 36
 
37 37
   defaultScript =
38
-    ''run_genode_until {[init] child "harness" exited with exit value 0} 60'';
38
+    ''run_genode_until {child "init" exited with exit value 0} 120'';
39 39
 
40 40
   mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
41
-    , testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], sotest ? false, ... }@t:
41
+    , testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], ... }@t:
42 42
     let
43
-      manifest = lib.mergeManifests (map addManifest
44
-        (with testPkgs; [ base-hw-pc init sotest-producer ] ++ testInputs));
43
+      manifest = lib.mergeManifests (map addManifest (with testPkgs;
44
+        [ base-hw-pc sotest-producer ]
45
+        ++ map genodeSources.depot [ "init" "rtc_drv" ] ++ testInputs));
45 46
       testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
46 47
       testEnv' = {
47 48
         DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
48 49
         DHALL_GENODE_TEST = "${./test.dhall}";
49 50
       } // testEnv;
50 51
 
51
-      image = lib.hwImage name testEnv' testConfig';
52
+      image = lib.hwImage ("hw-" + name) testEnv' testConfig';
52 53
 
53 54
       baseSetup = ''
54 55
         ##
@@ -141,22 +142,6 @@ let
141 142
       xml = buildPackages.runCommand (name + ".config") testEnv'
142 143
         ''${apps.render-init.program} <<< "(${testConfig'}).config" > $out'';
143 144
 
144
-      sotest = if sotest then
145
-        buildPackages.runCommand "hw-${name}-sotest" testEnv' ''
146
-          cp "${testPkgs.bender}" bender
147
-          cp ${image} image.elf
148
-          mkdir -p $out/nix-support
149
-          ${buildPackages.zip}/bin/zip "$out/binaries.zip" \
150
-            image.elf
151
-          ${apps.dhall-to-yaml.program} < ${
152
-            ./sotest_hw_config.dhall
153
-          } > "$out/sotest_config.yaml"
154
-          echo file sotest-binaries $out/binaries.zip >> "$out/nix-support/hydra-build-products"
155
-          echo file sotest-config $out/sotest_config.yaml >> "$out/nix-support/hydra-build-products"
156
-        ''
157
-      else
158
-        null;
159
-
160 145
     };
161 146
 
162 147
 in {

+ 7
- 24
tests/driver-nova.nix View File

@@ -35,21 +35,21 @@ let
35 35
     };
36 36
 
37 37
   defaultScript =
38
-    ''run_genode_until {[init] child "harness" exited with exit value 0} 60'';
38
+    ''run_genode_until {child "init" exited with exit value 0} 120'';
39 39
 
40 40
   mkTest = { name ? "unamed", testScript ? defaultScript, testConfig
41
-    , testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], sotest ? false, ... }@t:
41
+    , testInputs ? [ ], testEnv ? { }, qemuArgs ? [ ], ... }@t:
42 42
     let
43 43
       manifest = lib.mergeManifests (map addManifest (with testPkgs;
44
-        [ base-nova (genodeSources.make "init") sotest-producer ]
45
-        ++ testInputs));
44
+        [ base-nova sotest-producer ]
45
+        ++ map genodeSources.depot [ "init" "rtc_drv" ] ++ testInputs));
46 46
       testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
47 47
       testEnv' = {
48 48
         DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
49 49
         DHALL_GENODE_TEST = "${./test.dhall}";
50 50
       } // testEnv;
51 51
 
52
-      image = lib.novaImage name testEnv' testConfig';
52
+      image = lib.novaImage ("nova-" + name) testEnv' testConfig';
53 53
       build = lib.compileBoot name testEnv' testConfig';
54 54
 
55 55
       baseSetup = ''
@@ -93,7 +93,8 @@ let
93 93
           global spawn_id
94 94
           set TEST_MIB [expr (([file size ${image}] + $env(TEST_RAM)) >> 20) + 24]
95 95
           spawn ${buildPackages.qemu_test}/bin/qemu-system-x86_64 \
96
-            -machine q35 -serial mon:stdio -nographic \
96
+            -machine q35 -cpu phenom -smp 2 \
97
+            -serial mon:stdio -nographic \
97 98
             -m size=$TEST_MIB \
98 99
             -kernel "${testPkgs.bender}" \
99 100
             -initrd "${testPkgs.NOVA}/hypervisor-x86_64 arg=iommu novpid serial,${image}" \
@@ -142,24 +143,6 @@ let
142 143
       compile = lib.compileBoot name testConfig';
143 144
 
144 145
       iso = apps.nova-iso.function testEnv' "${testConfig'}";
145
-
146
-      sotest = if sotest then
147
-        buildPackages.runCommand "nova-${name}-sotest" testEnv' ''
148
-          cp "${testPkgs.bender}" bender
149
-          cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
150
-          cp ${image} image.elf
151
-          mkdir -p $out/nix-support
152
-          ${buildPackages.zip}/bin/zip "$out/binaries.zip" \
153
-            hypervisor image.elf
154
-          ${apps.dhall-to-yaml.program} < ${
155
-            ./sotest_nova_config.dhall
156
-          } > "$out/sotest_config.yaml"
157
-          echo file sotest-binaries $out/binaries.zip >> "$out/nix-support/hydra-build-products"
158
-          echo file sotest-config $out/sotest_config.yaml >> "$out/nix-support/hydra-build-products"
159
-        ''
160
-      else
161
-        null;
162
-
163 146
     };
164 147
 
165 148
 in {

+ 0
- 1
tests/driver_manager.nix View File

@@ -19,7 +19,6 @@ testEnv.mkTest {
19 19
     "ps2_drv"
20 20
     "report_rom"
21 21
     "rom_reporter"
22
-    "rtc_drv"
23 22
     "usb_drv"
24 23
     "vesa_drv"
25 24
   ]) ++ (map pkgs.genodeSources.make [ "test/driver_manager" ]);

+ 0
- 17
tests/pci.nix View File

@@ -1,17 +0,0 @@
1
-# SPDX-License-Identifier: CC0-1.0
2
-
3
-{ testEnv, pkgs, ... }:
4
-with pkgs;
5
-
6
-testEnv.mkTest {
7
-  name = "pci";
8
-  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
9
-
10
-  testConfig = ./pci.dhall;
11
-  testInputs =
12
-    (map pkgs.genodeSources.depot [ "acpi_drv" "platform_drv" "report_rom" ])
13
-    ++ (map pkgs.genodeSources.make [ "test/pci" ]);
14
-  testScript = ''
15
-    run_genode_until ".*--- Platform test finished ---.*\n" 60
16
-  '';
17
-}

+ 0
- 31
tests/rtc.dhall View File

@@ -1,32 +0,0 @@
1
-
2
-let Test = ./test.dhall ? env:DHALL_GENODE_TEST
3
-
4
-let Genode = Test.Genode
5
-
6
-let Child = Genode.Init.Child
7
-
8
-let init =
9
-      Genode.Init::{
10
-      , children = toMap
11
-          { test-rtc =
12
-              Child.flat
13
-                Child.Attributes::{
14
-                , binary = "test-rtc"
15
-                , exitPropagate = True
16
-                , routes =
17
-                  [ Genode.Init.ServiceRoute.parent "Timer"
18
-                  , Genode.Init.ServiceRoute.child "Rtc" "rtc_drv"
19
-                  ]
20
-                }
21
-          , rtc_drv =
22
-              Child.flat
23
-                Child.Attributes::{
24
-                , binary = "rtc_drv"
25
-                , provides = [ "Rtc" ]
26
-                , routes = [ Genode.Init.ServiceRoute.parent "IO_PORT" ]
27
-                }
28
-          }
29
-      }
30
-
31
-in  Test::{ children = Test.initToChildren init }

+ 0
- 13
tests/rtc.nix View File

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

+ 0
- 25
tests/signal.dhall View File

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

+ 0
- 13
tests/signal.nix View File

@@ -1,13 +0,0 @@
1
-# SPDX-License-Identifier: CC0-1.0
2
-
3
-{ testEnv, pkgs, ... }:
4
-with pkgs;
5
-
6
-testEnv.mkTest rec {
7
-  name = "signal";
8
-  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
9
-
10
-  testConfig = ./signal.dhall;
11
-  testInputs = [ (pkgs.genodeSources.depot "test-signal") ];
12
-  testScript = "run_genode_until {--- Signalling test finished ---} 120";
13
-}

+ 0
- 2
tests/solo5/default.nix View File

@@ -29,14 +29,12 @@ let
29 29
   tests = [
30 30
     {
31 31
       name = "multi";
32
-      sotest = true;
33 32
       testConfig = "${./.}/solo5.dhall";
34 33
       testInputs = map genodeMake [ "app/ping" ] ++ (map genodeDepot [
35 34
         "ram_block"
36 35
         "nic_bridge"
37 36
         "nic_loopback"
38 37
         "sequence"
39
-        "rtc_drv"
40 38
       ]);
41 39
     }
42 40
 

+ 11
- 0
tests/test-wrapper.dhall View File

@@ -30,7 +30,9 @@ let wrapHarness
30 30
             , Init.ServiceRoute.parent "IO_MEM"
31 31
             , Init.ServiceRoute.parent "IO_PORT"
32 32
             , Init.ServiceRoute.parent "IRQ"
33
+            , Init.ServiceRoute.parent "VM"
33 34
             , Init.ServiceRoute.child "Timer" "timer"
35
+            , Init.ServiceRoute.child "Rtc" "rtc"
34 36
             ]
35 37
           }
36 38
 
@@ -47,6 +49,15 @@ in    λ(test : Test.Type)
47 49
                   , provides = [ "Timer" ]
48 50
                   }
49 51
             }
52
+          , { mapKey = "rtc"
53
+            , mapValue =
54
+                Child.flat
55
+                  Child.Attributes::{
56
+                  , binary = "rtc_drv"
57
+                  , provides = [ "Rtc" ]
58
+                  , routes = [ Init.ServiceRoute.parent "IO_PORT" ]
59
+                  }
60
+            }
50 61
           , { mapKey = "harness", mapValue = wrapHarness test.children }
51 62
           ]
52 63
         }

+ 1
- 0
tests/test.dhall View File

@@ -25,6 +25,7 @@ in  { Genode = Genode
25 25
                     , Init.ServiceRoute.parent "IO_MEM"
26 26
                     , Init.ServiceRoute.parent "IO_PORT"
27 27
                     , Init.ServiceRoute.parent "IRQ"
28
+                    , Init.ServiceRoute.parent "VM"
28 29
                     , Init.ServiceRoute.child "Timer" "timer"
29 30
                     ]
30 31
                   }

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

tests/pci.dhall → tests/x86.dhall View File

@@ -16,7 +16,27 @@ let ServiceRoute = Init.ServiceRoute
16 16
 
17 17
 let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
18 18
 
19
-let init =
19
+let signal =
20
+      Child.flat
21
+        Child.Attributes::{
22
+        , binary = "test-signal"
23
+        , exitPropagate = True
24
+        , priority = 5
25
+        , resources = Init.Resources::{ caps = 500, ram = Genode.units.MiB 10 }
26
+        , routes = [ Init.ServiceRoute.parent "Timer" ]
27
+        }
28
+
29
+let rtc =
30
+      Child.flat
31
+        Child.Attributes::{
32
+        , binary = "test-rtc"
33
+        , routes =
34
+          [ Genode.Init.ServiceRoute.parent "Timer"
35
+          , Genode.Init.ServiceRoute.parent "Rtc"
36
+          ]
37
+        }
38
+
39
+let pciInit =
20 40
       Init::{
21 41
       , verbose = True
22 42
       , children = toMap
@@ -74,4 +94,10 @@ let init =
74 94
           }
75 95
       }
76 96
 
77
-in  Test::{ children = Test.initToChildren init }
97
+in  Test::{
98
+    , children =
99
+          [ { mapKey = "signal", mapValue = signal }
100
+          , { mapKey = "rtc", mapValue = rtc }
101
+          ]
102
+        # Test.initToChildren pciInit
103
+    }

+ 17
- 0
tests/x86.nix View File

@@ -0,0 +1,17 @@
1
+# SPDX-License-Identifier: CC0-1.0
2
+
3
+{ testEnv, pkgs, ... }:
4
+with pkgs;
5
+
6
+testEnv.mkTest {
7
+  name = "x86";
8
+  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
9
+
10
+  testConfig = ./x86.dhall;
11
+  testInputs = (map pkgs.genodeSources.depot [
12
+    "acpi_drv"
13
+    "platform_drv"
14
+    "report_rom"
15
+    "test-signal"
16
+  ]) ++ (map pkgs.genodeSources.make [ "test/pci" "test/rtc" ]);
17
+}

Loading…
Cancel
Save