[PATCH testsuite] tests/inet_socket: enable MPTCP if it's disabled via sysctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In CentOS Stream 10 (and possibly other environments) the
net.mptcp.enabled sysctl will be set to 0 by default. The testuite
currently doesn't detect this and hangs when trying to run the MPTCP
tests. Adjust the test to temporarily enable MPTCP during the test so
that it can succeed in these conditions.

Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
---
 tests/inet_socket/test | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/inet_socket/test b/tests/inet_socket/test
index 08c7b1d..ae06ae7 100755
--- a/tests/inet_socket/test
+++ b/tests/inet_socket/test
@@ -91,6 +91,16 @@ sub server_end {
     system("rm -f $basedir/flag");
 }
 
+if ( $proto eq "mptcp" ) {
+
+    # Temporarily enable MPTCP if it's disabled by default
+    $mptcp_enabled = `sysctl -n net.mptcp.enabled`;
+    chomp($mptcp_enabled);
+    if ( $mptcp_enabled ne "1" ) {
+        system("sysctl -w net.mptcp.enabled=1");
+    }
+}
+
 # Load NetLabel configuration for full CIPSO/IPv4 labeling over loopback.
 system "/bin/sh $basedir/cipso-fl-load";
 
@@ -445,4 +455,10 @@ if ($test_calipso) {
     system "/bin/sh $basedir/calipso-flush";
 }
 
+if ( $proto eq "mptcp" and $mptcp_enabled ne "1" ) {
+
+    # Reset net.mptcp.enabled if it was 0 before test
+    system("sysctl -w net.mptcp.enabled=0");
+}
+
 exit;
-- 
2.48.1





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux