2
0
Fork 0

Add more Solo5 tests

This commit is contained in:
Ehmry - 2019-10-08 09:48:45 +02:00
parent cb7e956a73
commit 434f364021
6 changed files with 119 additions and 18 deletions

View File

@ -6,6 +6,6 @@
fetchgit fetchgit
{ url = "https://git.sr.ht/~ehmry/dhall-genode"; { url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "f04577c5a1eef0598cc24a04f395ff139f7c8bac"; rev = "77191aad45296782ae570fcd852e5d017b144e50";
sha256 = "0anszk0mgajn59hr93gbp2abkc2xp34f43vgpz9cpyglfjbzkfi0"; sha256 = "10isqwr34szy7q1kyri1q7kgn1cjx17bzw9ks40safa7pz6wzrnz";
} }

View File

@ -9,6 +9,7 @@ let
log = call ./log.nix { }; log = call ./log.nix { };
signal = call ./signal.nix { }; signal = call ./signal.nix { };
solo5 = call ./solo5.nix { }; solo5 = call ./solo5.nix { };
solo5-ping = call ./solo5-ping.nix { };
}; };
nixpkgs' = import ./../nixpkgs.nix; nixpkgs' = import ./../nixpkgs.nix;
in { nixpkgs ? nixpkgs' }: in { nixpkgs ? nixpkgs' }:

54
tests/solo5-ping.dhall Normal file
View File

@ -0,0 +1,54 @@
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="yes">
<policy label_prefix="solo5" ip_addr="10.0.0.2"/>
<default-policy/>
</config>
''
}
, ping_serve =
Genode.Init.Start.defaults
⫽ { binary = "solo5-test_net"
, 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>
''
}
, ping =
Genode.Init.Start.defaults
⫽ { binary = "ping"
, resources = { caps = 128, ram = Genode.units.MiB 8 }
, routes =
[ Genode.ServiceRoute.parent "Timer"
, Genode.ServiceRoute.child "Nic" "bridge"
]
, config =
Genode.Prelude.XML.text
''
<config interface="10.0.0.72/24"
dst_ip="10.0.0.2"
period_sec="1"
verbose="no"
count="8"/>
''
}
}

19
tests/solo5-ping.nix Normal file
View File

@ -0,0 +1,19 @@
{ pkgs, lib }:
with pkgs;
rec {
name = "solo5";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./solo5-ping.dhall "{=}";
testScript = ''
collect_modules ${solo5.tests}/bin/solo5-test_net
collect_modules ${solo5}/lib/solo5-bindings-genode/solo5.lib.so
collect_modules ${genode.os}/bin/nic_loopback
collect_modules ${genode.os}/bin/nic_bridge
collect_modules ${genode.os}/bin/ping
run_genode_until {child "ping" exited with exit value 0} 30
'';
}

View File

@ -1,18 +1,45 @@
let Genode = env:DHALL_GENODE let Genode = env:DHALL_GENODE
in λ(_ : {}) in λ(_ : {})
→ { hello = → { nic =
Genode.Init.Start.defaults Genode.Init.Start.defaults
⫽ { binary = "solo5-test_hello" ⫽ { binary = "nic_loopback", provides = [ "Nic" ] }
, resources = { caps = 256, ram = Genode.units.MiB 16 } , block =
, routes = [ Genode.ServiceRoute.parent "Timer" ] Genode.Init.Start.defaults
, config = ⫽ { binary = "ram_block"
Genode.Prelude.XML.text , provides = [ "Block" ]
'' , resources = { caps = 96, ram = Genode.units.MiB 9 }
<config> , config =
<cmdline>"Hello_Solo5"</cmdline> Genode.Prelude.XML.text
</config> ''
'' <config size="8M" block_size="4096"/>
} ''
: Genode.Init.Start.Type }
, test =
Genode.Init.Start.defaults
⫽ { binary = "sequence"
, resources = { caps = 256, ram = Genode.units.MiB 16 }
, 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>
''
}
} }

View File

@ -5,7 +5,7 @@ rec {
name = "solo5"; name = "solo5";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ]; meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./solo5.dhall "{=}"; testConfig = lib.renderDhallInit ./solo5.dhall "{=}";
testScript = '' testScript = ''
collect_modules ${solo5.tests}/bin/* collect_modules ${solo5.tests}/bin/*
@ -14,6 +14,6 @@ rec {
collect_modules ${genode.os}/bin/ram_block collect_modules ${genode.os}/bin/ram_block
collect_modules ${genode.os}/bin/sequence collect_modules ${genode.os}/bin/sequence
run_genode_until "child .* exited with exit value 0.*\n" 30 run_genode_until "Error: stack protector check failed" 30
''; '';
} }