Skip to content
Snippets Groups Projects
Commit 1f5173d1 authored by Bob Mottram's avatar Bob Mottram
Browse files

Test that onion ports are unique

parent 4324e2d6
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,18 @@ function test_app_functions {
done
}
function test_unique_onion_ports {
# test that some services are not assigned the same onion port
FILES=src/${PROJECT_NAME}-app-*
ports=$(grep -r "_ONION_PORT=" $FILES | awk -F ':' '{print $2}' | uniq | awk -F '=' '{print $2}')
unique_ports=$(grep -r "_ONION_PORT=" $FILES | awk -F ':' '{print $2}' | uniq | awk -F '=' '{print $2}' | uniq)
if [[ "$ports" != "$unique_ports" ]]; then
echo $'Some onion ports are clashing'
grep -r "_ONION_PORT=" $FILES | awk -F ':' '{print $2}' | uniq
exit 637252
fi
}
while [[ $# > 1 ]]
do
key="$1"
......@@ -92,6 +104,7 @@ done
echo $'Running tests'
test_app_functions
test_unique_onion_ports
echo $'All tests passed'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment