X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/blobdiff_plain/86c90c5191a4468468ba2e3d8dccad0763751db3..6dcb21a0b297867324ee581a6a5306afbd965577:/tests/server.wv diff --git a/tests/server.wv b/tests/server.wv index eddc28d..3c74f15 100755 --- a/tests/server.wv +++ b/tests/server.wv @@ -59,6 +59,29 @@ EOF WVPASS run_server console | WVPASS grep -F 'Hello console' ) +WVSTART "default_cmd can be set to run_novaboot" +( + export NOVABOOT_SHELL_CONFIG="./.novaboot-shell" + cat < default_nb_script +run echo "Hello default_nb_script" +EOF + cat <<'EOF' > $NOVABOOT_SHELL_CONFIG +default_cmd='run_novaboot default_nb_script --scriptmod=s/default_nb_script/default_nb_script_mod/' +console_cmd='while sleep 0.01; do echo "Hello console"; done' +reset_cmd='echo "Hello reset"' +target_config="\ +--name=some name with spaces and hash # +--exiton=Hello console +" +EOF + WVPASS run_server | ( + stdout=$(cat) + WVPASS grep -F 'Hello default_nb_script' <<<"$stdout" + WVPASS grep -F 'Hello default_nb_script_mod' <<<"$stdout" + WVPASS grep -F 'Hello console' <<<"$stdout" + ) +) + WVSTART 'Second connection to console prints queue' coproc console1 { exec_server console; } WVPASS sed -e '/novaboot-shell: Connected/q0' -e '3q1' <&${console1[0]} @@ -137,6 +160,14 @@ console_cmd=console_cmd' WVPASS run_server console | tee /dev/stderr | WVPASS grep -F "Hello user" ) +WVSTART "reset_cmd may contain a shell function name" +( + export NOVABOOT_SHELL_CONFIG="./.novaboot-shell" + WVPASS tee "$NOVABOOT_SHELL_CONFIG" <<<'reset_cmd () { echo Hello user; } +reset_cmd=reset_cmd' + WVPASS run_server reset | tee /dev/stderr | WVPASS grep -F "Hello user" +) + if [ -n "$DEB_HOST_ARCH" ]; then echo >&2 "Skipping server tests in Debian package build, because these cannot pass." exit 0