Fix sctp_test flakiness
We open an SCTP socket before trying to enable sctp authentication
to force the kernel to bring the sctp module.
Change-Id: I46beb87f00d72cf58233d18efc8c93702902211f
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/sctp_test.cc b/aos/network/sctp_test.cc
index 458d2d1..bce5c19 100644
--- a/aos/network/sctp_test.cc
+++ b/aos/network/sctp_test.cc
@@ -11,6 +11,7 @@
#include "aos/network/sctp_client.h"
#include "aos/network/sctp_lib.h"
#include "aos/network/sctp_server.h"
+#include "sctp_lib.h"
DECLARE_bool(disable_ipv6);
@@ -28,10 +29,10 @@
namespace {
void EnableSctpAuthIfAvailable() {
#if HAS_SCTP_AUTH
- CHECK(system("/usr/sbin/modprobe sctp || /sbin/modprobe sctp; "
- "/usr/sbin/sysctl net.sctp.auth_enable=1 || "
- "/sbin/sysctl "
- "net.sctp.auth_enable=1") == 0)
+ // Open an SCTP socket to bring the kernel SCTP module
+ SctpServer server(1, "localhost");
+ CHECK(system("/usr/sbin/sysctl net.sctp.auth_enable=1 || "
+ "/sbin/sysctl net.sctp.auth_enable=1") == 0)
<< "Couldn't enable sctp authentication.";
#endif
}