selftests: mptcp: join: allow running -cCi
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Mon, 7 Mar 2022 20:44:33 +0000 (12:44 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Mar 2022 06:06:11 +0000 (22:06 -0800)
commit826d7bdca83328b101853b48ee6b5e9bb6a5f537
tree8d19247da5bf62f9dad692d8bf3eab5e5f7ea09f
parentea56dcb43c2054426c5a8d7befa8d993a060b26b
selftests: mptcp: join: allow running -cCi

Without this patch, no tests would be ran when launching:

  mptcp_join.sh -cCi

In any order or a combination with 2 of these letters.

The recommended way with getopt is first parse all options and then act.

This allows to do some actions in priority, e.g. display the help menu
and stop.

But also some global variables changing the behaviour of this selftests
 -- like the ones behind -cCi options -- can be set before running the
different tests. By doing that, we can also avoid long and unreadable
regex.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh