-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #913 from TrekkieCoder/main
chore:updated iperf3 scale cicd
- Loading branch information
Showing
4 changed files
with
126 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
source ../common.sh | ||
|
||
echo "#########################################" | ||
echo "Spawning all hosts" | ||
echo "#########################################" | ||
|
||
NUM_HOSTS=30 | ||
|
||
spawn_docker_host --dock-type loxilb --dock-name llb1 | ||
|
||
# Loop to create and configure 100 hosts | ||
for i in $(seq 1 $NUM_HOSTS); do | ||
host="l3h$i" | ||
ip="$((i)).$((i)).$((i)).1" | ||
gateway="$((i)).$((i)).$((i)).254" | ||
|
||
# Spawn a host | ||
spawn_docker_host --dock-type host --dock-name "$host" | ||
|
||
# Connect host to llb1 | ||
connect_docker_hosts "$host" llb1 | ||
|
||
# Configure the host | ||
config_docker_host --host1 "$host" --host2 llb1 --ptype phy --addr "$ip"/24 --gw "$gateway" | ||
config_docker_host --host1 llb1 --host2 "$host" --ptype phy --addr "$gateway"/24 | ||
done | ||
|
||
spawn_docker_host --dock-type host --dock-name l3ep1 | ||
spawn_docker_host --dock-type host --dock-name l3ep2 | ||
spawn_docker_host --dock-type host --dock-name l3ep3 | ||
|
||
echo "#########################################" | ||
echo "Connecting and configuring hosts" | ||
echo "#########################################" | ||
|
||
connect_docker_hosts l3ep1 llb1 | ||
connect_docker_hosts l3ep2 llb1 | ||
connect_docker_hosts l3ep3 llb1 | ||
|
||
config_docker_host --host1 l3ep1 --host2 llb1 --ptype phy --addr 31.31.31.1/24 --gw 31.31.31.254 | ||
config_docker_host --host1 l3ep2 --host2 llb1 --ptype phy --addr 32.32.32.1/24 --gw 32.32.32.254 | ||
config_docker_host --host1 l3ep3 --host2 llb1 --ptype phy --addr 33.33.33.1/24 --gw 33.33.33.254 | ||
config_docker_host --host1 llb1 --host2 l3ep1 --ptype phy --addr 31.31.31.254/24 | ||
config_docker_host --host1 llb1 --host2 l3ep2 --ptype phy --addr 32.32.32.254/24 | ||
config_docker_host --host1 llb1 --host2 l3ep3 --ptype phy --addr 33.33.33.254/24 | ||
|
||
# Create LB rule | ||
$dexec llb1 loxicmd create lb 150.150.150.1 --tcp=2020:8001-8100 --endpoints=31.31.31.1:1,32.32.32.1:1 --select=persist --mode=onearm --inatimeout=40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
source ../common.sh | ||
|
||
sudo pkill -9 iperf3 2>&1 > /dev/null | ||
|
||
disconnect_docker_hosts l3ep1 llb1 | ||
disconnect_docker_hosts l3ep2 llb1 | ||
disconnect_docker_hosts l3ep3 llb1 | ||
|
||
NUM_HOSTS=30 | ||
for i in $(seq 1 $NUM_HOSTS); do | ||
host="l3h$i" | ||
disconnect_docker_hosts $host llb1 | ||
delete_docker_host $host | ||
done | ||
|
||
delete_docker_host llb1 | ||
delete_docker_host l3ep1 | ||
delete_docker_host l3ep2 | ||
delete_docker_host l3ep3 | ||
|
||
echo "#########################################" | ||
echo "Deleted testbed" | ||
echo "#########################################" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
source ../common.sh | ||
|
||
rm -fr port*.log | ||
echo SCENARIO-udplb-iperf3 | ||
for ((i=1;i<3;i++)) | ||
do | ||
for ((port=8001;port<=8100;port++)) | ||
do | ||
$hexec l3ep$i iperf3 -s -p $port --logfile port$port-ep$i.log 2>&1 >> /dev/null & | ||
done | ||
done | ||
|
||
echo "Waiting for servers to start..." | ||
sleep 30 | ||
|
||
NUM_HOSTS=30 | ||
rm -fr iperf-*.log | ||
for ((i=1;i<=$NUM_HOSTS;i++)) | ||
do | ||
$hexec l3h$i iperf3 -c 150.150.150.1 -p 2020 -u -t20 --logfile iperf-$i.log --forceflush & | ||
done | ||
|
||
echo "Waiting for tests to finish..." | ||
sleep 60 | ||
code=0 | ||
for file in iperf*.log; do | ||
if grep -q "connected" "$file"; then | ||
echo "Pass:'connected' found in $file." | ||
else | ||
echo "Fail: 'connected' not found in $file." | ||
code=1 | ||
fi | ||
done | ||
if [[ $code != 0 ]]; then | ||
echo "SCENARIO-udplb-iperf3 [FAILED]" | ||
else | ||
echo "SCENARIO-udplb-iperf3 [OK]" | ||
fi | ||
|
||
sudo pkill -9 iperf3 2>&1 > /dev/null | ||
rm -fr iperf-*.log | ||
rm -fr port*.log | ||
exit $code |