WiP! tox-bootstrapd test
This commit is contained in:
parent
f53eb6cd3b
commit
ed9be0bb76
|
@ -72,12 +72,21 @@ in {
|
||||||
genodeSources =
|
genodeSources =
|
||||||
buildPackages.callPackage ../packages/genodelabs { inherit flake; };
|
buildPackages.callPackage ../packages/genodelabs { inherit flake; };
|
||||||
|
|
||||||
|
libconfig = overrideHostAttrs libconfig
|
||||||
|
(attrs: { configureFlags = [ "--disable-examples" ]; });
|
||||||
|
|
||||||
libcCrossChooser = name:
|
libcCrossChooser = name:
|
||||||
if stdenv.targetPlatform.isGenode then
|
if stdenv.targetPlatform.isGenode then
|
||||||
targetPackages.genodeLibcCross
|
targetPackages.genodeLibcCross
|
||||||
else
|
else
|
||||||
prev.libcCrossChooser name;
|
prev.libcCrossChooser name;
|
||||||
|
|
||||||
|
libtoxcore = overrideHost libtoxcore {
|
||||||
|
libopus = null;
|
||||||
|
libvpx = null;
|
||||||
|
ncurses = null;
|
||||||
|
};
|
||||||
|
|
||||||
llvmPackages_8 = callPackage ./llvm-8 ({
|
llvmPackages_8 = callPackage ./llvm-8 ({
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
inherit (targetPackages.genodeSources) genodeBase;
|
inherit (targetPackages.genodeSources) genodeBase;
|
||||||
|
|
|
@ -8,9 +8,14 @@ let
|
||||||
inherit nixpkgs localPackages legacyPackages;
|
inherit nixpkgs localPackages legacyPackages;
|
||||||
};
|
};
|
||||||
|
|
||||||
testFiles =
|
testFiles = map callTest [
|
||||||
map callTest [ ./log.nix ./posix.nix ./vmm_arm.nix ./vmm_x86.nix ./x86.nix ]
|
./log.nix
|
||||||
++ (callTest ./solo5);
|
./posix.nix
|
||||||
|
./tox-bootstrapd.nix
|
||||||
|
./vmm_arm.nix
|
||||||
|
./vmm_x86.nix
|
||||||
|
./x86.nix
|
||||||
|
] ++ (callTest ./solo5);
|
||||||
|
|
||||||
testPkgs = genodepkgs;
|
testPkgs = genodepkgs;
|
||||||
|
|
||||||
|
|
127
tests/tox-bootstrapd.dhall
Normal file
127
tests/tox-bootstrapd.dhall
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
let Test = ./test.dhall ? env:DHALL_GENODE_TEST
|
||||||
|
|
||||||
|
let Genode = Test.Genode
|
||||||
|
|
||||||
|
let Prelude = Genode.Prelude
|
||||||
|
|
||||||
|
let XML = Prelude.XML
|
||||||
|
|
||||||
|
let Init = Genode.Init
|
||||||
|
|
||||||
|
let Child = Init.Child
|
||||||
|
|
||||||
|
let Resources = Init.Resources
|
||||||
|
|
||||||
|
let ServiceRoute = Init.ServiceRoute
|
||||||
|
|
||||||
|
let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
|
||||||
|
|
||||||
|
let toArgsXML =
|
||||||
|
Prelude.List.map
|
||||||
|
Text
|
||||||
|
XML.Type
|
||||||
|
( λ(value : Text) →
|
||||||
|
XML.leaf { name = "arg", attributes = toMap { value } }
|
||||||
|
)
|
||||||
|
|
||||||
|
let tox-bootstrap =
|
||||||
|
Init::{
|
||||||
|
, verbose = True
|
||||||
|
, routes =
|
||||||
|
[ ServiceRoute.parent "Timer"
|
||||||
|
, ServiceRoute.child "Platform" "platform_drv"
|
||||||
|
]
|
||||||
|
, children = toMap
|
||||||
|
{ tox-bootstrapd =
|
||||||
|
Child.flat
|
||||||
|
Child.Attributes::{
|
||||||
|
, binary = "tox-bootstrapd"
|
||||||
|
, exitPropagate = True
|
||||||
|
, resources = Resources::{ ram = Genode.units.MiB 16 }
|
||||||
|
, config = Init.Config::{
|
||||||
|
, content =
|
||||||
|
[ XML.text
|
||||||
|
''
|
||||||
|
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
|
||||||
|
<vfs>
|
||||||
|
<dir name="dev"> <log/> <null/> </dir>
|
||||||
|
<dir name="socket"> <lwip/> </dir>
|
||||||
|
<inline name="config">
|
||||||
|
enable_motd = true
|
||||||
|
motd = "Genode Tox bootstrapd test"
|
||||||
|
</inline>
|
||||||
|
<ram/>
|
||||||
|
</vfs>
|
||||||
|
''
|
||||||
|
]
|
||||||
|
# toArgsXML
|
||||||
|
[ "tox-bootstrapd"
|
||||||
|
, "--config=/config"
|
||||||
|
, "--foreground"
|
||||||
|
, "--log-backend=stdout"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
, routes = [ ServiceRoute.child "Nic" "nic_drv" ]
|
||||||
|
}
|
||||||
|
, nic_drv =
|
||||||
|
Child.flat
|
||||||
|
Child.Attributes::{
|
||||||
|
, binary = "ipxe_nic_drv"
|
||||||
|
, provides = [ "Nic" ]
|
||||||
|
, resources = Init.Resources::{
|
||||||
|
, caps = 128
|
||||||
|
, ram = Genode.units.MiB 4
|
||||||
|
}
|
||||||
|
, routes = [ ServiceRoute.child "Platform" "platform_drv" ]
|
||||||
|
}
|
||||||
|
, acpi_drv =
|
||||||
|
Child.flat
|
||||||
|
Child.Attributes::{
|
||||||
|
, binary = "acpi_drv"
|
||||||
|
, resources = Resources::{
|
||||||
|
, caps = 400
|
||||||
|
, ram = Genode.units.MiB 4
|
||||||
|
, constrainPhys = True
|
||||||
|
}
|
||||||
|
, provides = [ "Platform", "Acpi" ]
|
||||||
|
, romReports = [ label "acpi", label "smbios_table" ]
|
||||||
|
, routes =
|
||||||
|
[ ServiceRoute.parent "IRQ"
|
||||||
|
, ServiceRoute.parent "IO_MEM"
|
||||||
|
, ServiceRoute.parent "IO_PORT"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
, platform_drv =
|
||||||
|
Child.flat
|
||||||
|
Child.Attributes::{
|
||||||
|
, binary = "platform_drv"
|
||||||
|
, resources = Resources::{
|
||||||
|
, caps = 800
|
||||||
|
, ram = Genode.units.MiB 4
|
||||||
|
, constrainPhys = True
|
||||||
|
}
|
||||||
|
, reportRoms = [ label "acpi" ]
|
||||||
|
, provides = [ "Platform", "Acpi" ]
|
||||||
|
, routes =
|
||||||
|
[ ServiceRoute.parent "IRQ"
|
||||||
|
, ServiceRoute.parent "IO_MEM"
|
||||||
|
, ServiceRoute.parent "IO_PORT"
|
||||||
|
]
|
||||||
|
, config = Init.Config::{
|
||||||
|
, policies =
|
||||||
|
[ Init.Config.Policy::{
|
||||||
|
, label = Init.LabelSelector.prefix "nic_drv"
|
||||||
|
, content =
|
||||||
|
[ XML.leaf
|
||||||
|
{ name = "pci"
|
||||||
|
, attributes = toMap { class = "ETHERNET" }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
in Test::{ children = Test.initToChildren tox-bootstrap }
|
18
tests/tox-bootstrapd.nix
Normal file
18
tests/tox-bootstrapd.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ pkgs, legacyPackages, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "tox-bootstrapd";
|
||||||
|
constraints = builtins.any (spec: spec == "x86");
|
||||||
|
machine = {
|
||||||
|
config = ./tox-bootstrapd.dhall;
|
||||||
|
inputs = map pkgs.genodeSources.depot [
|
||||||
|
"acpi_drv"
|
||||||
|
"ipxe_nic_drv"
|
||||||
|
"libc"
|
||||||
|
"platform_drv"
|
||||||
|
"posix"
|
||||||
|
"report_rom"
|
||||||
|
"vfs_lwip"
|
||||||
|
] ++ (with legacyPackages; [ libtoxcore ]);
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user