Skip to content

Commit

Permalink
netstress: tst_netload(): Fix renaming option
Browse files Browse the repository at this point in the history
Rename tst_netload() option -d => -f was wrong, because -f is already used.
Also renaming netstress.c -D option to -d was wrong, it was also already used.
Therefore rename both netstress.c -d and tst_netload -f (originally -d) to -c.

Fixes: 4294737 ("tst_netload(): Rename option -d => -f")
Fixes: 4ccb96b ("netstress: Rename option -D => -d")
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Dec 19, 2023
1 parent 1c90d7e commit d5ab380
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions testcases/lib/tst_net.sh
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,12 @@ tst_netload()
fi

OPTIND=0
while getopts :a:f:H:n:N:r:R:S:b:t:T:fFe:m:A:D: opt; do
while getopts :a:c:H:n:N:r:R:S:b:t:T:fFe:m:A:D: opt; do
case "$opt" in
a) c_num="$OPTARG" ;;
H) c_opts="${c_opts}-H $OPTARG "
hostopt="$OPTARG" ;;
f) rfile="$OPTARG" ;;
c) rfile="$OPTARG" ;;
n) c_opts="${c_opts}-n $OPTARG " ;;
N) c_opts="${c_opts}-N $OPTARG " ;;
r) c_requests="$OPTARG" ;;
Expand Down Expand Up @@ -790,7 +790,7 @@ tst_netload()
fi

s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -f $PWD/$rfile"
c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -c $PWD/$rfile"

tst_res_ TINFO "run server 'netstress $s_opts'"
tst_res_ TINFO "run client 'netstress -l $c_opts' $run_cnt times"
Expand Down
2 changes: 1 addition & 1 deletion testcases/network/busy_poll/busy_poll01.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test()
for x in 50 0; do
tst_res TINFO "set low latency busy poll to $x"
set_busy_poll $x
tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -f res_$x
tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -c res_$x
done

tst_netload_compare $(cat res_0) $(cat res_50) 1
Expand Down
2 changes: 1 addition & 1 deletion testcases/network/busy_poll/busy_poll02.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test()
for x in 50 0; do
tst_res TINFO "set low latency busy poll to $x per socket"
set_busy_poll $x
tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -f res_$x -b $x
tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -c res_$x -b $x
done

tst_netload_compare $(cat res_0) $(cat res_50) 1
Expand Down
2 changes: 1 addition & 1 deletion testcases/network/busy_poll/busy_poll03.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test()
for x in 50 0; do
tst_res TINFO "set low latency busy poll to $x per $2 socket"
set_busy_poll $x
tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -f res_$x \
tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -c res_$x \
-b $x -T $2
done

Expand Down
2 changes: 1 addition & 1 deletion testcases/network/netstress/netstress.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ static struct tst_test test = {
{"n:", &narg, "Client message size"},
{"N:", &Narg, "Server message size"},
{"m:", &Targ, "Receive timeout in milliseconds (not used by UDP/DCCP client)"},
{"d:", &rpath, "Path to file where result is saved"},
{"c:", &rpath, "Path to file where result is saved"},
{"A:", &Aarg, "Max payload length (generated randomly)"},

{"R:", &Rarg, "Server requests after which conn.closed"},
Expand Down
6 changes: 3 additions & 3 deletions testcases/network/virt/virt_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,18 @@ virt_compare_netperf()
local expect_res="${1:-pass}"
local opts="$2"

tst_netload -H $ip_virt_remote $opts -f res_ipv4 -e $expect_res \
tst_netload -H $ip_virt_remote $opts -c res_ipv4 -e $expect_res \
-D ltp_v0 || ret1="fail"

tst_netload -H ${ip6_virt_remote} $opts -f res_ipv6 -e $expect_res \
tst_netload -H ${ip6_virt_remote} $opts -c res_ipv6 -e $expect_res \
-D ltp_v0 || ret2="fail"

[ "$ret1" = "fail" -o "$ret2" = "fail" ] && return

local vt="$(cat res_ipv4)"
local vt6="$(cat res_ipv6)"

tst_netload -H $(tst_ipaddr rhost) $opts -f res_lan
tst_netload -H $(tst_ipaddr rhost) $opts -c res_lan

local lt="$(cat res_lan)"
tst_res TINFO "time lan IPv${TST_IPVER}($lt) $virt_type IPv4($vt) and IPv6($vt6) ms"
Expand Down

0 comments on commit d5ab380

Please sign in to comment.