History

selftests/landlock: Test that MPTCP actions are not restricted

Extend protocol fixture with test suits for MPTCP protocol. Add CONFIG_MPTCP and CONFIG_MPTCP_IPV6 options in config.

Mikhail Ivanov committed 1 year ago

Commit 3d403391 parent f5534d52 files · +46 −0Browse files

Unified · Split

2 files
  1. tools/testing/selftests/landlock/config +2 −0
  2. tools/testing/selftests/landlock/net_test.c +44 −0
tools/testing/selftests/landlock/config+2−0
@@ -4,6 +4,8 @@ CONFIG_CGROUP_SCHED=y · 3 unmodified lines
44 CONFIG_INET=y
55 CONFIG_IPV6=y
66 CONFIG_KEYS=y
7+CONFIG_MPTCP=y
8+CONFIG_MPTCP_IPV6=y
79 CONFIG_NET=y
810 CONFIG_NET_NS=y
911 CONFIG_OVERLAY_FS=y
tools/testing/selftests/landlock/net_test.c+44−0
@@ -312,6 +312,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_tcp2) { · 311 unmodified lines
312312 },
313313 };
314314
315+/* clang-format off */
316+FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_mptcp) {
317+ /* clang-format on */
318+ .sandbox = NO_SANDBOX,
319+ .prot = {
320+ .domain = AF_INET,
321+ .type = SOCK_STREAM,
322+ .protocol = IPPROTO_MPTCP,
323+ },
324+};
325+
315326 /* clang-format off */
316327 FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp1) {
317328 /* clang-format on */
@@ -335,6 +346,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp2) { · 17 unmodified lines
335346 },
336347 };
337348
349+/* clang-format off */
350+FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_mptcp) {
351+ /* clang-format on */
352+ .sandbox = NO_SANDBOX,
353+ .prot = {
354+ .domain = AF_INET6,
355+ .type = SOCK_STREAM,
356+ .protocol = IPPROTO_MPTCP,
357+ },
358+};
359+
338360 /* clang-format off */
339361 FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_udp) {
340362 /* clang-format on */
@@ -398,6 +420,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_tcp2) { · 57 unmodified lines
398420 },
399421 };
400422
423+/* clang-format off */
424+FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_mptcp) {
425+ /* clang-format on */
426+ .sandbox = TCP_SANDBOX,
427+ .prot = {
428+ .domain = AF_INET,
429+ .type = SOCK_STREAM,
430+ .protocol = IPPROTO_MPTCP,
431+ },
432+};
433+
401434 /* clang-format off */
402435 FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_tcp1) {
403436 /* clang-format on */
@@ -421,6 +454,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_tcp2) { · 17 unmodified lines
421454 },
422455 };
423456
457+/* clang-format off */
458+FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_mptcp) {
459+ /* clang-format on */
460+ .sandbox = TCP_SANDBOX,
461+ .prot = {
462+ .domain = AF_INET6,
463+ .type = SOCK_STREAM,
464+ .protocol = IPPROTO_MPTCP,
465+ },
466+};
467+
424468 /* clang-format off */
425469 FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_udp) {
426470 /* clang-format on */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t