Skip to content

Commit

Permalink
loxilb-iogh-87 : sctpmh with sctp_test test suite cicd updated for ra…
Browse files Browse the repository at this point in the history
…ndom size packet test
  • Loading branch information
nik-netlox committed Sep 11, 2024
1 parent b93996f commit b1f225d
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 33 deletions.
4 changes: 2 additions & 2 deletions cicd/sctpmh-seagull/check_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ function check_ha() {
else
count=$(( $count + 1 ))
if [[ $count -ge 20 ]]; then
echo "KA llb1-$status1, llb2-$status2 [NOK]" >&2
echo "KA llb1-$status1, llb2-$status2 [NOK] - Exiting" >&2
exit 1;
fi
echo "KA llb1-$status1, llb2-$status2 [NOK]" >&2
sleep 5
fi
done
Expand All @@ -34,7 +35,6 @@ function checkSync() {
sync=0
while [[ $count -le 5 ]] ; do
echo -e "\nStatus at MASTER:$master\n" >&2
#$dexec $master loxicmd get ct | grep est >&2
ct=`$dexec $master loxicmd get ct | grep est`
echo "${ct//'\n'/$'\n'}" >&2

Expand Down
14 changes: 11 additions & 3 deletions cicd/sctpmh-seagull/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spawn_docker_host() {
fi
shift 2
;;
-d | --ka-config )
-n | --ka-config )
kpath="$2"
if [[ -z ${ka+x} ]]; then
ka="in"
Expand All @@ -87,6 +87,10 @@ spawn_docker_host() {
extra_opts="$2"
shift 2
;;
-x | --docker-args)
docker_extra_opts="$2"
shift 2
;;
-*|--*)
echo "Unknown option $1"
exit
Expand All @@ -109,11 +113,11 @@ spawn_docker_host() {
fi
if [[ ! -z ${ka+x} ]]; then
sudo mkdir -p /etc/shared/$dname/
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt --pid=host --cgroupns=host --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log -v /etc/shared/$dname:/etc/shared $loxilb_config --name $dname $lxdocker
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt $docker_extra_opts --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log -v /etc/shared/$dname:/etc/shared $loxilb_config --name $dname $lxdocker
get_llb_peerIP $dname
docker exec -dt $dname /root/loxilb-io/loxilb/loxilb $bgp_opts $cluster_opts $ka_opts $extra_opts
else
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt --pid=host --cgroupns=host --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log $loxilb_config --name $dname $lxdocker $bgp_opts
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt $docker_extra_opts --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log $loxilb_config --name $dname $lxdocker $bgp_opts
docker exec -dt $dname /root/loxilb-io/loxilb/loxilb $bgp_opts $cluster_opts $extra_opts
fi
elif [[ "$dtype" == "host" ]]; then
Expand Down Expand Up @@ -553,6 +557,10 @@ function create_lb_rule() {
echo "$1: loxicmd create lb ${args[*]}"
$dexec $1 loxicmd create lb ${args[*]}

if [[ ${args[*]} == *"--mode=fullproxy"* ]]; then
return
fi

hook=$($dexec $1 tc filter show dev eth0 ingress | grep tc_packet_func)
if [[ $hook != *"tc_packet_func"* ]]; then
echo "ERROR : No hook point found";
Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh-seagull/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ echo -e "\n$border"

echo -e "\n\n\n$border\n"
if [[ $code == 0 ]]; then
echo -e "SCTP Multihoming CICD [OK]"
echo -e "SCTP multihoming with seagull CICD [OK]"
else
echo -e "SCTP Multihoming CICD [NOK]"
echo -e "SCTP Multihoming with seagull CICD [NOK]"
fi
echo -e "\n$border\n"
echo -e "\n$border\n"`
exit $code
2 changes: 1 addition & 1 deletion cicd/sctpmh-seagull/validation1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else
echo "llb1 ep-info"
$dexec llb1 loxicmd get ep
echo "llb1 bpf-info"
$dexec llb1 ntc filter show dev eth0 ingress
$dexec llb1 tc filter show dev eth0 ingress
echo "BFP trace -- "
sudo timeout 5 cat /sys/kernel/debug/tracing/trace_pipe
sudo killall -9 cat
Expand Down
24 changes: 12 additions & 12 deletions cicd/sctpmh/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ echo "#########################################"
echo "Connecting and configuring hosts"
echo "#########################################"

connect_docker_hosts user r1 1500
connect_docker_hosts user r2 1500
connect_docker_hosts r1 sw1 1500
connect_docker_hosts r2 sw1 1500
connect_docker_hosts sw1 llb1 1500
connect_docker_hosts sw1 llb2 1500
connect_docker_hosts llb1 sw2 1500
connect_docker_hosts llb2 sw2 1500
connect_docker_hosts sw2 r3 1500
connect_docker_hosts sw2 r4 1500
connect_docker_hosts r3 ep1 1500
connect_docker_hosts r4 ep1 1500
connect_docker_hosts user r1
connect_docker_hosts user r2
connect_docker_hosts r1 sw1
connect_docker_hosts r2 sw1
connect_docker_hosts sw1 llb1
connect_docker_hosts sw1 llb2
connect_docker_hosts llb1 sw2
connect_docker_hosts llb2 sw2
connect_docker_hosts sw2 r3
connect_docker_hosts sw2 r4
connect_docker_hosts r3 ep1
connect_docker_hosts r4 ep1

create_docker_host_cnbridge --host1 sw1 --host2 llb1
create_docker_host_cnbridge --host1 sw1 --host2 llb2
Expand Down
4 changes: 2 additions & 2 deletions cicd/sctpmh/validation2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo -e "\nHA state Master:$master BACKUP-$backup\n"
$hexec ep1 sctp_test -H 31.31.31.1 -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 50000 > user.out &
$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -c 6 -x 10000 > user.out &

#Path counters
p1c_old=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.(50000/50000)"`
fin=`tail -n 100 user.out | grep "Client: Sending packets.(10000/10000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand Down
7 changes: 5 additions & 2 deletions cicd/sctpmh/validation3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo -e "\nTraffic Flow: User -> LB -> EP "
$hexec ep1 sctp_test -H 31.31.31.1 -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 50000 > user.out &
$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -c 6 -x 1000 > user.out &
#Path counters
p1c_old=0
p1c_new=0
Expand All @@ -28,8 +28,11 @@ p3c_old=0
p3c_new=0
down=0
code=0

sleep 5

for((i=0;i<200;i++)) do
fin=`tail -n 100 user.out | grep "Client: Sending packets.(50000/50000)"`
fin=`tail -n 100 user.out | grep "Client: Sending packets.(1000/1000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand Down
6 changes: 4 additions & 2 deletions cicd/sctpmh/validation4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo -e "\nTraffic Flow: EP ---> LB ---> User"
$hexec user sctp_test -H 0.0.0.0 -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 50000 > ep1.out &
$hexec ep1 stdbuf -oL sctp_test -H 31.31.31.1 -B 32.32.32.1 -P 20000 -h $extIP -p $port -s -c 6 -x 1000 > ep1.out &

#Path counters
p1c_old=0
Expand All @@ -27,8 +27,10 @@ p3c_old=0
p3c_new=0
down=0
code=0
sleep 2

for((i=0;i<200;i++)) do
fin=`tail -n 100 ep1.out | grep "Client: Sending packets.(50000/50000)"`
fin=`tail -n 100 ep1.out | grep "Client: Sending packets.(1000/1000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh/validation5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sudo pkill sctp_test
$hexec ep1 sctp_test -H 31.31.31.1 -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 1400 -x 300000 > user.out &
$hexec user stdbuf -oL sctp_test -H 1.1.1.1 -B 2.2.2.1 -P 20000 -h $extIP -p $port -s -c 6 -x 10000 > user.out &

#Path counters
p1c_old=0
Expand All @@ -33,8 +33,8 @@ hadone=0
code=0
nsyncOk=0

for((i=0;i<200;i++)) do
fin=`tail -n 100 user.out | grep "Client: Sending packets.(300000/300000)"`
for((i=0;i<400;i++)) do
fin=`tail -n 100 user.out | grep "Client: Sending packets.(10000/10000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand Down
6 changes: 3 additions & 3 deletions cicd/sctpmh/validation6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sudo pkill sctp_test
$hexec user sctp_test -H 0.0.0.0 -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 1400 -x 500000 > ep1.out &
$hexec ep1 stdbuf -oL sctp_test -H 31.31.31.1 -B 32.32.32.1 -P 20000 -h $extIP -p $port -s -c 6 -x 10000 > ep1.out &

#Path counters
p1c_old=0
Expand All @@ -35,8 +35,8 @@ hadone=0
code=0
nsyncOk=0

for((i=0;i<200;i++)) do
fin=`tail -n 100 ep1.out | grep "Client: Sending packets.(500000/500000)"`
for((i=0;i<500;i++)) do
fin=`tail -n 100 ep1.out | grep "Client: Sending packets.(10000/10000)"`
if [[ ! -z $fin ]]; then
fin=1
echo "sctp_test done."
Expand Down

0 comments on commit b1f225d

Please sign in to comment.