Skip to content

Commit

Permalink
Squash to "selftests: mptcp: add mptcp_lib_get_counter"
Browse files Browse the repository at this point in the history
Please add this line into the commit log:

'''
Use this helper in test_prio() in userspace_pm.sh too instead of
open-coding.
'''

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
  • Loading branch information
geliangtang authored and intel-lab-lkp committed Nov 8, 2023
1 parent 7a9c27d commit 7ca0160
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tools/testing/selftests/net/mptcp/userspace_pm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -874,19 +874,21 @@ test_prio()

# Check TX
print_test "MP_PRIO TX"
count=$(ip netns exec "$ns2" nstat -as | grep MPTcpExtMPPrioTx | awk '{print $2}')
[ -z "$count" ] && count=0
if [ $count != 1 ]; then
count=$(mptcp_lib_get_counter "$ns2" "MPTcpExtMPPrioTx")
if [ -z "$count" ]; then
test_skip
elif [ $count != 1 ]; then
test_fail "Count != 1: ${count}"
else
test_pass
fi

# Check RX
print_test "MP_PRIO RX"
count=$(ip netns exec "$ns1" nstat -as | grep MPTcpExtMPPrioRx | awk '{print $2}')
[ -z "$count" ] && count=0
if [ $count != 1 ]; then
count=$(mptcp_lib_get_counter "$ns1" "MPTcpExtMPPrioRx")
if [ -z "$count" ]; then
test_skip
elif [ $count != 1 ]; then
test_fail "Count != 1: ${count}"
else
test_pass
Expand Down

0 comments on commit 7ca0160

Please sign in to comment.