2
0
Fork 0

Add vmm_arm test

This commit is contained in:
Emery Hemingway 2020-06-03 19:44:18 +05:30
parent dac3650ef5
commit f939ff7d39
4 changed files with 153 additions and 2 deletions

View File

@ -10,7 +10,8 @@ let
inherit nixpkgs localPackages legacyPackages; inherit nixpkgs localPackages legacyPackages;
}; };
testFiles = map callTest [ ./log.nix ./posix.nix ./vmm_x86.nix ./x86.nix ] testFiles =
map callTest [ ./log.nix ./posix.nix ./vmm_arm.nix ./vmm_x86.nix ./x86.nix ]
++ (callTest ./solo5); ++ (callTest ./solo5);
testPkgs = genodepkgs; testPkgs = genodepkgs;

99
tests/vmm_arm.dhall Normal file
View File

@ -0,0 +1,99 @@
-- SPDX-License-Identifier: CC0-1.0
let Test = ./test.dhall ? env:DHALL_GENODE_TEST
let Genode = Test.Genode
let XML = Genode.Prelude.XML
let Init = Genode.Init
let ServiceRoute = Init.ServiceRoute
let Child = Init.Child
in λ(guest : { linux : Text, dtb : Text, initrd : Text })
→ let init =
Init::{
, children = toMap
{ nic =
Child.flat
Child.Attributes::{
, binary = "nic_router"
, config = Init.Config::{
, content =
[ XML.leaf
{ name = "default-policy"
, attributes = toMap { domain = "default" }
}
, XML.element
{ name = "domain"
, attributes = toMap
{ name = "default"
, interface = "10.0.1.1/24"
}
, content =
[ XML.leaf
{ name = "dhcp-server"
, attributes = toMap
{ ip_first = "10.0.1.2"
, ip_last = "10.0.1.254"
}
}
]
}
]
}
, provides = [ "Nic" ]
, resources = Init.Resources::{ ram = Genode.units.MiB 8 }
}
, earlycon =
Child.flat
Child.Attributes::{
, binary = "log_terminal"
, provides = [ "Terminal" ]
}
, terminal_crosslink =
Child.flat
Child.Attributes::{
, binary = "terminal_crosslink"
, provides = [ "Terminal" ]
}
, vmm =
Child.flat
Child.Attributes::{
, binary = "vmm"
, resources = Init.Resources::{
, caps = 256
, ram = Genode.units.MiB 256
}
, routes =
[ ServiceRoute.parent "VM"
, ServiceRoute.child "Nic" "nic"
, ServiceRoute.childLabel
"Terminal"
"earlycon"
(Some "earlycon")
(None Text)
, ServiceRoute.child "Terminal" "terminal_crosslink"
]
}
, vm =
Child.flat
Child.Attributes::{
, binary = "test-terminal_expect_send"
, config = Init.Config::{
, attributes = toMap
{ expect = "/ #", send = "ls", verbose = "yes" }
}
, routes =
[ ServiceRoute.child "Terminal" "terminal_crosslink" ]
}
}
, routes = [ ServiceRoute.parent "Timer" ]
}
in Test::{
, children = Test.initToChildren init
, rom = Genode.Boot.toRomPaths (toMap guest)
}

51
tests/vmm_arm.nix Normal file
View File

@ -0,0 +1,51 @@
# SPDX-License-Identifier: CC0-1.0
{ pkgs, localPackages, ... }:
{
name = "vmm_arm";
constraints = specs:
with builtins;
all (f: any f specs) [ (spec: spec == "aarch64") ];
machine = {
config = with localPackages;
let
linux = fetchurl {
url = "http://genode.org/files/release-20.02/linux-arm64";
hash = "sha256-H6FhNGgkApouy+PyjxrgAPnJSc4BIlWlpg+VhWiUI6o=";
};
dtb = fetchurl {
url = "http://genode.org/files/release-20.02/dtb-arm64-virt";
hash = "sha256-MFzwYtjAmR/V3WLkmWojYhi3aPrzEqsy1kA46Y512UM=";
};
initrd = fetchurl {
url = "http://genode.org/files/release-20.02/initrd-arm64";
hash = "sha256-iOKd2X2zgDIGeuLEDSSTLSw/Ywi7mDET36J1NAqgqls=";
};
guest = writeText "guest.dhall" ''
{ linux = "${linux}", dtb = "${dtb}", initrd = "${initrd}" }
'';
in "${./vmm_arm.dhall} ${guest}";
inputs = with pkgs;
let
vmm' = genodeSources.buildUpstream {
name = "vmm_arm";
targets = [ "server/vmm" ];
KERNEL = "hw";
};
in [ vmm' ] ++ map genodeSources.depot [
"log_terminal"
"nic_router"
"terminal_crosslink"
] ++ map genodeSources.make [ "test/terminal_expect_send" ];
};
testScript = ''
start_all()
machine.wait_until_serial_output("linuxrc")
'';
}

View File

@ -3,7 +3,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
name = "vmm"; name = "vmm_x86";
constraints = specs: constraints = specs:
with builtins; with builtins;
all (f: any f specs) [ (spec: spec == "nova") (spec: spec == "x86") ]; all (f: any f specs) [ (spec: spec == "nova") (spec: spec == "x86") ];