Skip to content

Commit

Permalink
Add more E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Jul 13, 2024
1 parent 785a4f4 commit f8e8d4d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions components/testing/infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f8e8d4d

Please sign in to comment.