All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH mptcp-next] selftests: mptcp: support capture with other options
@ 2021-03-08 13:51 Matthieu Baerts
  0 siblings, 0 replies; only message in thread
From: Matthieu Baerts @ 2021-03-08 13:51 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

A capture was not started when multiple short options were combined,
e.g.

  ./mptcp_join.sh -fc

A regex is now used to handle this case.

Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---

Notes:
    If we want to reduce the number of commits, we might want to squash this
    one in "selftests: mptcp: Restore packet capture option in join tests"
    commit we have in our tree.
    Either is fine for me.

 tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index ca5bf22ca204..abeb24b7f8ec 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1410,9 +1410,13 @@ make_file "$sin" "server" 1
 trap cleanup EXIT
 
 for arg in "$@"; do
-	if [ "$arg" = "-c" ]; then
+	# check for "capture" arg before launching tests
+	if [[ "${arg}" =~ ^"-"[0-9a-zA-Z]*"c"[0-9a-zA-Z]*$ ]]; then
 		capture=1
-	else
+	fi
+
+	# exception for the capture option, the rest means: a part of the tests
+	if [ "${arg}" != "-c" ]; then
 		do_all_tests=0
 	fi
 done
-- 
2.30.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-08 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 13:51 [MPTCP] [PATCH mptcp-next] selftests: mptcp: support capture with other options Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.