2
0
Fork 0
genodepkgs/tests/solo5/default.nix

92 lines
1.8 KiB
Nix

# SPDX-License-Identifier: CC0-1.0
{ testEnv, pkgs, ... }:
with pkgs;
let
defaultScript = ''
run_genode_until {SUCCESS} 30
'';
mkTest' = { name, testConfig, testScript ? defaultScript, testInputs ? [ ]
, ... }@attrs:
testEnv.mkTest (attrs // {
name = "solo5-" + name;
inherit testConfig testScript;
testInputs = [ pkgs.solo5 pkgs.solo5.tests ] ++ testInputs;
});
applyMkTest = x: {
inherit (x) name;
value = mkTest' x;
};
mkTests = testList: builtins.listToAttrs (map applyMkTest testList);
toSimple = name: ''(${./simple.dhall} \"solo5-test_${name}\")'';
makeGenode = pkgs.genodeSources.make;
tests = [
{
name = "blk";
testConfig = ./blk.dhall;
testInputs = [ (makeGenode "server/ram_block") ];
}
{
name = "fpu";
testConfig = toSimple "fpu";
}
{
name = "globals";
testConfig = toSimple "globals";
}
{
name = "hello";
testConfig = toSimple "hello";
}
{
name = "net";
testConfig = ./net.dhall;
testInputs =
map makeGenode [ "app/ping" "server/nic_bridge" "server/nic_loopback" ];
}
{
name = "net_2if";
testConfig = ./net_2if.dhall;
testInputs = map makeGenode [
"app/ping"
"app/sequence"
"server/nic_bridge"
"server/nic_loopback"
];
}
{
name = "quiet";
testConfig = toSimple "quiet";
}
{
name = "ssp";
testConfig = toSimple "ssp";
testScript = ''
run_genode_until {Error: stack protector check failed} 30
'';
}
] ++ (testEnv.lib.optional (!testEnv.isLinux) {
name = "time";
testConfig = ./time.dhall;
testInputs = [ (makeGenode "drivers/rtc") ];
}
);
in mkTests tests