Files
flatpak/tests/test-webserver.sh
Alexander Larsson 227cde12ba tests: Redo httpd server setup
Rather than this weird shell loop with a timeout and polling we
move the httpd spawning entirely into the python code, and use
a pipe to synchronize the spawning. This way we can also use
the shell job control to properly clean up any running processes
from the test suite.

Additionally, this adds some (lame) support for token handling in the
test webserver, where you for any file foo can create a foo.need_token
containing a token that is needed for that file.
2019-10-09 14:25:44 +02:00

11 lines
144 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
dir=$1
rm -f httpd-pipe
mkfifo httpd-pipe
$(dirname $0)/web-server.py "$dir" 3> httpd-pipe &
read < httpd-pipe