]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests: mptcp: join: check backup support in signal endp
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Fri, 9 Aug 2024 09:10:32 +0000 (11:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2024 03:45:49 +0000 (05:45 +0200)
commit f833470c27832136d4416d8fc55d658082af0989 upstream.

Before the previous commit, 'signal' endpoints with the 'backup' flag
were ignored when sending the MP_JOIN.

The MPTCP Join selftest has then been modified to validate this case:
the "single address, backup" test, is now validating the MP_JOIN with a
backup flag as it is what we expect it to do with such name. The
previous version has been kept, but renamed to "single address, switch
to backup" to avoid confusions.

The "single address with port, backup" test is also now validating the
MPJ with a backup flag, which makes more sense than checking the switch
to backup with an MP_PRIO.

The "mpc backup both sides" test is now validating that the backup flag
is also set in MP_JOIN from and to the addresses used in the initial
subflow, using the special ID 0.

The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.

Fixes: 4596a2c1b7f5 ("mptcp: allow creating non-backup subflows")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ Conflicts in mptcp_join.sh because 'run_tests' helper has been
  modified in multiple commits that are not in this version, e.g. commit
  e571fb09c893 ("selftests: mptcp: add speed env var") and commit
  ae7bd9ccecc3 ("selftests: mptcp: join: option to execute specific
  tests"). Adaptations have been made to use the old way, similar to
  what is done around.
  Also in this version, there is no "single address with port, backup"
  subtest. Same for "mpc backup both sides". ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh

index 182323b1acc5366b6a1c8458999271954ab04eed..145749460bec313197e223c8ff172560161159a2 100755 (executable)
@@ -1586,12 +1586,21 @@ backup_tests()
        chk_prio_nr 0 1 1 0
 
        # single address, backup
+       reset
+       ip netns exec $ns1 ./pm_nl_ctl limits 0 1
+       ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal,backup
+       ip netns exec $ns2 ./pm_nl_ctl limits 1 1
+       run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow nobackup
+       chk_join_nr "single address, backup" 1 1 1
+       chk_add_nr 1 1
+       chk_prio_nr 1 0 0 1
+
        reset
        ip netns exec $ns1 ./pm_nl_ctl limits 0 1
        ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
        ip netns exec $ns2 ./pm_nl_ctl limits 1 1
        run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow backup
-       chk_join_nr "single address, backup" 1 1 1
+       chk_join_nr "single address, switch to backup" 1 1 1
        chk_add_nr 1 1
        chk_prio_nr 1 0 0 0
 }