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

162 lines
4.4 KiB
Nix

{ testEnv, pkgs }:
with pkgs;
let
defaultScript = ''
run_genode_until {child "solo5" exited with exit value 0} 30
'';
mkTest' = { name, bootModules, testScript ? defaultScript, ... }@attrs:
testEnv.mkTest (attrs // {
name = "solo5-" + name;
inherit testScript;
bootModules = {
"solo5.lib.so" = "${solo5}/lib/solo5-bindings-genode/solo5.lib.so";
} // bootModules;
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
});
applyMkTest = x: {
inherit (x) name;
value = mkTest' x;
};
mkTests = testList: builtins.listToAttrs (map applyMkTest testList);
tests = [
{
name = "blk";
bootModules = {
test = "${solo5.tests}/bin/solo5-test_blk";
ram_block = "${genode-os}/bin/ram_block";
};
testConfig = testEnv.lib.renderDhallInit ./blk.dhall "{=}";
}
/* {
name = "dumpcore";
bootModules.test = "${solo5.tests}/bin/solo5-test_dumpcore";
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
*/
/* {
name = "exception";
bootModules.test = "${solo5.tests}/bin/solo5-test_exception";
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
*/
{
name = "fpu";
bootModules.test = "${solo5.tests}/bin/solo5-test_fpu";
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
{
name = "globals";
bootModules.test = "${solo5.tests}/bin/solo5-test_globals";
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
{
name = "hello";
bootModules.test = "${solo5.tests}/bin/solo5-test_hello";
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
/* {
name = "mft_maxdevices";
bootModules = {
test = "${solo5.tests}/bin/solo5-test_mft_maxdevices";
rom_block = "${genode-os}/bin/rom_block";
};
testConfig = testEnv.lib.renderDhallInit ./mft_maxdevices.dhall "{=}";
}
*/
{
name = "net";
bootModules = {
test = "${solo5.tests}/bin/solo5-test_net";
nic_bridge = "${genode-os}/bin/nic_bridge";
nic_loopback = "${genode-os}/bin/nic_loopback";
ping = "${genode-os}/bin/ping";
};
testConfig = testEnv.lib.renderDhallInit ./net.dhall "{=}";
testScript = ''
run_genode_until {child "ping" exited with exit value 0} 30
'';
}
{
name = "net_2if";
bootModules = {
test = "${solo5.tests}/bin/solo5-test_net_2if";
sequence = "${genode-os}/bin/sequence";
nic_bridge = "${genode-os}/bin/nic_bridge";
nic_loopback = "${genode-os}/bin/nic_loopback";
ping = "${genode-os}/bin/ping";
};
testConfig = testEnv.lib.renderDhallInit ./net_2if.dhall "{=}";
testScript = ''
run_genode_until {child "clients" exited with exit value 0} 30
'';
qemuMem = 64;
}
/* {
name = "notls";
bootModules = { test = "${solo5.tests}/bin/solo5-test_notls"; };
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
*/
{
name = "quiet";
bootModules = { test = "${solo5.tests}/bin/solo5-test_quiet"; };
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
{
name = "ssp";
bootModules = { test = "${solo5.tests}/bin/solo5-test_ssp"; };
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
testScript = ''
run_genode_until {Error: stack protector check failed} 30
'';
}
/* {
name = "wnox";
bootModules = { test = "${solo5.tests}/bin/solo5-test_wnox"; };
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
*/
/* {
name = "xnow";
bootModules = { test = "${solo5.tests}/bin/solo5-test_xnow"; };
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
*/
/* {
name = "zeropage";
bootModules = { test = "${solo5.tests}/bin/solo5-test_zeropage"; };
testConfig = testEnv.lib.renderDhallInit ./simple.dhall "{=}";
}
*/
] ++ (testEnv.lib.optional (!testEnv.isLinux) {
name = "time";
bootModules = {
test = "${solo5.tests}/bin/solo5-test_time";
rtc_drv = "${genode-os}/bin/rtc_drv";
};
testConfig = testEnv.lib.renderDhallInit ./time.dhall "{=}";
}
);
in mkTests tests