Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2] selftests: net: add tests for PPPoL2TP
@ 2026-05-14  1:57 Qingfang Deng
  2026-05-19  8:22 ` patchwork-bot+netdevbpf
  2026-05-21  2:24 ` Matthieu Baerts
  0 siblings, 2 replies; 6+ messages in thread
From: Qingfang Deng @ 2026-05-14  1:57 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Felix Maurer, Sebastian Andrzej Siewior,
	Qingfang Deng, Petr Machata, linux-kernel, linux-ppp, netdev,
	linux-kselftest

Add ping, iperf3, and recursion tests for PPPoL2TP.

Assisted-by: Gemini:gemini-3-flash
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
v2:
 - use named veth pair instead of netkit
 - reset RET prior to the recursion test
v1: https://lore.kernel.org/netdev/20260508032158.67887-1-qingfang.deng@linux.dev

 tools/testing/selftests/net/ppp/Makefile    |  1 +
 tools/testing/selftests/net/ppp/config      |  2 +
 tools/testing/selftests/net/ppp/pppol2tp.sh | 95 +++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100755 tools/testing/selftests/net/ppp/pppol2tp.sh

diff --git a/tools/testing/selftests/net/ppp/Makefile b/tools/testing/selftests/net/ppp/Makefile
index b39b0abadde6..6036fa134351 100644
--- a/tools/testing/selftests/net/ppp/Makefile
+++ b/tools/testing/selftests/net/ppp/Makefile
@@ -5,6 +5,7 @@ top_srcdir = ../../../../..
 TEST_PROGS := \
 	ppp_async.sh \
 	pppoe.sh \
+	pppol2tp.sh \
 # end of TEST_PROGS
 
 TEST_FILES := \
diff --git a/tools/testing/selftests/net/ppp/config b/tools/testing/selftests/net/ppp/config
index b45d25c5b970..843545df8f03 100644
--- a/tools/testing/selftests/net/ppp/config
+++ b/tools/testing/selftests/net/ppp/config
@@ -1,4 +1,5 @@
 CONFIG_IPV6=y
+CONFIG_L2TP=m
 CONFIG_PACKET=y
 CONFIG_PPP=m
 CONFIG_PPP_ASYNC=m
@@ -6,4 +7,5 @@ CONFIG_PPP_BSDCOMP=m
 CONFIG_PPP_DEFLATE=m
 CONFIG_PPPOE=m
 CONFIG_PPPOE_HASH_BITS_4=y
+CONFIG_PPPOL2TP=m
 CONFIG_VETH=y
diff --git a/tools/testing/selftests/net/ppp/pppol2tp.sh b/tools/testing/selftests/net/ppp/pppol2tp.sh
new file mode 100755
index 000000000000..5b592785f1f9
--- /dev/null
+++ b/tools/testing/selftests/net/ppp/pppol2tp.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+source ppp_common.sh
+
+VETH_SERVER="veth-server"
+VETH_CLIENT="veth-client"
+OUTER_IP_SERVER="172.16.1.1"
+OUTER_IP_CLIENT="172.16.1.2"
+
+PPPOL2TP_DIR=$(mktemp -d /tmp/pppol2tp.XXXXXX)
+
+# shellcheck disable=SC2329
+cleanup() {
+	cleanup_all_ns
+	rm -rf "$PPPOL2TP_DIR"
+}
+
+trap cleanup EXIT
+
+require_command xl2tpd
+ppp_common_init
+modprobe -q l2tp_ppp
+
+# Create the veth pair
+ip link add "$VETH_SERVER" type veth peer name "$VETH_CLIENT"
+ip link set "$VETH_SERVER" netns "$NS_SERVER"
+ip link set "$VETH_CLIENT" netns "$NS_CLIENT"
+ip -netns "$NS_SERVER" link set "$VETH_SERVER" up
+ip -netns "$NS_CLIENT" link set "$VETH_CLIENT" up
+ip -netns "$NS_SERVER" address add dev "$VETH_SERVER" "$OUTER_IP_SERVER" peer "$OUTER_IP_CLIENT"
+ip -netns "$NS_CLIENT" address add dev "$VETH_CLIENT" "$OUTER_IP_CLIENT" peer "$OUTER_IP_SERVER"
+
+# Generate configuration files
+cat > "$PPPOL2TP_DIR/l2tp-server.conf" <<EOF
+[global]
+listen-addr = $OUTER_IP_SERVER
+access control = no
+
+[lns default]
+ip range = $IP_CLIENT
+local ip = $IP_SERVER
+require authentication = no
+require chap = no
+require pap = no
+ppp debug = yes
+pppoptfile = $(pwd)/pppoe-server-options
+EOF
+
+cat > "$PPPOL2TP_DIR/l2tp-client.conf" <<EOF
+[global]
+listen-addr = $OUTER_IP_CLIENT
+access control = no
+
+[lac server]
+lns = $OUTER_IP_SERVER
+require authentication = no
+require chap = no
+require pap = no
+ppp debug = yes
+pppoptfile = $(pwd)/pppoe-server-options
+EOF
+
+# Start the L2TP Server
+ip netns exec "$NS_SERVER" xl2tpd -D -c "$PPPOL2TP_DIR/l2tp-server.conf" \
+	-p "$PPPOL2TP_DIR/l2tp-server.pid" -C "$PPPOL2TP_DIR/l2tp-server.control" &
+
+# Start the L2TP Client
+ip netns exec "$NS_CLIENT" xl2tpd -D -c "$PPPOL2TP_DIR/l2tp-client.conf" \
+	-p "$PPPOL2TP_DIR/l2tp-client.pid" -C "$PPPOL2TP_DIR/l2tp-client.control" &
+
+# Wait for xl2tpd to start and open their control pipes
+slowwait 2 [ -p "$PPPOL2TP_DIR/l2tp-server.control" ]
+slowwait 2 [ -p "$PPPOL2TP_DIR/l2tp-client.control" ]
+
+# Connect LAC to LNS
+echo "c server" > "$PPPOL2TP_DIR/l2tp-client.control"
+
+ppp_test_connectivity
+
+log_test "PPPoL2TP"
+
+# Recursion test
+RET=0
+# Delete route to LNS IP
+ip -netns "$NS_CLIENT" route del "$OUTER_IP_SERVER"
+# Add default route through ppp0
+ip -netns "$NS_CLIENT" route add default dev ppp0
+# ping (we expect the ping to fail but not deadlock the system)
+ip netns exec "$NS_CLIENT" ping -c 1 "$IP_SERVER" -w 1
+check_fail $?
+
+log_test "PPPoL2TP Recursion"
+
+exit "$EXIT_STATUS"
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] selftests: net: add tests for PPPoL2TP
  2026-05-14  1:57 [PATCH net-next v2] selftests: net: add tests for PPPoL2TP Qingfang Deng
@ 2026-05-19  8:22 ` patchwork-bot+netdevbpf
  2026-05-21  2:24 ` Matthieu Baerts
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-19  8:22 UTC (permalink / raw)
  To: Qingfang Deng
  Cc: davem, edumazet, kuba, pabeni, horms, shuah, fmaurer, bigeasy,
	petrm, linux-kernel, linux-ppp, netdev, linux-kselftest

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Thu, 14 May 2026 09:57:32 +0800 you wrote:
> Add ping, iperf3, and recursion tests for PPPoL2TP.
> 
> Assisted-by: Gemini:gemini-3-flash
> Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
> ---
> v2:
>  - use named veth pair instead of netkit
>  - reset RET prior to the recursion test
> v1: https://lore.kernel.org/netdev/20260508032158.67887-1-qingfang.deng@linux.dev
> 
> [...]

Here is the summary with links:
  - [net-next,v2] selftests: net: add tests for PPPoL2TP
    https://git.kernel.org/netdev/net-next/c/7af2a94f4dcf

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] selftests: net: add tests for PPPoL2TP
  2026-05-14  1:57 [PATCH net-next v2] selftests: net: add tests for PPPoL2TP Qingfang Deng
  2026-05-19  8:22 ` patchwork-bot+netdevbpf
@ 2026-05-21  2:24 ` Matthieu Baerts
  2026-05-21  7:18   ` Qingfang Deng
  1 sibling, 1 reply; 6+ messages in thread
From: Matthieu Baerts @ 2026-05-21  2:24 UTC (permalink / raw)
  To: Qingfang Deng
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Felix Maurer, Sebastian Andrzej Siewior,
	Petr Machata, linux-kernel, linux-ppp, netdev, linux-kselftest

Hi Qingfang,

On 14/05/2026 11:57, Qingfang Deng wrote:
> Add ping, iperf3, and recursion tests for PPPoL2TP.

Thank you for the new test!

I recently modified NIPA to be able to execute this test by adding
xl2tpd 1.3.20, but it looks like this test is flaky:

  https://netdev.bots.linux.dev/contest.html?skip=0&test=pppol2tp-sh

The results are now ignored.

Do you mind fixing that, please?

Cheers,
Matt
-- 
NIPA assistant.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] selftests: net: add tests for PPPoL2TP
  2026-05-21  2:24 ` Matthieu Baerts
@ 2026-05-21  7:18   ` Qingfang Deng
  2026-05-22  1:43     ` Matthieu Baerts
  0 siblings, 1 reply; 6+ messages in thread
From: Qingfang Deng @ 2026-05-21  7:18 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Felix Maurer, Sebastian Andrzej Siewior,
	Petr Machata, linux-kernel, linux-ppp, netdev, linux-kselftest

Hi,

On 2026/5/21 10:24, Matthieu Baerts wrote:
> Hi Qingfang,
>
> On 14/05/2026 11:57, Qingfang Deng wrote:
>> Add ping, iperf3, and recursion tests for PPPoL2TP.
> Thank you for the new test!
>
> I recently modified NIPA to be able to execute this test by adding
> xl2tpd 1.3.20, but it looks like this test is flaky:
>
>    https://netdev.bots.linux.dev/contest.html?skip=0&test=pppol2tp-sh
>
> The results are now ignored.
>
> Do you mind fixing that, please?


Looks like pppd exited unexpectedly, but I could not locally reproduce 
this issue.

You can start a socat instance to listen on syslog (as done in pppoe.sh 
test) to see what's going on.

Regards,

Qingfang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] selftests: net: add tests for PPPoL2TP
  2026-05-21  7:18   ` Qingfang Deng
@ 2026-05-22  1:43     ` Matthieu Baerts
  2026-05-22  2:15       ` Qingfang Deng
  0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Baerts @ 2026-05-22  1:43 UTC (permalink / raw)
  To: Qingfang Deng
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Felix Maurer, Sebastian Andrzej Siewior,
	Petr Machata, linux-kernel, linux-ppp, netdev, linux-kselftest

Hi Qingfang,

On 21/05/2026 17:18, Qingfang Deng wrote:
> Hi,
> 
> On 2026/5/21 10:24, Matthieu Baerts wrote:
>> Hi Qingfang,
>>
>> On 14/05/2026 11:57, Qingfang Deng wrote:
>>> Add ping, iperf3, and recursion tests for PPPoL2TP.
>> Thank you for the new test!
>>
>> I recently modified NIPA to be able to execute this test by adding
>> xl2tpd 1.3.20, but it looks like this test is flaky:
>>
>>    https://netdev.bots.linux.dev/contest.html?skip=0&test=pppol2tp-sh
>>
>> The results are now ignored.
>>
>> Do you mind fixing that, please?
> 
> 
> Looks like pppd exited unexpectedly, but I could not locally reproduce
> this issue.
> 
> You can start a socat instance to listen on syslog (as done in pppoe.sh
> test) to see what's going on.

If it is already done in another test, and if this is not creating more
troubles, it might be more interesting if this debug mode is always
enabled. I would then recommend sending a patch doing that, than
applying temp modifications only in NIPA, with a risk of causing other
troubles. WDYT?

Cheers,
Matt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] selftests: net: add tests for PPPoL2TP
  2026-05-22  1:43     ` Matthieu Baerts
@ 2026-05-22  2:15       ` Qingfang Deng
  0 siblings, 0 replies; 6+ messages in thread
From: Qingfang Deng @ 2026-05-22  2:15 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, Felix Maurer, Sebastian Andrzej Siewior,
	Petr Machata, linux-kernel, linux-ppp, netdev, linux-kselftest

On 2026/5/22 9:43, Matthieu Baerts wrote:
> Hi Qingfang,
>
> On 21/05/2026 17:18, Qingfang Deng wrote:
>> Looks like pppd exited unexpectedly, but I could not locally reproduce
>> this issue.
>>
>> You can start a socat instance to listen on syslog (as done in pppoe.sh
>> test) to see what's going on.
> If it is already done in another test, and if this is not creating more
> troubles, it might be more interesting if this debug mode is always
> enabled. I would then recommend sending a patch doing that, than
> applying temp modifications only in NIPA, with a risk of causing other
> troubles. WDYT?
Sure thing.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-22  2:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14  1:57 [PATCH net-next v2] selftests: net: add tests for PPPoL2TP Qingfang Deng
2026-05-19  8:22 ` patchwork-bot+netdevbpf
2026-05-21  2:24 ` Matthieu Baerts
2026-05-21  7:18   ` Qingfang Deng
2026-05-22  1:43     ` Matthieu Baerts
2026-05-22  2:15       ` Qingfang Deng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox