@@ -7,7 +7,7 @@
#include "network_helpers.h"
#include "mptcp_sock.skel.h"
-#define NS_TEST "mptcp_ns"
+char NS_TEST[32];
#ifndef TCP_CA_NAME_MAX
#define TCP_CA_NAME_MAX 16
@@ -147,6 +147,8 @@ static void test_base(void)
if (!ASSERT_GE(cgroup_fd, 0, "test__join_cgroup"))
return;
+ srand(time(NULL));
+ snprintf(NS_TEST, sizeof(NS_TEST), "mptcp_ns_%d", rand());
SYS(fail, "ip netns add %s", NS_TEST);
SYS(fail, "ip -net %s link set dev lo up", NS_TEST);
@@ -178,6 +180,7 @@ static void test_base(void)
close_netns(nstoken);
SYS_NOFAIL("ip netns del " NS_TEST " &> /dev/null");
+ SYS_NOFAIL("ip netns show %s", NS_TEST);
close(cgroup_fd);
}