nic_router.inc: automatically count clients

Avoid that the user has to define the number of HTTP/UDP clients manually.
This count is used by the run scripts to generate the expected log output.

Fix #2609
This commit is contained in:
Martin Stein 2017-12-13 17:33:34 +01:00 committed by Christian Helmuth
parent 869297a672
commit 4d6fcbb8b6
3 changed files with 8 additions and 3 deletions

View File

@ -138,4 +138,8 @@ lappend boot_modules nic_dump
build_boot_image $boot_modules build_boot_image $boot_modules
run_genode_until {.*Test done.*\n.*Test done.*\n} 120 for {set i 0} {$i < $nr_of_clients} {incr i 1} {
append done_string {.*Test done.*\n}
}
run_genode_until $done_string 120

View File

@ -72,6 +72,8 @@ proc server_bin { prot } {
if {$prot == "http"} { return "test-lwip_httpsrv_static" } } if {$prot == "http"} { return "test-lwip_httpsrv_static" } }
proc client_config { name prot ip_addr gateway netmask nic srv_port srv_ip } { proc client_config { name prot ip_addr gateway netmask nic srv_port srv_ip } {
global nr_of_clients
incr nr_of_clients
append result { append result {
<start name="} $name {" caps="200" priority="-1"> <start name="} $name {" caps="200" priority="-1">
<binary name="} [client_bin $prot] {" /> <binary name="} [client_bin $prot] {" />

View File

@ -9,7 +9,6 @@ proc enable_test_4 { } { return 1 }
proc enable_test_5 { } { return 1 } proc enable_test_5 { } { return 1 }
proc enable_test_6 { } { return 1 } proc enable_test_6 { } { return 1 }
proc enable_test_7 { } { return 0 } proc enable_test_7 { } { return 0 }
proc nr_of_clients { } { return 7 }
source ${genode_dir}/repos/libports/run/nic_router.inc source ${genode_dir}/repos/libports/run/nic_router.inc
@ -265,7 +264,7 @@ install_config $config
build_boot_image $boot_modules build_boot_image $boot_modules
for {set i 0} {$i < [nr_of_clients]} {incr i 1} { for {set i 0} {$i < $nr_of_clients} {incr i 1} {
append done_string {.*Test done.*\n} append done_string {.*Test done.*\n}
} }