]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - tests/novaboot.wv
tests: Fix iprelay-cmd test to work on both Debian an NixOS
[novaboot.git] / tests / novaboot.wv
index f97088bad6ff3d71fee58fca992221723dd7e52c..4b73577729913e66233bd8ff1225e3f86892c8ce 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 cd $(dirname $0)
 . wvtest.sh
@@ -123,7 +123,7 @@ WVPASSSH 'NOVABOOT_TARGET=t2 novaboot --target t3 /dev/null'
 WVPASS test "$(cat t)" = Target3
 
 WVSTART --iprelay-cmd
-WVPASS novaboot --iprelay-cmd="/bin/echo -e '<iprelayd: connected>\xFF\xFA\x2C\x97\xDF\xFF\xF0 \xFF\xFA\x2C\x97\xFF\xFF\xF0'" --on
+WVPASS novaboot --iprelay-cmd="$(which echo) -e '<iprelayd: connected>\xFF\xFA\x2C\x97\xDF\xFF\xF0 \xFF\xFA\x2C\x97\xFF\xFF\xF0'" --on
 
 WVSTART Killing of --remote-cmd when it ignores SIGHUP
 WVPASS tee script <<'EOF'
@@ -159,4 +159,12 @@ WVPASS make -C dir | WVPASS grep "Config OK"
 WVSTART "INTERACTION variable"
 WVPASS novaboot --remote-cmd=cat <<<INTERACTION=0
 
+WVSTART "Do not accept directories"
+WVPASS mkdir -p tftproot
+WVFAIL novaboot --server=tftproot <<<"load $PWD"
+
+WVSTART "Accept /dev/null file"
+WVPASS mkdir -p tftproot
+WVPASS novaboot --server=tftproot <<<"load /dev/null"
+
 # Hi-lock: (("^.*\\(?:WVSTART\\).*$" (0 (quote hi-black-b) t)))