# client restart tests for wireguard
#
# The run script sets up the following scenario:
#
# | 10.10.10.2/24 (DHCP) 10.10.10.1/24 (server_home)
# | ************ +++++++++++++++++++++++
# | * lighttpd * ----- + nic_router (server) +
# | ************ +++++++++++++++++++++++
# | 10.10.20.1/24 (vpn_inner) (no_arp)
# | |
# server init | |
# | 10.10.20.2/24 (DHCP)
# | %%%%%%%%%%%%%
# | % wg_server %
# | %%%%%%%%%%%%%
# | 10.10.0.2/24 (DHCP?)
# |
# |
# 10.10.0.1/24 (vpn_server)
# +++++++++++++++++++++++
# + nic_router (global) +
# +++++++++++++++++++++++
# 10.20.0.1/24 (vpn_client)
# |
# |
# | 10.20.0.2/24 (DHCP?)
# | %%%%%%%%%%%%%
# | % wg_client %
# | %%%%%%%%%%%%%
# | 10.20.20.2/24 (DHCP)
# | |
# client init | |
# | 10.20.20.1/24 (vpn_inner) (no_arp)
# | ************ +++++++++++++++++++++++
# | * fetchurl * ----- + nic_router (client) +
# | ************ +++++++++++++++++++++++
# | 10.20.10.2/24 (DHCP) 10.20.10.1/24 (client_home)
#
# The client side will be restarted two times to test reconnecting.
if { ![expr [have_board linux] || [have_board pc]] } {
puts "Run script is not supported on this platform."
exit 0
}
proc rtc_drv_binary_name { } {
switch [board] {
linux { return "linux_rtc_drv" }
pc { return "rtc_drv" }
}
}
proc rtc_drv_use_ld { } {
return [expr [have_board linux] ? "no" : "yes"]
}
create_boot_directory
set depot_archives { }
lappend depot_archives [depot_user]/raw/test-wg_reconnect
lappend depot_archives [depot_user]/src/[base_src]
lappend depot_archives [depot_user]/src/curl
lappend depot_archives [depot_user]/src/dynamic_rom
lappend depot_archives [depot_user]/src/fetchurl
lappend depot_archives [depot_user]/src/init
lappend depot_archives [depot_user]/src/libc
lappend depot_archives [depot_user]/src/libssh
lappend depot_archives [depot_user]/src/openssl
lappend depot_archives [depot_user]/src/lighttpd
lappend depot_archives [depot_user]/src/nic_router
lappend depot_archives [depot_user]/src/openssl
lappend depot_archives [depot_user]/src/posix
lappend depot_archives [depot_user]/src/report_rom
lappend depot_archives [depot_user]/src/[rtc_drv_binary_name]
lappend depot_archives [depot_user]/src/vfs
lappend depot_archives [depot_user]/src/vfs_jitterentropy
lappend depot_archives [depot_user]/src/vfs_lwip
lappend depot_archives [depot_user]/src/wireguard
lappend depot_archives [depot_user]/src/zlib
import_from_depot $depot_archives
set server_init_config {
}
set client_init_config {
}
append config {
} $server_init_config {
} $client_init_config {
}
install_config $config
build_boot_image [build_artifacts]
append qemu_args "-nographic "
run_genode_until "fetchurl. exited with exit value 0.*\n" 12
for {set i 1 } { $i <= 2 } { incr i } {
puts "Wireguard reconnect $i"
run_genode_until "fetchurl. exited with exit value 0.*\n" 12 [output_spawn_id]
}