From 35eef2594ebb69664f78d91a4891d5e01b2f26b6 Mon Sep 17 00:00:00 2001 From: Alan Maguire Date: Thu, 28 Nov 2024 16:46:09 +0000 Subject: [PATCH] test: fix frag tests frag changes are global ns only, so monitor there exclusively Signed-off-by: Alan Maguire --- test/frag_legacy_test.sh | 16 ++++++++-------- test/frag_test.sh | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/frag_legacy_test.sh b/test/frag_legacy_test.sh index 67bd5aa..7bd9501 100644 --- a/test/frag_legacy_test.sh +++ b/test/frag_legacy_test.sh @@ -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" @@ -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 @@ -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}') @@ -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 diff --git a/test/frag_test.sh b/test/frag_test.sh index 1b21ce8..b51fa19 100644 --- a/test/frag_test.sh +++ b/test/frag_test.sh @@ -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 @@ -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}') @@ -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