-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TS-534: Switch to localtunnel from tunnelmole.
I'm not exactly sure why tunnelmole doesn't work anymore, but I couldn't get it to run on the Orange Pi in my HIL setup, and there were literally no logs that I could use to debug. This commit swaps out tunnelmole for localtunnel. I tested it, and it works.
- Loading branch information
1 parent
2eac09e
commit f4d271d
Showing
4 changed files
with
71 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "$MD5SRV_PORT" ]; then | ||
echo "INFO: Using MD5 server port $MD5SRV_PORT." >&2 | ||
else | ||
echo "ERROR: MD5SRV_PORT not defined." >&2 | ||
exit 1 | ||
fi | ||
|
||
if ! which lt > /dev/null 2>&1; then | ||
echo "ERROR: lt command not found." >&2 | ||
exit 1 | ||
fi | ||
|
||
echo "INFO: Starting lt..." >&2 | ||
lt --port $MD5SRV_PORT > lt.log 2>&1 & | ||
LT_PID=$! | ||
echo "INFO: lt PID is $LT_PID." >&2 | ||
echo "LT_PID=$LT_PID" >> $GITHUB_ENV | ||
timeout 10 bash -c "until test -e lt.log; do sleep 0.1; done" | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: lt failed to start." >&2 | ||
exit 1 | ||
fi | ||
|
||
sleep 1 | ||
|
||
TIMEOUT=8 | ||
SECONDS=0 | ||
MD5SRV_URL="" | ||
# Check lt.log for the MD5 server URL every second. | ||
until [ "$SECONDS" -ge "$TIMEOUT" ] | ||
do | ||
MD5SRV_URL=$(grep -oP "https://[\w\d\.-]+" lt.log) | ||
|
||
if [ -n "$MD5SRV_URL" ]; then | ||
break | ||
else | ||
SECONDS=$((SECONDS+1)) | ||
sleep 1 | ||
fi | ||
done | ||
|
||
if [ -z "$MD5SRV_URL" ]; then | ||
echo "ERROR: Timed out waiting for MD5 server URL to get written to lt.log." >&2 | ||
echo "lt.log contents:" >&2 | ||
cat lt.log >&2 | ||
exit 1 | ||
fi | ||
|
||
echo "INFO: Got MD5 server URL from lt.log." >&2 | ||
echo "MD5SRV_URL=$MD5SRV_URL" >> $GITHUB_ENV | ||
echo "INFO: lt ready. Logging to `realpath lt.log`" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
. venv/bin/activate | ||
python3 ./test/hitl/scripts/md5srv.py --dir md5srv-files --save > md5srv.log 2>&1 & | ||
MD5SRV_PID=$! | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to start md5srv.py. Check md5srv.log." >&2 | ||
exit 1 | ||
fi | ||
echo "MD5SRV_PID=$MD5SRV_PID" >> $GITHUB_ENV |
This file was deleted.
Oops, something went wrong.