2
0
Fork 0

Add more Solo5 tests

20.02
Emery Hemingway 3 years ago
parent cb7e956a73
commit 434f364021
  1. 4
      dhall/genode.nix
  2. 1
      tests/default.nix
  3. 54
      tests/solo5-ping.dhall
  4. 19
      tests/solo5-ping.nix
  5. 55
      tests/solo5.dhall
  6. 4
      tests/solo5.nix

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

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

@ -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"/>
''
}
}

@ -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
'';
}

@ -1,18 +1,45 @@
let Genode = env:DHALL_GENODE
in λ(_ : {})
→ { hello =
Genode.Init.Start.defaults
⫽ { binary = "solo5-test_hello"
, resources = { caps = 256, ram = Genode.units.MiB 16 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Genode.Prelude.XML.text
''
<config>
<cmdline>"Hello_Solo5"</cmdline>
</config>
''
}
: Genode.Init.Start.Type
→ { 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 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>
''
}
}

@ -5,7 +5,7 @@ rec {
name = "solo5";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./solo5.dhall "{=}";
testConfig = lib.renderDhallInit ./solo5.dhall "{=}";
testScript = ''
collect_modules ${solo5.tests}/bin/*
@ -14,6 +14,6 @@ rec {
collect_modules ${genode.os}/bin/ram_block
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
'';
}

Loading…
Cancel
Save