]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - tests/server.wv
server: Ensure that configuration can depend on logged-in user name
[novaboot.git] / tests / server.wv
index 1c90891d7dfdc7f748879a899168ccdbc82b0555..94fab884db03a489ba41b013e3b98cd3b6512341 100755 (executable)
@@ -103,6 +103,15 @@ WVSTART "Quoting of config variables"
     WVPASS test -e '"file1 file2"'
 )
 
+WVSTART "Config variables can depend on user name"
+(
+    export NOVABOOT_SHELL_CONFIG="./.novaboot-shell"
+
+    WVPASS tee "$NOVABOOT_SHELL_CONFIG" <<<'console_cmd="echo Hello $NB_USER"'
+    username=asdf WVPASS run_server console | tee /dev/stderr | WVPASS grep -F "Hello asdf"
+    username=qwer WVPASS run_server console | tee /dev/stderr | WVPASS grep -F "Hello qwer"
+)
+
 SHELLRC="$NBT_HOME/.novaboot-shell"
 TFTPROOT="$NBT_HOME/tftproot"
 AUTH="$NBT_HOME/.ssh/authorized_keys"