Skip to content

Commit

Permalink
Merge pull request #913 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
chore:updated iperf3 scale cicd
  • Loading branch information
UltraInstinct14 authored Dec 27, 2024
2 parents 5387961 + 2132c7b commit aee876c
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/tcp-sanity-rh9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ jobs:
./validation.sh
./rmconfig.sh
cd -
- run: |
cd cicd/tcplbl3dsr/
./config.sh
./validation.sh
./rmconfig.sh
cd -
# This is commented out due to false alarms for now
#- run: |
# cd cicd/tcplbl3dsr/
# ./config.sh
# ./validation.sh
# ./rmconfig.sh
# cd -
- run: |
cd cicd/tcplbhash/
./config.sh
Expand Down
50 changes: 50 additions & 0 deletions cicd/iperf3lb/config.sh
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
25 changes: 25 additions & 0 deletions cicd/iperf3lb/rmconfig.sh
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 "#########################################"
44 changes: 44 additions & 0 deletions cicd/iperf3lb/validation.sh
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

0 comments on commit aee876c

Please sign in to comment.