[PATCH mptcp-next 3/5] selftests: mptcp: lib: stats: remove nstat rate columns

Matthieu Baerts (NGI0) posted 5 patches 3 weeks, 2 days ago
[PATCH mptcp-next 3/5] selftests: mptcp: lib: stats: remove nstat rate columns
Posted by Matthieu Baerts (NGI0) 3 weeks, 2 days ago
With the MPTCP selftests, the nstat daemon is not used. It means that
the last column (the rate) is always 0.0, and that's not something
interesting to display.

Then, this last column can be filtered out.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 22ab39749ca2..f59268b25707 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -369,9 +369,9 @@ mptcp_lib_nstat_init() {
 mptcp_lib_nstat_get() {
 	local ns="${1}"
 
-	# filter out non-*TCP stats
+	# filter out non-*TCP stats, and the rate (last column)
 	NSTAT_HISTORY="/tmp/${ns}.nstat" ip netns exec "${ns}" nstat |
-		grep Tcp > "/tmp/${ns}.out"
+		grep -o ".*Tcp\S\+\s\+[0-9]\+" > "/tmp/${ns}.out"
 }
 
 # $1: ns, $2: MIB counter

-- 
2.51.0