From 0a211a53532dd711c12a244c5630cdf085909aa0 Mon Sep 17 00:00:00 2001 From: David Wilkie Date: Sat, 13 Jul 2024 15:02:46 +0700 Subject: [PATCH] Add more E2E tests (#680) --- components/testing/infrastructure/README.md | 2 ++ ...sh => public_gateway_inbound_ga_5080_test.sh} | 3 +-- .../public_gateway_inbound_nlb_5080_test.sh | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) rename components/testing/infrastructure/tests/{public_gateway_alternative_inbound_test.sh => public_gateway_inbound_ga_5080_test.sh} (82%) create mode 100755 components/testing/infrastructure/tests/public_gateway_inbound_nlb_5080_test.sh diff --git a/components/testing/infrastructure/README.md b/components/testing/infrastructure/README.md index b912cb1d4..0d8e9b2d0 100644 --- a/components/testing/infrastructure/README.md +++ b/components/testing/infrastructure/README.md @@ -2,6 +2,8 @@ This directory contains infrastructure and end-to-end tests for testing Somleng. +It is useful for load testing and recording SIP traces from the customer side. + ## Setup 1. Run `terraform apply` diff --git a/components/testing/infrastructure/tests/public_gateway_alternative_inbound_test.sh b/components/testing/infrastructure/tests/public_gateway_inbound_ga_5080_test.sh similarity index 82% rename from components/testing/infrastructure/tests/public_gateway_alternative_inbound_test.sh rename to components/testing/infrastructure/tests/public_gateway_inbound_ga_5080_test.sh index c3a7160c9..c13ec636c 100755 --- a/components/testing/infrastructure/tests/public_gateway_alternative_inbound_test.sh +++ b/components/testing/infrastructure/tests/public_gateway_inbound_ga_5080_test.sh @@ -5,11 +5,10 @@ set -e TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` AWS_PUBLIC_IP=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-ipv4) DESTINATION_NUMBER="1234" -HOSTNAME=$(cat /etc/hostname) read -p "1. Add (or modify) a SIP trunk on Somleng with the following Source IP for Inbound Dialing: $AWS_PUBLIC_IP. Press any key when done." read -p "2. Configure the number: $DESTINATION_NUMBER on Somleng: Press any key when done." -read -p "3. Start TCP dump. In another terminal run the following: sudo docker run -it --rm --net container:$HOSTNAME nicolaka/netshoot followed by tcpdump -Xvv -i ens5 -s0 -w capture.pcap. Press any key when done." +read -p "3. Start TCP dump. In another terminal run the following: sudo docker run -it --rm --net container:cid nicolaka/netshoot followed by tcpdump -Xvv -i ens5 -s0 -w capture.pcap. Press any key when done." log_file="uac_*_messages.log" rm -f $log_file diff --git a/components/testing/infrastructure/tests/public_gateway_inbound_nlb_5080_test.sh b/components/testing/infrastructure/tests/public_gateway_inbound_nlb_5080_test.sh new file mode 100755 index 000000000..f610d1827 --- /dev/null +++ b/components/testing/infrastructure/tests/public_gateway_inbound_nlb_5080_test.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` +AWS_PUBLIC_IP=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-ipv4) +DESTINATION_NUMBER="1234" + +read -p "1. Add (or modify) a SIP trunk on Somleng with the following Source IP for Inbound Dialing: $AWS_PUBLIC_IP. Press any key when done." +read -p "2. Configure the number: $DESTINATION_NUMBER on Somleng: Press any key when done." +read -p "3. Start TCP dump. In another terminal run the following: sudo docker run -it --rm --net container:cid nicolaka/netshoot followed by tcpdump -Xvv -i ens5 -s0 -w capture.pcap. Press any key when done." + +log_file="uac_*_messages.log" +rm -f $log_file + +sipp -sf scenarios/uac.xml 52.74.4.205:5080 -d 20000 -mi "$AWS_PUBLIC_IP" --key username "+855715100850" --key advertised_ip "$AWS_PUBLIC_IP" -s 1234 -m 1 -min_rtp_port 10000 -max_rtp_port 50000 -trace_msg > /dev/null