Skip to content

Commit

Permalink
Merge pull request #771 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
gh-769 added cicd to check max number of supported end-points
  • Loading branch information
UltraInstinct14 authored Aug 21, 2024
2 parents 3ba3269 + a4afa4e commit 6dda820
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/advanced-lb-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,9 @@ jobs:
./validation.sh
./rmconfig.sh
cd -
- run: |
cd cicd/tcplbmaxep/
./config.sh
./validation.sh
./rmconfig.sh
cd -
6 changes: 6 additions & 0 deletions .github/workflows/advanced-lb-sanity-ubuntu-24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,9 @@ jobs:
./validation.sh
./rmconfig.sh
cd -
- run: |
cd cicd/tcplbmaxep/
./config.sh
./validation.sh
./rmconfig.sh
cd -
6 changes: 6 additions & 0 deletions .github/workflows/advanced-lb-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ jobs:
./validation.sh
./rmconfig.sh
cd -
- run: |
cd cicd/tcplbmaxep/
./config.sh
./validation.sh
./rmconfig.sh
cd -
- run: |
cd cicd/ipmasquerade/
./config.sh
Expand Down
54 changes: 54 additions & 0 deletions cicd/tcplbmaxep/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

source ../common.sh

echo "#########################################"
echo "Spawning all hosts"
echo "#########################################"

spawn_docker_host --dock-type loxilb --dock-name llb1
spawn_docker_host --dock-type host --dock-name l3h1
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
spawn_docker_host --dock-type host --dock-name l3ep4

echo "#########################################"
echo "Connecting and configuring hosts"
echo "#########################################"


connect_docker_hosts l3h1 llb1
connect_docker_hosts l3ep1 llb1
connect_docker_hosts l3ep2 llb1
connect_docker_hosts l3ep3 llb1
connect_docker_hosts l3ep4 llb1

sleep 5

#configure pods
config_docker_host --host1 l3h1 --host2 llb1 --ptype phy --addr 10.10.10.1/24 --gw 10.10.10.254
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 l3ep4 --host2 llb1 --ptype phy --addr 34.34.34.1/24 --gw 34.34.34.254
config_docker_host --host1 llb1 --host2 l3h1 --ptype phy --addr 10.10.10.254/24
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
config_docker_host --host1 llb1 --host2 l3ep4 --ptype phy --addr 34.34.34.254/24

for i in {1..4}
do
for j in {1..8}
do
$hexec l3ep$i ip addr add 35.$i.$j.1/24 dev el3ep${i}llb1
$hexec llb1 ip addr add 35.$i.$j.254/24 dev ellb1l3ep${i}
done
done

sleep 5

#configure LB

create_lb_rule llb1 20.20.20.1 --tcp=2020:8080 --endpoints=35.1.1.1:1,35.1.2.1:1,35.1.3.1:1,35.1.4.1:1,35.1.5.1:1,35.1.6.1:1,35.1.7.1:1,35.1.8.1:1,35.2.1.1:1,35.2.2.1:1,35.2.3.1:1,35.2.4.1:1,35.2.5.1:1,35.2.6.1:1,35.2.7.1:1,35.2.8.1:1,35.3.1.1:1,35.3.2.1:1,35.3.3.1:1,35.3.4.1:1,35.3.5.1:1,35.3.6.1:1,35.3.7.1:1,35.3.8.1:1,35.4.1.1:1,35.4.2.1:1,35.4.3.1:1,35.4.4.1:1,35.4.5.1:1,35.4.6.1:1,35.4.7.1:1,35.4.8.1:1
20 changes: 20 additions & 0 deletions cicd/tcplbmaxep/rmconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

source ../common.sh

disconnect_docker_hosts l3h1 llb1
disconnect_docker_hosts l3ep1 llb1
disconnect_docker_hosts l3ep2 llb1
disconnect_docker_hosts l3ep3 llb1
disconnect_docker_hosts l3ep4 llb1

delete_docker_host llb1
delete_docker_host l3h1
delete_docker_host l3ep1
delete_docker_host l3ep2
delete_docker_host l3ep3
delete_docker_host l3ep4

echo "#########################################"
echo "Deleted testbed"
echo "#########################################"
75 changes: 75 additions & 0 deletions cicd/tcplbmaxep/validation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash
source ../common.sh
echo SCENARIO-tcplb-maxep
$hexec l3ep1 node ../common/tcp_server.js server1 &
$hexec l3ep2 node ../common/tcp_server.js server2 &
$hexec l3ep3 node ../common/tcp_server.js server3 &
$hexec l3ep4 node ../common/tcp_server.js server4 &

sleep 5
code=0
servIP=( "20.20.20.1" )
servArr=(
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
"server1" "server2" "server3" "server4"
)
ep=( "31.31.31.1" "32.32.32.1" "33.33.33.1" "34.34.34.1" )
j=0
waitCount=0
while [ $j -le 3 ]
do
res=$($hexec l3h1 curl --max-time 10 -s ${ep[j]}:8080)
#echo $res
if [[ $res == "${servArr[j]}" ]]
then
echo "$res UP"
j=$(( $j + 1 ))
else
echo "Waiting for ${servArr[j]}(${ep[j]})"
waitCount=$(( $waitCount + 1 ))
if [[ $waitCount == 10 ]];
then
echo "All Servers are not UP"
echo SCENARIO-tcplb-maxep [FAILED]
sudo killall -9 node 2>&1 > /dev/null
exit 1
fi
fi
sleep 1
done

echo "Testing Service IP: ${servIP[0]}"
lcode=0
for i in {0..31}
do
res=$($hexec l3h1 curl --max-time 10 -s ${servIP[0]}:2020)
echo $res
if [[ $res != "${servArr[i]}" ]]
then
lcode=1
fi
sleep 1

if [[ $lcode == 0 ]]
then
echo SCENARIO-tcplb-maxep with ep${i+1} 35.${i}.${j}.1 [OK]
else
echo SCENARIO-tcplb-maxep with ep${i+1} 35.${i}.${j}.1 [FAILED]
code=1
fi
done

if [[ $code == 0 ]]; then
echo SCENARIO-tcplb-maxep [OK]
else
echo SCENARIO-tcplb-maxep [FAILED]
fi

sudo killall -9 node 2>&1 > /dev/null
exit $code

0 comments on commit 6dda820

Please sign in to comment.