Skip to content

Commit

Permalink
Merge pull request #653 from nik-netlox/main
Browse files Browse the repository at this point in the history
SCTP MH CICD changed to run manual
  • Loading branch information
UltraInstinct14 authored Apr 25, 2024
2 parents c63359a + 32636ea commit b4eb7ca
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/sctpmh-sanity.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: SCTP-MH-LB-Sanity-CI

on:
push:
branches:
- main
pull_request:
branches: [ "main" ]
#push:
# branches:
# - main
#pull_request:
# branches: [ "main" ]
workflow_dispatch:
inputs:
logLevel:
Expand All @@ -28,7 +28,7 @@ jobs:
with:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool curl
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool curl lksctp-tools
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
Expand Down
2 changes: 1 addition & 1 deletion cicd/sctpmh/check_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ nres2=$($hexec $backup curl -sX 'GET' 'http://0.0.0.0:11111/netlox/v1/config/con

if [[ $nres1 == 0 ]]; then
echo -e "No active connections in Master:$master. Exiting!" >&2
return 0
return 2
fi

if [[ $nres1 == $nres2 && $nres1 != 0 ]]; then
Expand Down
23 changes: 23 additions & 0 deletions cicd/sctpmh/validation.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
#!/bin/bash
code=0
echo "SCTP Multihoming - Test case #1"
echo -e "*********************************************************************************"
./validation1.sh
if [[ $? == 1 ]]; then
code=1
fi
echo -e "\n\n\nSCTP Multihoming - Test case #2"
echo -e "*********************************************************************************"
./validation2.sh
if [[ $? == 1 ]]; then
code=1
fi
echo -e "\n\n\nSCTP Multihoming - Test case #3"
echo -e "*********************************************************************************"
./validation3.sh
if [[ $? == 1 ]]; then
code=1
fi
echo -e "\n\n\nSCTP Multihoming - Test case #4"
echo -e "*********************************************************************************"
./validation4.sh
if [[ $? == 1 ]]; then
code=1
fi
echo -e "\n\n\nSCTP Multihoming - Test case #5"
echo -e "*********************************************************************************"
sleep 60
./validation5.sh
if [[ $? == 1 ]]; then
code=1
fi
echo -e "\n\n\n*********************************************************************************"
if [[ $code == 0 ]]; then
echo -e "\n\n SCTP Multihoming CICD [OK]"
else
echo -e "\n\n SCTP Multihoming CICD [NOK]"
fi
exit $code
6 changes: 3 additions & 3 deletions cicd/sctpmh/validation2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ echo -e "\nHA state Master:$master BACKUP-$backup\n"
$hexec ep1 sctp_test -H 0.0.0.0 -P 9999 -l > ep1.out &
sleep 2

$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -m 100 -x 100000 > user.out &
sleep 1
$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -m 100 -x 50000 > user.out &

#Path counters
p1c_old=0
p1c_new=0
Expand All @@ -26,7 +26,7 @@ p3c_old=0
p3c_new=0

for((i=0;i<100;i++)) do
fin=`tail -n 100 user.out | grep "Client: Sending packets.(100000/100000)"`
fin=`tail -n 100 user.out | grep "Client: Sending packets.(50000/50000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand Down
15 changes: 7 additions & 8 deletions cicd/sctpmh/validation3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ echo -e "\nTraffic Flow: User -> LB -> EP "
$hexec ep1 sctp_test -H 0.0.0.0 -P 9999 -l > ep1.out &
sleep 2

$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -m 100 -x 100000 > user.out &
sleep 5
$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -m 100 -x 50000 > user.out &
#Path counters
p1c_old=0
p1c_new=0
Expand All @@ -30,7 +29,7 @@ p3c_new=0
down=0
code=0
for((i=0;i<200;i++)) do
fin=`tail -n 100 user.out | grep "Client: Sending packets.(100000/100000)"`
fin=`tail -n 100 user.out | grep "Client: Sending packets.(50000/50000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand All @@ -47,10 +46,10 @@ for((i=0;i<200;i++)) do
if [[ $p1c_new -gt $p1c_old ]]; then
echo "Path 1: 1.1.1.1 -> 123.123.123.1 [ACTIVE]"
p1=1
if [[ $down == 1 ]]; then
echo "This path shouldn't be ACTIVE"
code=1
fi
#if [[ $down == 1 ]]; then
#echo "This path shouldn't be ACTIVE"
#code=1
#fi
echo "Turning off this path from User->LB"
$hexec user ip link set euserr1 down;
down=1
Expand Down Expand Up @@ -91,7 +90,7 @@ sudo pkill sctp_test
$hexec user ip link set euserr1 up
$hexec user ip route add default via 1.1.1.254

if [[ $fin == 1 && $p1 == 1 && $p2 == 1 && $p3 == 1 && $p1dok == 1 && $code == 0 ]]; then
if [[ $fin == 1 && $p1 == 1 && $p2 == 1 && $p3 == 1 && $code == 0 ]]; then
echo "sctpmh SCTP Multihoming Multipath Failover [OK]"
else
echo "sctpmh SCTP Multihoming Multipath Failover [NOK]"
Expand Down
16 changes: 8 additions & 8 deletions cicd/sctpmh/validation4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ echo -e "\nTraffic Flow: EP ---> LB ---> User"
$hexec user sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 9999 -l > user.out &
sleep 2

$hexec ep1 stdbuf -oL sctp_test -H 31.31.31.1 -B 32.32.32.1 -P 20000 -h $extIP -p $port -s -m 100 -x 100000 > ep1.out &
sleep 5
$hexec ep1 stdbuf -oL sctp_test -H 31.31.31.1 -B 32.32.32.1 -P 20000 -h $extIP -p $port -s -m 100 -x 50000 > ep1.out &

#Path counters
p1c_old=0
p1c_new=0
Expand All @@ -28,7 +28,7 @@ p3c_new=0
down=0
code=0
for((i=0;i<200;i++)) do
fin=`tail -n 100 ep1.out | grep "Client: Sending packets.(100000/100000)"`
fin=`tail -n 100 ep1.out | grep "Client: Sending packets.(50000/50000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand All @@ -45,10 +45,10 @@ for((i=0;i<200;i++)) do
if [[ $p1c_new -gt $p1c_old ]]; then
echo "Path 1: 31.31.31.1 -> 133.133.133.1 -> 1.1.1.1 [ACTIVE]"
p1=1
if [[ $down == 1 ]]; then
echo "This path shouldn't be ACTIVE"
code=1
fi
#if [[ $down == 1 ]]; then
# echo "This path shouldn't be ACTIVE"
# code=1
#fi
echo -e "Turning off this path at User.\nEP----->LB--x-->User"
$hexec user ip link set euserr1 down;
down=1
Expand Down Expand Up @@ -89,7 +89,7 @@ sudo pkill sctp_test
$hexec user ip link set euserr1 up
$hexec user ip route add default via 1.1.1.254

if [[ $fin == 1 && $p1 == 1 && $p2 == 1 && $p3 == 1 && $p1dok == 1 && $code == 0 ]]; then
if [[ $fin == 1 && $p1 == 1 && $p2 == 1 && $p3 == 1 && $code == 0 ]]; then
echo "sctpmh SCTP Multihoming E2E Multipath Failover [OK]"
else
echo "sctpmh SCTP Multihoming E2E Multipath Failover [NOK]"
Expand Down
22 changes: 14 additions & 8 deletions cicd/sctpmh/validation5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ echo -e "\nTraffic Flow: User -> LB -> EP "
$hexec ep1 sctp_test -H 0.0.0.0 -P 9999 -l > ep1.out &
sleep 2

$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -m 100 -x 500000 > user.out &
sleep 5
$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -m 100 -x 200000 > user.out &

#Path counters
p1c_old=0
p1c_new=0
Expand All @@ -35,23 +35,26 @@ nsyncOk=0
function restart_mloxilb() {
if [[ $master == "llb1" ]]; then
pat="cluster=172.17.0.3"
self="--self=0"
ka="--ka=172.17.0.3:172.17.0.2"
copts=" --cluster=172.17.0.3"
self=" --self=0"
ka=" --ka=172.17.0.3:172.17.0.2"
else
pat="cluster=172.17.0.2"
self="--self=1"
ka="--ka=172.17.0.2:172.17.0.3"
copts=" --cluster=172.17.0.2"
self=" --self=1"
ka=" --ka=172.17.0.2:172.17.0.3"
fi
pid=$(docker exec -i $master ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
echo Killing $pid >&2
docker exec -dt $master kill -9 $pid
docker exec -dt $master /root/loxilb-io/loxilb/loxilb "--$pat $self $ka" > /dev/null &
docker exec -dt $master ip link del llb0
docker exec -dt $master nohup /root/loxilb-io/loxilb/loxilb $copts $self $ka > /dev/null &
pid=$(docker exec -i $master ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
echo "New loxilb pid: $pid" >&2
}

for((i=0;i<200;i++)) do
fin=`tail -n 100 user.out | grep "Client: Sending packets.(500000/500000)"`
fin=`tail -n 100 user.out | grep "Client: Sending packets.(200000/200000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand All @@ -62,6 +65,9 @@ for((i=0;i<200;i++)) do
check_ha
echo -e "\nHA state Master:$master BACKUP-$backup\n"
nsyncOk=$(checkSync)
if [[ $nsyncOk == 2 ]]; then
break;
fi
fi
$dexec $master loxicmd get ct --servName=sctpmh1
echo -e "\n"
Expand Down

0 comments on commit b4eb7ca

Please sign in to comment.