2
0
Fork 0

Add simple noux test

This commit is contained in:
Ehmry - 2020-01-25 18:14:18 +01:00
parent 093430d8f9
commit 66db226f44
4 changed files with 74 additions and 2 deletions

View File

@ -13,7 +13,7 @@ in { self, apps, system, localSystem, crossSystem, genodepkgs, nixpkgs
let let
hostPkgs = import nixpkgs { system = localSystem; }; hostPkgs = import nixpkgs { system = localSystem; };
depot = builtins.getAttr crossSystem genode-depot.packages; depot = genode-depot.packages.${system};
testPkgs = genodepkgs; testPkgs = genodepkgs;
linux = tests (import ./driver-linux.nix { linux = tests (import ./driver-linux.nix {
@ -22,6 +22,7 @@ let
nova = (call: nova = (call:
((tests call) // { ((tests call) // {
noux = call ./noux.nix { };
pci = call ./pci.nix { }; pci = call ./pci.nix { };
rtc = call ./rtc.nix { }; rtc = call ./rtc.nix { };
})) (import ./driver-nova.nix { })) (import ./driver-nova.nix {

View File

@ -34,7 +34,9 @@ let
''; '';
}; };
mkTest = { name ? "unamed", testScript, testConfig, testInputs ? [ ] defaultScript = ''run_genode_until {child "init" exited with exit value 0} 60'';
mkTest = { name ? "unamed", testScript ? defaultScript, testConfig, testInputs ? [ ]
, env ? { }, qemuMem ? 32, ... # TODO: remove ... , env ? { }, qemuMem ? 32, ... # TODO: remove ...
}@t: }@t:
let let

51
tests/noux.dhall Normal file
View File

@ -0,0 +1,51 @@
-- SPDX-License-Identifier: CC0-1.0
let Genode = env:DHALL_GENODE
in { config =
Genode.Init::{
, verbose = True
, children =
toMap
{ noux =
Genode.Init.Start::{
, binary = "noux"
, exitPropagate = True
, resources = { caps = 500, ram = Genode.units.MiB 10 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Some
( Genode.Prelude.XML.text
''
<config stdin="/script" stdout="/dev/log" stderr="/dev/log">
<fstab>
<tar name="bash-minimal.tar" />
<dir name="dev"> <log/> <null/> <zero/> </dir>
<dir name="tmp"> <ram /> </dir>
<inline name="script">
echo "hello world"
</inline>
</fstab>
<start name="/bin/bash">
<env name="TERM" value="screen" />
</start>
</config>
''
)
}
}
}
, rom =
let manifest = env:MANIFEST
in Genode.Boot.toRomPaths
[ manifest.bash-minimal.tar.bash-minimal
, manifest.libc.lib.libc
, manifest.libc.lib.libm
, manifest.ncurses.lib.ncurses
, manifest.noux.bin.noux
, manifest.noux.lib.libc_noux
, manifest.os.lib.vfs
, manifest.posix.lib.posix
]
}

18
tests/noux.nix Normal file
View File

@ -0,0 +1,18 @@
# SPDX-License-Identifier: CC0-1.0
{ testEnv, pkgs, depot, ... }:
with pkgs;
testEnv.mkTest rec {
name = "noux";
testConfig = ./noux.dhall;
testInputs = with depot; [
bash-minimal
libc
ncurses
noux
posix
];
qemuMem = 64;
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
}