sliding-sync/tests-e2e/client-check.sh
Kegan Dougal 75c3579f9e refactor: move integration tests to tests-integration directory
Add tests-e2ee directory for end-to-end tests which require a synapse
server.
2022-07-25 15:06:13 +01:00

19 lines
487 B
Bash
Executable File

#!/bin/bash -eu
export SYNCV3_BINDADDR=0.0.0.0:8844
# Run the binary and stop it afterwards.
./syncv3 &
SYNCV3_PID=$!
trap "kill $SYNCV3_PID" EXIT
# wait for the server to be listening, we want this endpoint to 404 instead of connrefused
until [ \
"$(curl -s -w '%{http_code}' -o /dev/null "http://localhost:8844/idonotexist")" \
-eq 404 ]
do
echo 'Waiting for server to start...'
sleep 1
done
echo 'Checking client is reachable...'
curl -f -LI "http://localhost:8844/client/"