diff --git a/ports-foc/run/l4linux_netperf.run b/ports-foc/run/l4linux_netperf.run new file mode 100644 index 000000000..721199ce9 --- /dev/null +++ b/ports-foc/run/l4linux_netperf.run @@ -0,0 +1,187 @@ +assert_spec foc +assert_spec arm + +set use_nic_bridge 0 + +if {$use_nic_bridge == 1} { +set route_nic "nic_bridge" +} else { +set route_nic "usb_drv" +} + +if {![file exists bin/netserver] || ![file exists bin/netperf]} { + puts "Please download netperf-2.4.4 and put 'netserver' and 'netperf' in your '/bin' folder." + puts "(ftp://ftp.netperf.org/netperf/archive/netperf-2.4.4.tar.bz2)" + exit 1 +} + +# +# Build +# +set build_components { + core + init + drivers/usb + drivers/timer + drivers/uart + drivers/platform + server/nic_bridge + l4linux +} + +build $build_components +create_boot_directory + +# +# Config +# +set config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + append config "\t\t " + append config { + + + + } + + append_if $use_nic_bridge config { + + + + + + + + + } + + +append config { + +} + +install_config $config + +# +# Boot modules +# +set boot_modules { + core + init + timer + l4linux + initrd.gz + usb_drv + nic_bridge + platform_drv + kdb_uart_drv +} + +set uri "http://genode.org/files/l4linux/initrd-arm-netperf.gz" + +if {![file exists bin/initrd.gz]} { + puts "Download initramfs ..." + exec >& /dev/null wget -c -O bin/initrd.gz $uri +} + +build_boot_image [join $boot_modules " "] + + +# +# Execute test case +# +set ip_match "(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})" + +# +# Local IP +# +set ip_string [ exec ip addr show dev eth0 ] +regexp $ip_match $ip_string ip_local + + +# +# Remote IP +# +run_genode_until "Link status is: 1.*" 220 +set serial_id $spawn_id +sleep 3 +send "ip addr show dev eth0\n" +run_genode_until "inet.*\n" 3 $serial_id +regexp $ip_match $output ip_remote + +puts "Using local IP: $ip_local remote IP: $ip_remote" + + +# +# TX (from board to local) +# +puts "Transmission test:" + +exec bin/netserver -p 8888 & +send "netperf -p 8888 -H $ip_local -t TCP_STREAM && uname\n" +run_genode_until "Linux.*" 30 $serial_id + +puts "\n\n" + + +# +# RX +# +puts "Receive test:" + +set results [exec bin/netperf -p 8888 -H $ip_remote -t TCP_STREAM] +puts $results + +puts "Test succeeded" +close -i $serial_id +exec killall netserver + +# vi: set ft=tcl :