From bdd145f62d83d3398075dfd74cc296cf9e027b99 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 8 Jul 2013 12:04:17 +0200 Subject: [PATCH] run: split netperf l4linux script Split the netperf run script into 3 ones so that it can be used more easily in an automated run. It is solely for foc_arndale by now. l4linux_netperf.run - use nic via usb2.0 l4linux_netperf-usb30.run - use nic via usb3.0 l4linux_netperf-bridge.run - use nic via usb3.0 + bridge --- ports-foc/run/l4linux_netperf.inc | 218 ++++++++++++++++++++++ ports-foc/run/l4linux_netperf.run | 220 ++--------------------- ports-foc/run/l4linux_netperf_bridge.run | 18 ++ ports-foc/run/l4linux_netperf_usb30.run | 18 ++ 4 files changed, 267 insertions(+), 207 deletions(-) create mode 100644 ports-foc/run/l4linux_netperf.inc create mode 100644 ports-foc/run/l4linux_netperf_bridge.run create mode 100644 ports-foc/run/l4linux_netperf_usb30.run diff --git a/ports-foc/run/l4linux_netperf.inc b/ports-foc/run/l4linux_netperf.inc new file mode 100644 index 0000000000..ee94cd4d6a --- /dev/null +++ b/ports-foc/run/l4linux_netperf.inc @@ -0,0 +1,218 @@ +# +# \brief Test using netperf with l4linux +# \author Sebastian Sumpf +# \date 2013-07-08 +# + +assert_spec foc_arndale + +if {$use_nic_bridge == 1} { +set route_nic "nic_bridge" +} else { +set route_nic "usb_drv" +} + +set version "2.4.4" + +# sanity check that the right version is used +set wrong_version [catch { + spawn netperf-$version -V + expect { + "Netperf version $version" { } + eof { return } + timeout { return } + } + spawn netserver-$version -V + expect { + "Netperf version $version" { } + eof { return } + timeout { return } + } +}] + +if {$wrong_version} { + puts -nonewline "\nPlease compile a netperf client of version $version " + puts "for your host system." + puts -nonewline "The sources are available via " + puts "ftp://ftp.netperf.org/netperf/archive/netperf-2.4.4.tar.bz2" + puts "Please name the binary netperf-$version and netserver-$version\n" + 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 " + " +append 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 +} +exec >& /dev/null wget -O bin/initrd.gz.md5 $uri.md5 +cd bin +exec md5sum -c initrd.gz.md5 +cd .. + +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 8 +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 netserver-$version -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 netperf-$version -p 8888 -H $ip_remote -t TCP_STREAM] +puts $results + +puts "Test succeeded" +close -i $serial_id +exec killall netserver-$version + +# vi: set ft=tcl : diff --git a/ports-foc/run/l4linux_netperf.run b/ports-foc/run/l4linux_netperf.run index be688f2cb5..1002240762 100644 --- a/ports-foc/run/l4linux_netperf.run +++ b/ports-foc/run/l4linux_netperf.run @@ -1,212 +1,18 @@ -assert_spec foc_arndale +# +# \brief Test using netperf with l4linux +# \date 2013-07-08 +# -set use_nic_bridge 0 - -if {$use_nic_bridge == 1} { -set route_nic "nic_bridge" -} else { -set route_nic "usb_drv" +if {[is_qemu_available]} { + puts "\nNetperf running on Qemu is not supported.\n" + exit } -set version "2.4.4" +# network configuration +set use_nic_bridge 0 -# sanity check that the right version is used -set wrong_version [catch { - spawn netperf-$version -V - expect { - "Netperf version $version" { } - eof { return } - timeout { return } - } - spawn netserver-$version -V - expect { - "Netperf version $version" { } - eof { return } - timeout { return } - } -}] +set use_usb_11 "no" +set use_usb_20 "yes" +set use_usb_30 "no" -if {$wrong_version} { - puts -nonewline "\nPlease compile a netperf client of version $version " - puts "for your host system." - puts -nonewline "The sources are available via " - puts "ftp://ftp.netperf.org/netperf/archive/netperf-2.4.4.tar.bz2" - puts "Please name the binary netperf-$version and netserver-$version\n" - 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 -} -exec >& /dev/null wget -O bin/initrd.gz.md5 $uri.md5 -cd bin -exec md5sum -c initrd.gz.md5 -cd .. - -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 8 -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 netserver-$version -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 netperf-$version -p 8888 -H $ip_remote -t TCP_STREAM] -puts $results - -puts "Test succeeded" -close -i $serial_id -exec killall netserver-$version - -# vi: set ft=tcl : +source ${genode_dir}/ports-foc/run/l4linux_netperf.inc diff --git a/ports-foc/run/l4linux_netperf_bridge.run b/ports-foc/run/l4linux_netperf_bridge.run new file mode 100644 index 0000000000..ef11b0e17e --- /dev/null +++ b/ports-foc/run/l4linux_netperf_bridge.run @@ -0,0 +1,18 @@ +# +# \brief Test using netperf with l4linux and bridge +# \date 2013-07-08 +# + +if {[is_qemu_available]} { + puts "\nNetperf running on Qemu is not supported.\n" + exit +} + +# network configuration +set use_nic_bridge 1 + +set use_usb_11 "no" +set use_usb_20 "no" +set use_usb_30 "yes" + +source ${genode_dir}/ports-foc/run/l4linux_netperf.inc diff --git a/ports-foc/run/l4linux_netperf_usb30.run b/ports-foc/run/l4linux_netperf_usb30.run new file mode 100644 index 0000000000..c7f4903544 --- /dev/null +++ b/ports-foc/run/l4linux_netperf_usb30.run @@ -0,0 +1,18 @@ +# +# \brief Test using netperf with l4linux +# \date 2013-07-08 +# + +if {[is_qemu_available]} { + puts "\nNetperf running on Qemu is not supported.\n" + exit +} + +# network configuration +set use_nic_bridge 0 + +set use_usb_11 "no" +set use_usb_20 "no" +set use_usb_30 "yes" + +source ${genode_dir}/ports-foc/run/l4linux_netperf.inc