GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Add script that facilitates testing.

Simply run:

  ./scripts/test-bridge-lines /path/to/bridge/file

The provided file must contain bridge lines, one per line.
parent d1a0411e
#!/bin/bash
#
# Test a batch of bridge lines by running:
# ./test-bridge-lines /path/to/file
if [ "$#" -ne 1 ]; then
echo "Usage: $0 BRIDGE_LINE_FILE"
exit 1
fi
bridge_lines=""
IFS=$'\n'
for line in $(cat "$1")
do
if [ -z "$bridge_lines" ]
then
bridge_lines="\"$line\""
else
bridge_lines="${bridge_lines}, \"${line}\""
fi
done
filename=$(mktemp)
echo "{\"bridge_lines\": [ $bridge_lines ]}" > "$filename"
curl -s -X GET localhost:5000/bridge-state -d "@${filename}" | python -m json.tool
rm -f "$filename"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment