]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
tests: Get rid of asynchronous process substitution
authorMichal Sojka <michal.sojka@cvut.cz>
Wed, 20 Nov 2019 22:10:07 +0000 (23:10 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 20 Nov 2019 22:10:07 +0000 (23:10 +0100)
Under bash, processes substitution is run asynchronously. This means
that the messages printed by the process can be mixed with other
messages, which causes random tests to fail, because the wvtest
protocol lines are corrupted.

Now we run all processes synchronously and the test no longer fail
randomly.

tests/server.wv

index 94fab884db03a489ba41b013e3b98cd3b6512341..72ed35217fc8228acf8be77dcd6b3c682aa9cd33 100755 (executable)
@@ -171,9 +171,9 @@ target_config="\
 "
 EOF
 WVFAIL novaboot --ssh novaboot-test@localhost <<<"load file < date"
-novaboot --ssh novaboot-test@localhost <<<"load file < date" 2>&1 >/dev/null |\
-    tee >(WVPASS grep -q -F 'Unknown option: make') \
-       >(WVPASS grep -q -F 'Error processing configuration from the server')
+stderr=$(novaboot --ssh novaboot-test@localhost <<<"load file < date" 2>&1 >/dev/null)
+echo "$stderr" | WVPASS grep -q -F 'Unknown option: make'
+echo "$stderr" | WVPASS grep -q -F 'Error processing configuration from the server'
 
 WVSTART "Novaboot --ssh remote config fails on unknown arguments"
 WVPASS sudo_ tee "$SHELLRC" <<EOF