Skip to content

Commit

Permalink
Merge pull request #334 from nik-netlox/main
Browse files Browse the repository at this point in the history
loxilb IP tested as service IP - added in tcplb and nat64 cicd
  • Loading branch information
UltraInstinct14 committed Jun 23, 2023
2 parents b62f193 + 13c35ee commit 8702887
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
1 change: 1 addition & 0 deletions cicd/nat64tcp/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ $hexec llb1 ethtool --offload ellb1l3ep3 rx off tx off
$hexec llb1 ethtool -K ellb1l3ep3 gso off

$dexec llb1 loxicmd create lb 2001::1 --tcp=2020:8080 --endpoints=31.31.31.1:1,32.32.32.1:1,33.33.33.1:1
$dexec llb1 loxicmd create lb 3ffe::2 --tcp=2020:8080 --endpoints=31.31.31.1:1,32.32.32.1:1,33.33.33.1:1
sleep 10
21 changes: 18 additions & 3 deletions cicd/nat64tcp/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $hexec l3ep3 node ../common/tcp_server.js server3 &

sleep 5
code=0
servIP=( "3ffe::2" "2001::1" )
servArr=( "server1" "server2" "server3" )
ep=( "31.31.31.1" "32.32.32.1" "33.33.33.1" )
j=0
Expand Down Expand Up @@ -34,14 +35,19 @@ do
done

res=$($hexec l3h1 curl -s --max-time 20 '[2001::1]:2020')
res=$($hexec l3h1 curl -s --max-time 20 '[3ffe::2]:2020')
sleep 4

nid=0
for k in {0..1}
do
echo "Testing Service IP: ${servIP[k]}"
lcode=0
for i in {1..4}
do
for j in {0..2}
do
res=$($hexec l3h1 curl -s -j -6 --max-time 10 '[2001::1]:2020')
res=$($hexec l3h1 curl -s -j -6 --max-time 10 "[${servIP[k]}]:2020")
echo $res
ids=`echo "${res//[!0-9]/}"`
if [[ $res == *"server"* ]]; then
Expand All @@ -53,17 +59,26 @@ do
fi
elif [[ $nid != $((ids)) ]]; then
echo "Expected server$nid got server$((ids))"
code=1
lcode=1
fi
nid=$((($ids + 1)%4))
if [[ $nid == 0 ]];then
nid=1
fi
else
code=1
lcode=1
fi
sleep 1
done
done
if [[ $lcode == 0 ]]
then
echo nat64tcp with ${servIP[k]} [OK]
else
echo nat64tcp with ${servIP[k]} [FAILED]
code=1
fi

done
sudo pkill -9 node
if [[ $code == 0 ]]
Expand Down
2 changes: 1 addition & 1 deletion cicd/tcplb/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ config_docker_host --host1 llb1 --host2 l3ep3 --ptype phy --addr 33.33.33.254/24

sleep 5
create_lb_rule llb1 20.20.20.1 --tcp=2020:8080 --endpoints=31.31.31.1:1,32.32.32.1:1,33.33.33.1:1
#create_lb_rule llb1 20.20.20.1 --tcp=2020:8080 --endpoints=31.31.31.1:1,32.32.32.1:1,33.33.33.1:1
create_lb_rule llb1 10.10.10.254 --tcp=2020:8080 --endpoints=31.31.31.1:1,32.32.32.1:1,33.33.33.1:1
19 changes: 13 additions & 6 deletions cicd/tcplb/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $hexec l3ep3 node ../common/tcp_server.js server3 &

sleep 5
code=0
servIP=( "10.10.10.254" "20.20.20.1" )
servArr=( "server1" "server2" "server3" )
ep=( "31.31.31.1" "32.32.32.1" "33.33.33.1" )
j=0
Expand All @@ -33,25 +34,31 @@ do
sleep 1
done

for k in {0..1}
do
echo "Testing Service IP: ${servIP[k]}"
lcode=0
for i in {1..4}
do
for j in {0..2}
do
res=$($hexec l3h1 curl --max-time 10 -s 20.20.20.1:2020)
res=$($hexec l3h1 curl --max-time 10 -s ${servIP[k]}:2020)
echo $res
if [[ $res != "${servArr[j]}" ]]
then
code=1
lcode=1
fi
sleep 1
done
done
if [[ $code == 0 ]]
if [[ $lcode == 0 ]]
then
echo SCENARIO-tcplb [OK]
echo SCENARIO-tcplb with ${servIP[k]} [OK]
else
echo SCENARIO-tcplb [FAILED]
echo SCENARIO-tcplb with ${servIP[k]} [FAILED]
code=1
fi
done

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

0 comments on commit 8702887

Please sign in to comment.