Skip to content

Commit

Permalink
gh-87: SCTP-MH with seagull fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-netlox committed Dec 5, 2024
1 parent 8bd2bd9 commit dbb5bd9
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 31 deletions.
38 changes: 24 additions & 14 deletions cicd/sctpmh-seagull/check_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ function restart_mloxilb() {
ka=" --ka=172.17.0.2:172.17.0.3"
fi
echo "Restarting MASTER: $master"
pid=$(docker exec -i $master ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
#pid=$(docker exec -i $master ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
pid=$(ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
echo "Killing $pid" >&2
docker exec -dt $master kill -9 $pid
#docker exec -dt $master kill -9 $pid
sudo kill -9 $pid
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)
docker exec -dt $master /root/loxilb-io/loxilb/loxilb $copts $self $ka
#pid=$(docker exec -i $master ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
pid=$(ps -aef | grep $pat | xargs | cut -d ' ' -f 2)
echo "New loxilb pid: $pid" >&2
}

Expand All @@ -112,23 +115,30 @@ function restart_loxilbs() {
bka=" --ka=172.17.0.3:172.17.0.2"
fi
echo "Restarting $master"
pid=$(docker exec -i $master ps -aef | grep $mpat | xargs | cut -d ' ' -f 2)
echo "Killing $mpid" >&2
docker exec -dt $master kill -9 $pid
pid=$(ps -aef | grep $mpat | xargs | cut -d ' ' -f 2)
#pid=$(docker exec -i $master ps -aef | grep $mpat | xargs | cut -d ' ' -f 2)
echo "Killing $pid" >&2
#docker exec -dt $master kill -9 $pid
sudo kill -9 $pid
docker exec -dt $master ip link del llb0
docker exec -dt $master nohup /root/loxilb-io/loxilb/loxilb $mcopts $mself $mka > /dev/null &
pid=$(docker exec -i $master ps -aef | grep $mpat | xargs | cut -d ' ' -f 2)
echo "/root/loxilb-io/loxilb/loxilb $mcopts $mself $mka" >&2
docker exec -dt $master /root/loxilb-io/loxilb/loxilb $mcopts $mself $mka
pid=$(ps -aef | grep $mpat | xargs | cut -d ' ' -f 2)
#pid=$(docker exec -i $master ps -aef | grep $mpat | xargs | cut -d ' ' -f 2)
echo "New loxilb pid: $pid" >&2

echo "Restarting $backup"
pid=$(docker exec -i $backup ps -aef | grep $bpat | xargs | cut -d ' ' -f 2)
pid=$(ps -aef | grep $bpat | xargs | cut -d ' ' -f 2)
#pid=$(docker exec -i $backup ps -aef | grep $bpat | xargs | cut -d ' ' -f 2)
echo "Killing $pid" >&2
docker exec -dt $backup kill -9 $pid
#docker exec -dt $backup kill -9 $pid
sudo kill -9 $pid
docker exec -dt $backup ip link del llb0
docker exec -dt $backup nohup /root/loxilb-io/loxilb/loxilb $bcopts $bself $bka > /dev/null &
pid=$(docker exec -i $backup ps -aef | grep $bpat | xargs | cut -d ' ' -f 2)
echo "/root/loxilb-io/loxilb/loxilb $bcopts $bself $bka" >&2
docker exec -dt $backup /root/loxilb-io/loxilb/loxilb $bcopts $bself $bka
#pid=$(docker exec -i $backup ps -aef | grep $bpat | xargs | cut -d ' ' -f 2)
pid=$(ps -aef | grep $bpat | xargs | cut -d ' ' -f 2)
echo "New loxilb pid: $pid" >&2

}


2 changes: 1 addition & 1 deletion cicd/sctpmh-seagull/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source /vagrant/common.sh
echo "#########################################"
echo "Spawning all hosts"
echo "#########################################"

sudo sysctl net.ipv4.conf.all.arp_accept=1
spawn_docker_host --dock-type loxilb --dock-name llb1 --with-ka in
spawn_docker_host --dock-type loxilb --dock-name llb2 --with-ka in
spawn_docker_host --dock-type seahost --dock-name ep1
Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh-seagull/validation2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ for((i=0;i<5;i++)) do
echo -e "\n\n"
$dexec $master loxicmd get ct --servName=sctpmh1
echo -e "\n"
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "21.21.21.1 | 2.2.2.1" | xargs | cut -d '|' -f 10)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "22.22.22.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "21.21.21.1 | 2.2.2.1" | xargs | cut -d '|' -f 11)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "22.22.22.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)

echo "Counters: $p1c_new $p2c_new $p3c_new"

Expand Down
8 changes: 4 additions & 4 deletions cicd/sctpmh-seagull/validation3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ for((i=0;i<35;i++)) do
echo -e "\n\n"
$dexec $master loxicmd get ct --servName=sctpmh1
echo -e "\n"
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "21.21.21.1 | 2.2.2.1" | xargs | cut -d '|' -f 10)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "22.22.22.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "21.21.21.1 | 2.2.2.1" | xargs | cut -d '|' -f 11)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "22.22.22.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)

echo "Counters: $p1c_new $p2c_new $p3c_new"

Expand All @@ -62,7 +62,7 @@ for((i=0;i<35;i++)) do
echo -e "Turning off this path from User->LB\n"
$hexec user ip link set euserr1 down;
down=1
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)
else
if [[ $down == 1 ]]; then
p1dok=1
Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh-seagull/validation4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ for((i=0;i<35;i++)) do
echo -e "\n"
$dexec $master loxicmd get ct --servName=sctpmh2
echo -e "\n"
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "133.133.133.1 | 31.31.31.1" | xargs | cut -d '|' -f 10)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "134.134.134.1 | 32.32.32.1" | xargs | cut -d '|' -f 10)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "135.135.135.1 | 31.31.31.1" | xargs | cut -d '|' -f 10)
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "133.133.133.1 | 31.31.31.1" | xargs | cut -d '|' -f 11)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "134.134.134.1 | 32.32.32.1" | xargs | cut -d '|' -f 11)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "135.135.135.1 | 31.31.31.1" | xargs | cut -d '|' -f 11)

echo "Counters: $p1c_new $p2c_new $p3c_new"

Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh-seagull/validation5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ for((i=0;i<15;i++)) do

$dexec $master loxicmd get ct --servName=sctpmh1
echo -e "\n"
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "21.21.21.1 | 2.2.2.1" | xargs | cut -d '|' -f 10)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "22.22.22.1 | 1.1.1.1" | xargs | cut -d '|' -f 10)
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "20.20.20.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "21.21.21.1 | 2.2.2.1" | xargs | cut -d '|' -f 11)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh1 | grep "22.22.22.1 | 1.1.1.1" | xargs | cut -d '|' -f 11)

echo "Counters: $p1c_new $p2c_new $p3c_new"
if [[ $p1c_new -gt $p1c_old ]]; then
Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh-seagull/validation6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ for((i=0;i<15;i++)) do
echo -e "\n"
$dexec $master loxicmd get ct --servName=sctpmh2
echo -e "\n"
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "133.133.133.1 | 31.31.31.1" | xargs | cut -d '|' -f 10)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "134.134.134.1 | 32.32.32.1" | xargs | cut -d '|' -f 10)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "135.135.135.1 | 31.31.31.1" | xargs | cut -d '|' -f 10)
p1c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "133.133.133.1 | 31.31.31.1" | xargs | cut -d '|' -f 11)
p2c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "134.134.134.1 | 32.32.32.1" | xargs | cut -d '|' -f 11)
p3c_new=$(sudo docker exec -i $master loxicmd get ct --servName=sctpmh2 | grep "135.135.135.1 | 31.31.31.1" | xargs | cut -d '|' -f 11)


echo "Counters: $p1c_new $p2c_new $p3c_new"
Expand Down

0 comments on commit dbb5bd9

Please sign in to comment.