Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix frag tests
frag changes are global ns only, so monitor there exclusively

Signed-off-by: Alan Maguire <[email protected]>
  • Loading branch information
alan-maguire committed Nov 28, 2024
commit 35eef2594ebb69664f78d91a4891d5e01b2f26b6
16 changes: 8 additions & 8 deletions test/frag_legacy_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ for FAMILY in ipv6 ipv4 ; do
;;
esac

test_start "$0|frag legacy test to $ADDR:$PORT $FAMILY $NS"
test_start "$0|frag test to $ADDR:$PORT $FAMILY $NS"

if [[ $NS == "global" ]]; then
CLIENT_PREFIX="ip netns exec $NETNS"
Expand All @@ -70,12 +70,12 @@ for FAMILY in ipv6 ipv4 ; do

$CLIENT_PREFIX ethtool --offload $CLIENT_VETH rx off tx off gso off gro off lro off tso off
$SERVER_PREFIX ethtool --offload $SERVER_VETH rx off tx off gso off gro off lro off tso off
frag_orig=($($SERVER_PREFIX sysctl -n $SYSCTL_NAME))
low_orig=($($SERVER_PREFIX sysctl -n ${SYSCTL_PREFIX}low_thresh))
$SERVER_PREFIX sysctl -w ${SYSCTL_PREFIX}low_thresh=8192
$SERVER_PREFIX sysctl -w $SYSCTL_NAME="8192"
frag_orig=($(sysctl -n $SYSCTL_NAME))
low_orig=($(sysctl -n ${SYSCTL_PREFIX}low_thresh))
sysctl -w ${SYSCTL_PREFIX}low_thresh=8192
sysctl -w $SYSCTL_NAME="8192"

frag_pre=($($SERVER_PREFIX sysctl -n $SYSCTL_NAME))
frag_pre=($(sysctl -n $SYSCTL_NAME))

# prevent firewall from reassembling packets.
set +e
Expand All @@ -88,7 +88,7 @@ for FAMILY in ipv6 ipv4 ; do

echo "Running ${MODE}..."
if [[ $MODE != "baseline" ]]; then
test_run_cmd_local "$BPFTUNE -dsL &" true
test_run_cmd_local "$BPFTUNE -sL &" true
sleep $SETUPTIME
else
LOGSZ=$(wc -l $LOGFILE | awk '{print $1}')
Expand All @@ -109,7 +109,7 @@ for FAMILY in ipv6 ipv4 ; do
if [[ -n "$FIREWALLD_PID" ]]; then
service firewalld start
fi
frag_post=($($SERVER_PREFIX sysctl -n $SYSCTL_NAME))
frag_post=($(sysctl -n $SYSCTL_NAME))
if [[ -n $SERVER_PREFIX ]]; then
sysctl -w ${SYSCTL_NAME}=$frag_orig
sysctl -w ${SYSCTL_PREFIX}low_thresh=$low_orig
Expand Down
14 changes: 7 additions & 7 deletions test/frag_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ for FAMILY in ipv6 ipv4 ; do

$CLIENT_PREFIX ethtool --offload $CLIENT_VETH rx off tx off gso off gro off lro off tso off
$SERVER_PREFIX ethtool --offload $SERVER_VETH rx off tx off gso off gro off lro off tso off
frag_orig=($($SERVER_PREFIX sysctl -n $SYSCTL_NAME))
low_orig=($($SERVER_PREFIX sysctl -n ${SYSCTL_PREFIX}low_thresh))
$SERVER_PREFIX sysctl -w ${SYSCTL_PREFIX}low_thresh=8192
$SERVER_PREFIX sysctl -w $SYSCTL_NAME="8192"
frag_orig=($(sysctl -n $SYSCTL_NAME))
low_orig=($(sysctl -n ${SYSCTL_PREFIX}low_thresh))
sysctl -w ${SYSCTL_PREFIX}low_thresh=8192
sysctl -w $SYSCTL_NAME="8192"

frag_pre=($($SERVER_PREFIX sysctl -n $SYSCTL_NAME))
frag_pre=($(sysctl -n $SYSCTL_NAME))

# prevent firewall from reassembling packets.
set +e
Expand All @@ -88,7 +88,7 @@ for FAMILY in ipv6 ipv4 ; do

echo "Running ${MODE}..."
if [[ $MODE != "baseline" ]]; then
test_run_cmd_local "$BPFTUNE -ds &" true
test_run_cmd_local "$BPFTUNE -s &" true
sleep $SETUPTIME
else
LOGSZ=$(wc -l $LOGFILE | awk '{print $1}')
Expand All @@ -109,7 +109,7 @@ for FAMILY in ipv6 ipv4 ; do
if [[ -n "$FIREWALLD_PID" ]]; then
service firewalld start
fi
frag_post=($($SERVER_PREFIX sysctl -n $SYSCTL_NAME))
frag_post=($(sysctl -n $SYSCTL_NAME))
if [[ -n $SERVER_PREFIX ]]; then
sysctl -w ${SYSCTL_NAME}=$frag_orig
sysctl -w ${SYSCTL_PREFIX}low_thresh=$low_orig
Expand Down