Skip to content

Commit

Permalink
Fix test failures for multipath-tcp.org kernel. (multipath-tcp#203)
Browse files Browse the repository at this point in the history
* tests: Include multipath-tcp.org header as needed.

* tests: Drop dump_addrs check for mptcp.org kernel.

* tests: Only run mptcpwrap test for upstream kernel
  • Loading branch information
Ossama Othman authored Jan 25, 2022
1 parent 9585655 commit e2204ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/lib/test-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
#if defined(HAVE_LINUX_MPTCP_H_UPSTREAM) \
|| defined(HAVE_LINUX_MPTCP_H_MPTCP_ORG)
# include <linux/mptcp.h>
#else
#elif defined(HAVE_UPSTREAM_KERNEL)
# include <mptcpd/private/mptcp_upstream.h>
#else
# include <mptcpd/private/mptcp_org.h>
#endif

#include "test-util.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/test-commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ int main(void)
*/
assert(info.tests_called);

#ifdef HAVE_UPSTREAM_KERNEL
assert(info.dump_addrs_complete_count == 1);
#endif

l_idle_remove(idle);
l_netlink_destroy(rtnl);
Expand Down
11 changes: 11 additions & 0 deletions tests/test-mptcpwrap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@

set -e

# Check if we're using the upstream kernel.
#
# upstream: net.mptcp.enabled
# multipath-tcp.org: net.mptcp.mptcp_enabled
key=`sysctl --names --pattern 'mptcp\.enabled' net.mptcp`
if [ -z "$key" ]; then
# Do not run the test if we're not using the upstream kernel.
echo Not running upstream kernel. libmptcpwrap will not be tested.
exit 0
fi

LD_PRELOAD=../src/.libs/libmptcpwrap.so \
MPTCPWRAP_DEBUG=1 \
./mptcpwrap-tester

0 comments on commit e2204ec

Please sign in to comment.