Split Solo5 tests
This commit is contained in:
parent
1d3e849bc4
commit
4ecd77a06d
|
@ -8,8 +8,7 @@ let
|
||||||
libc = call ./libc.nix { };
|
libc = call ./libc.nix { };
|
||||||
log = call ./log.nix { };
|
log = call ./log.nix { };
|
||||||
signal = call ./signal.nix { };
|
signal = call ./signal.nix { };
|
||||||
solo5 = call ./solo5.nix { };
|
solo5 = call ./solo5 { };
|
||||||
solo5-ping = call ./solo5-ping.nix { };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in { genodepkgs ? import ./../default.nix { }, nixpkgs ? import ./../nixpkgs.nix
|
in { genodepkgs ? import ./../default.nix { }, nixpkgs ? import ./../nixpkgs.nix
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
{ testEnv, pkgs }:
|
|
||||||
with pkgs;
|
|
||||||
|
|
||||||
testEnv.mkTest rec {
|
|
||||||
name = "solo5";
|
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
|
||||||
|
|
||||||
testConfig = testEnv.lib.renderDhallInit ./solo5-ping.dhall "{=}";
|
|
||||||
|
|
||||||
bootModules = {
|
|
||||||
nic_bridge = "${genode.os}/bin/nic_bridge";
|
|
||||||
nic_loopback = "${genode.os}/bin/nic_loopback";
|
|
||||||
ping = "${genode.os}/bin/ping";
|
|
||||||
"solo5.lib.so" = "${solo5}/lib/solo5-bindings-genode/solo5.lib.so";
|
|
||||||
solo5-test_net = "${solo5.tests}/bin/solo5-test_net";
|
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
|
||||||
run_genode_until {child "ping" exited with exit value 0} 30
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
let Genode = env:DHALL_GENODE
|
|
||||||
|
|
||||||
in λ(_ : {})
|
|
||||||
→ { nic =
|
|
||||||
Genode.Init.Start.defaults
|
|
||||||
⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
|
|
||||||
, block =
|
|
||||||
Genode.Init.Start.defaults
|
|
||||||
⫽ { binary = "ram_block"
|
|
||||||
, provides = [ "Block" ]
|
|
||||||
, resources = { caps = 96, ram = Genode.units.MiB 9 }
|
|
||||||
, config =
|
|
||||||
Genode.Prelude.XML.text
|
|
||||||
''
|
|
||||||
<config size="8M" block_size="4096"/>
|
|
||||||
''
|
|
||||||
}
|
|
||||||
, test =
|
|
||||||
Genode.Init.Start.defaults
|
|
||||||
⫽ { binary = "sequence"
|
|
||||||
, resources = { caps = 256, ram = Genode.units.MiB 10 }
|
|
||||||
, routes =
|
|
||||||
[ Genode.ServiceRoute.parent "Timer"
|
|
||||||
, Genode.ServiceRoute.child "Block" "block"
|
|
||||||
, Genode.ServiceRoute.child "Nic" "nic"
|
|
||||||
]
|
|
||||||
, config =
|
|
||||||
Genode.Prelude.XML.text
|
|
||||||
''
|
|
||||||
<config>
|
|
||||||
<start name="solo5-test_hello">
|
|
||||||
<config>
|
|
||||||
<cmdline>Hello_Solo5</cmdline>
|
|
||||||
<nic/> <blk/>
|
|
||||||
</config>
|
|
||||||
</start>
|
|
||||||
<start name="solo5-test_fpu"/>
|
|
||||||
<start name="solo5-test_globals"/>
|
|
||||||
<start name="solo5-test_quiet"/>
|
|
||||||
<start name="solo5-test_blk"/>
|
|
||||||
<start name="solo5-test_ssp"/>
|
|
||||||
</config>
|
|
||||||
''
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{ testEnv, pkgs }:
|
|
||||||
with pkgs;
|
|
||||||
|
|
||||||
testEnv.mkTest rec {
|
|
||||||
name = "solo5";
|
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
|
||||||
|
|
||||||
testConfig = testEnv.lib.renderDhallInit ./solo5.dhall "{=}";
|
|
||||||
|
|
||||||
bootModules = {
|
|
||||||
sequence = "${genode.os}/bin/sequence";
|
|
||||||
solo5-test_blk = "${solo5.tests}/bin/solo5-test_blk";
|
|
||||||
solo5-test_fpu = "${solo5.tests}/bin/solo5-test_fpu";
|
|
||||||
solo5-test_globals = "${solo5.tests}/bin/solo5-test_globals";
|
|
||||||
solo5-test_hello = "${solo5.tests}/bin/solo5-test_hello";
|
|
||||||
solo5-test_quiet = "${solo5.tests}/bin/solo5-test_quiet";
|
|
||||||
solo5-test_ssp = "${solo5.tests}/bin/solo5-test_ssp";
|
|
||||||
"solo5.lib.so" = "${solo5}/lib/solo5-bindings-genode/solo5.lib.so";
|
|
||||||
nic_loopback = "${genode.os}/bin/nic_loopback";
|
|
||||||
ram_block = "${genode.os}/bin/ram_block";
|
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
|
||||||
run_genode_until "Error: stack protector check failed" 30
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
in λ(_ : {})
|
||||||
|
→ { solo5 =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "test"
|
||||||
|
, resources = { caps = 256, ram = Genode.units.MiB 3 }
|
||||||
|
, routes =
|
||||||
|
[ Genode.ServiceRoute.parent "Timer"
|
||||||
|
, Genode.ServiceRoute.child "Block" "block"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
, block =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "ram_block"
|
||||||
|
, provides = [ "Block" ]
|
||||||
|
, resources = { caps = 96, ram = Genode.units.MiB 9 }
|
||||||
|
, config =
|
||||||
|
Genode.Prelude.XML.text
|
||||||
|
''
|
||||||
|
<config size="8M" block_size="4096"/>
|
||||||
|
''
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,161 @@
|
||||||
|
{ 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
|
|
@ -14,14 +14,14 @@ in λ(_ : {})
|
||||||
Genode.Prelude.XML.text
|
Genode.Prelude.XML.text
|
||||||
''
|
''
|
||||||
<config mac="02:02:02:02:03:00" verbose="no">
|
<config mac="02:02:02:02:03:00" verbose="no">
|
||||||
<policy label_prefix="ping_serve" ip_addr="10.0.0.2"/>
|
<policy label_prefix="solo5" ip_addr="10.0.0.2"/>
|
||||||
<default-policy/>
|
<default-policy/>
|
||||||
</config>
|
</config>
|
||||||
''
|
''
|
||||||
}
|
}
|
||||||
, ping_serve =
|
, solo5 =
|
||||||
Genode.Init.Start.defaults
|
Genode.Init.Start.defaults
|
||||||
⫽ { binary = "solo5-test_net"
|
⫽ { binary = "test"
|
||||||
, resources = { caps = 256, ram = Genode.units.MiB 3 }
|
, resources = { caps = 256, ram = Genode.units.MiB 3 }
|
||||||
, routes =
|
, routes =
|
||||||
[ Genode.ServiceRoute.parent "Timer"
|
[ Genode.ServiceRoute.parent "Timer"
|
|
@ -0,0 +1,63 @@
|
||||||
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
in λ ( _
|
||||||
|
: {}
|
||||||
|
)
|
||||||
|
→ { nic =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
|
||||||
|
, bridge =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "nic_bridge"
|
||||||
|
, resources = { caps = 200, ram = Genode.units.MiB 8 }
|
||||||
|
, provides = [ "Nic" ]
|
||||||
|
, routes = [ Genode.ServiceRoute.child "Nic" "nic" ]
|
||||||
|
, config =
|
||||||
|
Genode.Prelude.XML.text
|
||||||
|
''
|
||||||
|
<config mac="02:02:02:02:03:00" verbose="no">
|
||||||
|
<policy label="solo5 -> service0" ip_addr="10.0.0.2"/>
|
||||||
|
<policy label="solo5 -> service1" ip_addr="10.1.0.2"/>
|
||||||
|
<default-policy/>
|
||||||
|
</config>
|
||||||
|
''
|
||||||
|
}
|
||||||
|
, solo5 =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "test"
|
||||||
|
, resources = { caps = 256, ram = Genode.units.MiB 4 }
|
||||||
|
, routes =
|
||||||
|
[ Genode.ServiceRoute.parent "Timer"
|
||||||
|
, Genode.ServiceRoute.child "Nic" "bridge"
|
||||||
|
]
|
||||||
|
, config =
|
||||||
|
Genode.Prelude.XML.text
|
||||||
|
''
|
||||||
|
<config><cmdline>limit</cmdline></config>
|
||||||
|
''
|
||||||
|
}
|
||||||
|
, clients =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary =
|
||||||
|
"sequence"
|
||||||
|
, resources = { caps = 256, ram = Genode.units.MiB 8 }
|
||||||
|
, routes =
|
||||||
|
[ Genode.ServiceRoute.parent "Timer"
|
||||||
|
, Genode.ServiceRoute.child "Nic" "bridge"
|
||||||
|
]
|
||||||
|
, config =
|
||||||
|
Genode.Prelude.XML.text
|
||||||
|
''
|
||||||
|
<config>
|
||||||
|
<start name="ping0">
|
||||||
|
<binary name="ping"/>
|
||||||
|
<config interface="10.0.0.72/24" dst_ip="10.0.0.2" period_sec="1" count="4"/>
|
||||||
|
</start>
|
||||||
|
<start name="ping1">
|
||||||
|
<binary name="ping"/>
|
||||||
|
<config interface="10.1.0.72/24" dst_ip="10.1.0.2" period_sec="1" count="4"/>
|
||||||
|
</start>
|
||||||
|
</config>
|
||||||
|
''
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
in λ(_ : {})
|
||||||
|
→ { solo5 =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "test"
|
||||||
|
, resources = { caps = 256, ram = Genode.units.MiB 3 }
|
||||||
|
, routes = [ Genode.ServiceRoute.parent "Timer" ]
|
||||||
|
, config =
|
||||||
|
Genode.Prelude.XML.text
|
||||||
|
''
|
||||||
|
<config>
|
||||||
|
<cmdline>Hello_Solo5</cmdline>
|
||||||
|
</config>
|
||||||
|
''
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
let Genode = env:DHALL_GENODE
|
||||||
|
|
||||||
|
in λ(_ : {})
|
||||||
|
→ { solo5 =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "test"
|
||||||
|
, resources = { caps = 256, ram = Genode.units.MiB 3 }
|
||||||
|
, routes =
|
||||||
|
[ Genode.ServiceRoute.parent "Timer"
|
||||||
|
, Genode.ServiceRoute.child "Rtc" "clock"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
, clock =
|
||||||
|
Genode.Init.Start.defaults
|
||||||
|
⫽ { binary = "rtc_drv"
|
||||||
|
, provides = [ "Rtc" ]
|
||||||
|
, routes =
|
||||||
|
[ Genode.ServiceRoute.parent "IO_PORT"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue