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

92 lines
1.8 KiB
Nix
Raw Normal View History

2020-01-17 01:24:34 +01:00
# SPDX-License-Identifier: CC0-1.0
2020-01-14 12:16:02 +01:00
{ testEnv, pkgs, ... }:
2019-10-22 19:20:26 +02:00
with pkgs;
let
defaultScript = ''
run_genode_until {SUCCESS} 30
2019-10-22 19:20:26 +02:00
'';
mkTest' = { name, testConfig, testScript ? defaultScript, testInputs ? [ ]
, ... }@attrs:
2019-10-22 19:20:26 +02:00
testEnv.mkTest (attrs // {
name = "solo5-" + name;
inherit testConfig testScript;
testInputs = [ pkgs.solo5 pkgs.solo5.tests ] ++ testInputs;
2019-10-22 19:20:26 +02:00
});
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;
2020-01-17 19:27:04 +01:00
2019-10-22 19:20:26 +02:00
tests = [
{
name = "blk";
2020-01-17 19:27:04 +01:00
testConfig = ./blk.dhall;
testInputs = [ (makeGenode "server/ram_block") ];
2019-10-22 19:20:26 +02:00
}
{
name = "fpu";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "fpu";
2019-10-22 19:20:26 +02:00
}
{
name = "globals";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "globals";
2019-10-22 19:20:26 +02:00
}
{
name = "hello";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "hello";
2019-10-22 19:20:26 +02:00
}
{
name = "net";
2020-01-17 19:27:04 +01:00
testConfig = ./net.dhall;
testInputs =
map makeGenode [ "app/ping" "server/nic_bridge" "server/nic_loopback" ];
2019-10-22 19:20:26 +02:00
}
{
name = "net_2if";
2020-01-17 19:27:04 +01:00
testConfig = ./net_2if.dhall;
testInputs = map makeGenode [
"app/ping"
"app/sequence"
"server/nic_bridge"
"server/nic_loopback"
];
2019-10-22 19:20:26 +02:00
}
{
name = "quiet";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "quiet";
2019-10-22 19:20:26 +02:00
}
{
name = "ssp";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "ssp";
2019-10-22 19:20:26 +02:00
testScript = ''
run_genode_until {Error: stack protector check failed} 30
'';
}
] ++ (testEnv.lib.optional (!testEnv.isLinux) {
name = "time";
2020-01-17 19:27:04 +01:00
testConfig = ./time.dhall;
testInputs = [ (makeGenode "drivers/rtc") ];
2019-10-22 19:20:26 +02:00
}
);
in mkTests tests