Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Mar 29, 2024
1 parent f222094 commit c391949
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,4 @@ jobs:
- name: Run ${{ inputs.context }} Tests
run: |
docker-compose run testing --no-TTY testing ls -lath
docker-compose run testing --no-TTY testing cat ./tests.sh
docker-compose run testing --no-TTY testing ./tests.sh ./tests/${{ inputs.context }}
docker-compose run -e UAS=true testing ./tests.sh ./tests/${{ inputs.context }}
3 changes: 2 additions & 1 deletion components/testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN cd /testing/support/ws_server && \
EXPOSE 5060

ENV WS_SERVER_PORT "3001"
ENV FILE_SERVER_PORT "8000"

ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["start"]
CMD ["services"]
11 changes: 7 additions & 4 deletions components/testing/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/sh

if [ "$1" = 'start' ]; then
if [ -n "${UAS}" ]; then
sipp -sf ./scenarios/uas.xml -bg -trace_msg
fi

if [ "$1" = "services" ]; then
WS_SERVER_PORT="${WS_SERVER_PORT:="3001"}"
HTTP_SERVER_PORT="${HTTP_SERVER_PORT:="8000"}"
FILE_SERVER_PORT="${FILE_SERVER_PORT:="8000"}"

sipp -sf ./scenarios/uas.xml -bg -trace_msg
nohup node ./support/ws_server/test_server.js --port "$WS_SERVER_PORT" > test-server.log &
nohup python3 -m http.server $HTTP_SERVER_PORT > http-server.log &
nohup python3 -m http.server $FILE_SERVER_PORT > http-server.log &
tail -f /dev/null
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ reset_db
create_rtpengine_entry "udp:media_proxy:2223"
reload_opensips_tables

uas="$(dig +short testing)"
uas="$(hostname -i)"
client_gateway="$(dig +short client_gateway)"
media_proxy="$(dig +short media_proxy)"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ source $current_dir/../support/test_helpers.sh
log_file=$(find . -type f -iname "uas_*_messages.log")
cat /dev/null > $log_file

uas="$(hostname -i)"

curl -s -o /dev/null -XPOST -u "adhearsion:password" http://switch-app:8080/calls \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary @- << EOF
Expand All @@ -28,7 +30,7 @@ curl -s -o /dev/null -XPOST -u "adhearsion:password" http://switch-app:8080/call
"dial_string_prefix": null,
"plus_prefix": false,
"national_dialing": false,
"host": "testing",
"host": "$uas",
"username": null,
"symmetric_latching": false
}
Expand Down
4 changes: 2 additions & 2 deletions components/testing/tests/public_gateway/outbound_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source $current_dir/../support/test_helpers.sh
log_file=$(find . -type f -iname "uas_*_messages.log")
cat /dev/null > $log_file

uas="$(dig +short testing)"
uas="$(hostname -i)"
media_server="$(dig +short freeswitch)"

curl -s -o /dev/null -XPOST -u "adhearsion:password" http://switch-app:8080/calls \
Expand All @@ -31,7 +31,7 @@ curl -s -o /dev/null -XPOST -u "adhearsion:password" http://switch-app:8080/call
"dial_string_prefix": null,
"plus_prefix": false,
"national_dialing": false,
"host": "testing",
"host": "$uas",
"username": null,
"symmetric_latching": true
},
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ services:
DATABASE_USERNAME: postgres
FIFO_DIR: /opensips/fifo
WS_SERVER_PORT: 3001
HTTP_SERVER_PORT: 8000
FILE_SERVER_PORT: 8000
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
Expand Down

0 comments on commit c391949

Please sign in to comment.