# # \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 lib/libc_noux lib/vfs/jitterentropy lib/vfs/lxip test/libports/ncurses test/terminal_echo noux 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 { } 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 noux test-terminal_echo libc.lib.so libm.lib.so vfs.lib.so vfs_lxip.lib.so lxip.lib.so libc_pipe.lib.so libc_noux.lib.so posix.lib.so libcrypto.lib.so libssh.lib.so zlib.lib.so ncurses.lib.so vfs_jitterentropy.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 " proc qemu_nic_model {} { if [have_spec x86] { return e1000 } if [have_spec lan9118] { return lan9118 } return nic_model_missing } append qemu_args " -netdev user,id=net0,hostfwd=tcp::5555-:22 " append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 " 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 noux $host -p $port set ssh_id $spawn_id set spawn_id_list [list $ssh_id $serial_id] run_genode_until "--- noux started ---" 15 $spawn_id_list puts "" puts "" } else { run_genode_until forever } exec rm bin/ed25519_key bin/ed25519_key.pub # vi: set ft=tcl :