diff --git a/repos/libports/run/netty.inc b/repos/libports/run/netty.inc index 0d0e26758f..96c8b795e0 100644 --- a/repos/libports/run/netty.inc +++ b/repos/libports/run/netty.inc @@ -1,4 +1,20 @@ -proc use_dynamic_rom { } { return true } +# Network echo test +# +# uses the following config hooks. +# +# proc ipstack { } name of IP stack (lwip or lxip) +# proc protocol { } test protocol (tcp or udp) +# proc use_dynamic_rom { } dynamically change IP-stack config at runtime + +set build_components { } + +if {[protocol] == "tcp"} { + append build_components { test/netty/tcp } +} else { + append build_components { test/netty/udp } +} + +build $build_components create_boot_directory import_from_depot [depot_user]/src/[base_src] \ @@ -8,11 +24,12 @@ import_from_depot [depot_user]/src/[base_src] \ [depot_user]/src/libc \ [depot_user]/src/nic_router \ [depot_user]/src/vfs_audit \ - [depot_user]/src/vfs_lxip \ + [depot_user]/src/vfs_[ipstack] \ [depot_user]/src/vfs append config { + @@ -23,10 +40,13 @@ append config { + + + @@ -49,8 +69,7 @@ append config { - - + @@ -72,8 +91,8 @@ append config { - + @@ -81,7 +100,6 @@ append config { - } @@ -95,7 +113,7 @@ append_if [use_dynamic_rom] config { - + <} [ipstack] { ip_addr="10.0.3.55" netmask="255.255.255.0" gateway="10.0.3.1" nameserver="8.8.8.8"/> @@ -105,7 +123,7 @@ append_if [use_dynamic_rom] config { - + <} [ipstack] { mtu="400" ip_addr="10.0.3.55" netmask="255.255.255.0" gateway="10.0.3.1" nameserver="8.8.8.8"/> @@ -114,23 +132,23 @@ append_if [use_dynamic_rom] config { - } + +} append config { - - } + } if {[use_dynamic_rom]} { append config { - } + } } else { append config { @@ -139,19 +157,115 @@ if {[use_dynamic_rom]} { append config { - - + + <} [ipstack] { dhcp="yes"/> + + + + - } + } } append config { + +} - } +if {[protocol] == "tcp"} { append config { + + + + + + + + + + + + + + + + + + + + + + + + +} +} else { append config { + + + + + + + + + + + + + + + + + + + + + + + + +} +} + +append config { + +} + +install_config $config +build_boot_image [build_artifacts] append qemu_args " -nographic " -append_qemu_nic_args +append_qemu_nic_args "host=10.0.2.1,dhcpstart=10.0.2.55,hostfwd=tcp::10080-:80,hostfwd=tcp::18080-:8080,hostfwd=udp::10007-:7,hostfwd=udp::17070-:7070" + +# this works only if board/*/qemu_args does not declare "-netdev user,..." +#append qemu_args " -netdev tap,id=net0,ifname=tap0,script=no " + +run_genode_until forever # vi: set ft=tcl : diff --git a/repos/libports/run/netty_lwip.inc b/repos/libports/run/netty_lwip.inc deleted file mode 100644 index 7468c92bb3..0000000000 --- a/repos/libports/run/netty_lwip.inc +++ /dev/null @@ -1,116 +0,0 @@ -create_boot_directory -import_from_depot [depot_user]/src/[base_src] \ - [depot_user]/pkg/[drivers_nic_pkg] \ - [depot_user]/src/init \ - [depot_user]/src/libc \ - [depot_user]/src/nic_router \ - [depot_user]/src/vfs_audit \ - [depot_user]/src/vfs_lwip \ - [depot_user]/src/vfs - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -append qemu_args " -nographic " -append_qemu_nic_args - -# vi: set ft=tcl : diff --git a/repos/libports/run/netty_lwip_tcp.run b/repos/libports/run/netty_lwip_tcp.run index c11bdf526d..b15cb7985d 100644 --- a/repos/libports/run/netty_lwip_tcp.run +++ b/repos/libports/run/netty_lwip_tcp.run @@ -1,64 +1,14 @@ -source ${genode_dir}/repos/libports/run/netty_lwip.inc +# Network echo test (lwIP, TCP) +# +# Example test command +# +# dd if=/dev/urandom bs=736 count=10 | xxd -plain | tr -d '\n' | nc 10.0.2.55 80 +# -build { test/netty/tcp } +proc ipstack { } { return lwip } +proc protocol { } { return tcp } +proc use_dynamic_rom { } { return false } -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config -build_boot_image { test-netty_tcp } -run_genode_until forever +source ${genode_dir}/repos/libports/run/netty.inc # vi: set ft=tcl : diff --git a/repos/libports/run/netty_lwip_udp.run b/repos/libports/run/netty_lwip_udp.run index a6aed1841a..355e83f4ff 100644 --- a/repos/libports/run/netty_lwip_udp.run +++ b/repos/libports/run/netty_lwip_udp.run @@ -1,37 +1,17 @@ -source ${genode_dir}/repos/libports/run/netty_lwip.inc +# Network echo test (lwIP, UDP) +# +# Example test command +# +# for i in {1..10}; do +# dd if=/dev/urandom bs=736 count=1 | xxd -plain | tr -d '\n' +# sleep 0.1 +# done | nc -u 10.0.2.55 7 +# -build { test/netty/udp } +proc ipstack { } { return lwip } +proc protocol { } { return udp } +proc use_dynamic_rom { } { return false } -append config { - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config -build_boot_image { test-netty_udp } -run_genode_until forever +source ${genode_dir}/repos/libports/run/netty.inc # vi: set ft=tcl : diff --git a/repos/libports/run/netty_lxip_tcp.run b/repos/libports/run/netty_lxip_tcp.run index 89401504aa..8447f9269b 100644 --- a/repos/libports/run/netty_lxip_tcp.run +++ b/repos/libports/run/netty_lxip_tcp.run @@ -1,64 +1,14 @@ +# Network echo test (lxip, TCP) +# +# Example test command +# +# dd if=/dev/urandom bs=736 count=10 | xxd -plain | tr -d '\n' | nc 10.0.2.55 80 +# + +proc ipstack { } { return lxip } +proc protocol { } { return tcp } +proc use_dynamic_rom { } { return false } + source ${genode_dir}/repos/libports/run/netty.inc -build { test/netty/tcp } - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config -build_boot_image { test-netty_tcp } -run_genode_until forever - # vi: set ft=tcl : diff --git a/repos/libports/run/netty_lxip_udp.run b/repos/libports/run/netty_lxip_udp.run index 249137e211..33253aa924 100644 --- a/repos/libports/run/netty_lxip_udp.run +++ b/repos/libports/run/netty_lxip_udp.run @@ -1,37 +1,17 @@ +# Network echo test (lxip, UDP) +# +# Example test command +# +# for i in {1..10}; do +# dd if=/dev/urandom bs=736 count=1 | xxd -plain | tr -d '\n' +# sleep 0.1 +# done | nc -u 10.0.2.55 7 +# + +proc ipstack { } { return lxip } +proc protocol { } { return udp } +proc use_dynamic_rom { } { return false } + source ${genode_dir}/repos/libports/run/netty.inc -build { test/netty/udp } - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config -build_boot_image { test-netty_udp } -run_genode_until forever - # vi: set ft=tcl :