Add tests for --auth.

This commit is contained in:
Emil Mikulic
2020-07-01 21:00:46 +10:00
parent 027b0c90e5
commit 598a47fe9d
2 changed files with 57 additions and 0 deletions

View File

@ -106,6 +106,19 @@ runtests() {
kill $PID
wait $PID
echo "===> run --auth tests"
# Wrong flags:
./a.out . --auth >/dev/null 2>/dev/null
./a.out . --auth missing_colon >/dev/null 2>/dev/null
# Correct flags:
./a.out $DIR --port $PORT --auth myuser:mypass \
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
python test_auth.py
kill $PID
wait $PID
if [[ -s test.out.stderr ]]; then
echo "FAIL: stderr should have been empty."
exit 1