# # \brief Test for the SSH terminal # assert_spec x86 if {[have_spec linux]} { puts "Run script is not supported on this platform." exit 0 } # Build # set build_components { core init timer drivers/nic drivers/rtc server/ssh_terminal server/fs_rom server/vfs lib/vfs/jitterentropy lib/vfs/lxip lib/vfs/pipe test/libports/ncurses test/terminal_echo noux-pkg/bash } source ${genode_dir}/repos/base/run/platform_drv.inc append_platform_drv_build_components build $build_components create_boot_directory # # Generate config # set config { echo Welcome to Genode! > /dev/log } append_platform_drv_config append config { } install_config $config # # Generate a new host key # if {![file exists bin/ed25519_key]} { exec ssh-keygen -t ed25519 -f bin/ed25519_key -q -N "" } # # Boot modules # # generic modules set boot_modules { core ld.lib.so init timer ipxe_nic_drv rtc_drv report_rom vfs fs_rom test-terminal_echo libc.lib.so libm.lib.so vfs.lib.so vfs_lxip.lib.so lxip.lib.so posix.lib.so libcrypto.lib.so libssh.lib.so zlib.lib.so ncurses.lib.so vfs_jitterentropy.lib.so vfs_pipe.lib.so ssh_terminal bash.tar ed25519_key } # platform-specific modules append_platform_drv_boot_modules build_boot_image $boot_modules # # Execute test # append qemu_args " -m 512 -nographic " append_qemu_nic_args "hostfwd=tcp::5555-:22" set lxip_match_string "ipaddr=(\[0-9\]+\.\[0-9\]+\.\[0-9\]+\.\[0-9\]+).*\n" if {[get_cmd_switch --autopilot]} { run_genode_until $lxip_match_string 60 set serial_id [output_spawn_id] if {[have_include "power_on/qemu"]} { set host "localhost" set port "5555" } else { regexp $lxip_match_string $output all host puts "" set port "22" } # wait for ssh_terminal to come up sleep 5 spawn sshpass -p xuon ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l genode $host -p $port set ssh_id $spawn_id set spawn_id_list [list $ssh_id $serial_id] run_genode_until {.*\[init -> /bin/bash.*\] Welcome to Genode!.*\n} 15 $spawn_id_list puts "" puts "" } else { run_genode_until forever } exec rm bin/ed25519_key bin/ed25519_key.pub # vi: set ft=tcl :