Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more E2E tests #680

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading