Skip to contentSkip to conversation

selftests: net: add tests for PPP

PATCH In review Qingfang Deng 4 participants 12 messages Mar 30 – Apr 2

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 selftests: net: add tests for PPP

Add ping and iperf3 tests for ppp_async.c and pppoe.c.

---
v7: repost after 24h
https://lore.kernel.org/netdev/[email protected]/

 MAINTAINERS                                   |  1 +
 tools/testing/selftests/Makefile              |  1 +
 tools/testing/selftests/net/ppp/Makefile      | 15 +++++++
 tools/testing/selftests/net/ppp/config        |  9 ++++
 tools/testing/selftests/net/ppp/ppp_async.sh  | 44 +++++++++++++++++++
 tools/testing/selftests/net/ppp/ppp_common.sh | 44 +++++++++++++++++++
 .../selftests/net/ppp/pppoe-server-options    |  2 +
 tools/testing/selftests/net/ppp/pppoe.sh      | 41 +++++++++++++++++
 8 files changed, 157 insertions(+)
 create mode 100644 tools/testing/selftests/net/ppp/Makefile
 create mode 100644 tools/testing/selftests/net/ppp/config
 create mode 100755 tools/testing/selftests/net/ppp/ppp_async.sh
 create mode 100644 tools/testing/selftests/net/ppp/ppp_common.sh
 create mode 100644 tools/testing/selftests/net/ppp/pppoe-server-options
 create mode 100755 tools/testing/selftests/net/ppp/pppoe.sh
MAINTAINERS +1 -0
index 7a2ffd9d37d5..b922e154b9e7 100644
@@ -21080,6 +21080,7 @@ PPP PROTOCOL DRIVERS AND COMPRESSORS
 L:	[email protected]
 S:	Orphan
 F:	drivers/net/ppp/ppp_*
+F:	tools/testing/selftests/net/ppp/
 
 PPS SUPPORT
 M:	Rodolfo Giometti <[email protected]>
tools/testing/selftests/Makefile +1 -0
index 450f13ba4cca..65f84e8a0cf0 100644
@@ -78,6 +78,7 @@ TARGETS += net/netfilter
 TARGETS += net/openvswitch
 TARGETS += net/ovpn
 TARGETS += net/packetdrill
+TARGETS += net/ppp
 TARGETS += net/rds
 TARGETS += net/tcp_ao
 TARGETS += nolibc
tools/testing/selftests/net/ppp/Makefile new file +15 -0
new file mode 100644
index 000000000000..b39b0abadde6
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0
+
+top_srcdir = ../../../../..
+
+TEST_PROGS := \
+	ppp_async.sh \
+	pppoe.sh \
+# end of TEST_PROGS
+
+TEST_FILES := \
+	ppp_common.sh \
+	pppoe-server-options \
+# end of TEST_FILES
+
+include ../../lib.mk
tools/testing/selftests/net/ppp/config new file +9 -0
new file mode 100644
index 000000000000..b45d25c5b970
@@ -0,0 +1,9 @@
+CONFIG_IPV6=y
+CONFIG_PACKET=y
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOE_HASH_BITS_4=y
+CONFIG_VETH=y
tools/testing/selftests/net/ppp/ppp_async.sh new file +44 -0

44 lines not on this page · raw message

tools/testing/selftests/net/ppp/ppp_common.sh new file +44 -0

44 lines not on this page · raw message

tools/testing/selftests/net/ppp/pppoe-server-options new file +2 -0
new file mode 100644
index 000000000000..66c8c9d319e9
@@ -0,0 +1,2 @@
+noauth
+noipdefault
tools/testing/selftests/net/ppp/pppoe.sh new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 1 line · On Mon, 30 Mar 2026 11:55:44 +0800 Qingfang Deng wrote:

Add ping and iperf3 tests for ppp_async.c and pppoe.c.

Hi! I added the new TARGET to netdev CI, the pppoe.sh test does not seem happy:

# timeout set to 45
# selftests: net/ppp: pppoe.sh
# Plugin pppoe.so loaded.
# PPPoE plugin from pppd 2.5.1
# Send PPPOE Discovery V1T1 PADI session 0x0 length 12
#  dst ff:ff:ff:ff:ff:ff  src b2:36:d8:0d:61:83
#  [service-name] [host-uniq 9b 08 00 00]
# Recv PPPOE Discovery V1T1 PADO session 0x0 length 73
#  dst b2:36:d8:0d:61:83  src 4e:f5:66:23:13:38
#  [AC-name vmksft-net-extra,debug-threads=on] [service-name] [AC-cookie e5 e4 8c f0 87 72 d8 3a 60 66 4e 32 e4 ee af 6f 9a 08 00 00] [host-uniq 9b 08 00 00]
# Send PPPOE Discovery V1T1 PADR session 0x0 length 36
#  dst 4e:f5:66:23:13:38  src b2:36:d8:0d:61:83
#  [service-name] [host-uniq 9b 08 00 00] [AC-cookie e5 e4 8c f0 87 72 d8 3a 60 66 4e 32 e4 ee af 6f 9a 08 00 00]
# Recv PPPOE Discovery V1T1 PADS session 0x1 length 12
#  dst b2:36:d8:0d:61:83  src 4e:f5:66:23:13:38
#  [service-name] [host-uniq 9b 08 00 00]
# PPP session is 1
# Connected to 4E:F5:66:23:13:38 via interface veth-client
# using channel 1
# Using interface ppp0
# Connect: ppp0 <--> veth-client
# sent [LCP ConfReq id=0x1 <mru 1492> <magic 0x6db8fab4>]
# Modem hangup
# Connection terminated.
# Send PPPOE Discovery V1T1 PADT session 0x1 length 32
#  dst 4e:f5:66:23:13:38  src b2:36:d8:0d:61:83
#  [host-uniq 9b 08 00 00] [AC-cookie e5 e4 8c f0 87 72 d8 3a 60 66 4e 32 e4 ee af 6f 9a 08 00 00]
# Sent PADT
# ping: connect: Network is unreachable
# iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Network is unreachable
# TEST: PPPoE                                                         [FAIL]
not ok 1 selftests: net/ppp: pppoe.sh # exit=1
#2 lore raw

Hi,

Quoted 31 lines · Jakub Kicinski
Quoted 1 line · On Mon, 30 Mar 2026 11:55:44 +0800 Qingfang Deng wrote:

Add ping and iperf3 tests for ppp_async.c and pppoe.c.

Hi! I added the new TARGET to netdev CI, the pppoe.sh test does not seem happy:

# timeout set to 45
# selftests: net/ppp: pppoe.sh
# Plugin pppoe.so loaded.
# PPPoE plugin from pppd 2.5.1
# Send PPPOE Discovery V1T1 PADI session 0x0 length 12
#  dst ff:ff:ff:ff:ff:ff  src b2:36:d8:0d:61:83
#  [service-name] [host-uniq 9b 08 00 00]
# Recv PPPOE Discovery V1T1 PADO session 0x0 length 73
#  dst b2:36:d8:0d:61:83  src 4e:f5:66:23:13:38
#  [AC-name vmksft-net-extra,debug-threads=on] [service-name] [AC-cookie e5 e4 8c f0 87 72 d8 3a 60 66 4e 32 e4 ee af 6f 9a 08 00 00] [host-uniq 9b 08 00 00]
# Send PPPOE Discovery V1T1 PADR session 0x0 length 36
#  dst 4e:f5:66:23:13:38  src b2:36:d8:0d:61:83
#  [service-name] [host-uniq 9b 08 00 00] [AC-cookie e5 e4 8c f0 87 72 d8 3a 60 66 4e 32 e4 ee af 6f 9a 08 00 00]
# Recv PPPOE Discovery V1T1 PADS session 0x1 length 12
#  dst b2:36:d8:0d:61:83  src 4e:f5:66:23:13:38
#  [service-name] [host-uniq 9b 08 00 00]
# PPP session is 1
# Connected to 4E:F5:66:23:13:38 via interface veth-client
# using channel 1
# Using interface ppp0
# Connect: ppp0 <--> veth-client
# sent [LCP ConfReq id=0x1 <mru 1492> <magic 0x6db8fab4>]
# Modem hangup
# Connection terminated.
Quoted 8 lines
# Send PPPOE Discovery V1T1 PADT session 0x1 length 32
#  dst 4e:f5:66:23:13:38  src b2:36:d8:0d:61:83
#  [host-uniq 9b 08 00 00] [AC-cookie e5 e4 8c f0 87 72 d8 3a 60 66 4e 32 e4 ee af 6f 9a 08 00 00]
# Sent PADT
# ping: connect: Network is unreachable
# iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Network is unreachable
# TEST: PPPoE                                                         [FAIL]
not ok 1 selftests: net/ppp: pppoe.sh # exit=1

It looks like pppoe-server fails to start. You may check the syslog to see what's going on.

Regards,
Qingfang

maintainer
#3 lore raw
Quoted 6 lines · On Wed, 1 Apr 2026 23:45:38 +0800 Qingfang Deng wrote:
Quoted 3 lines

# iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Network is unreachable
# TEST: PPPoE [FAIL]
not ok 1 selftests: net/ppp: pppoe.sh # exit=1

It looks like pppoe-server fails to start. You may check the syslog to see what's going on.

Hm, we don't capture syslog automatically :S We capture stdout and stderr

I'm not even sure there's something listening on syslog in virtme-ng Is it possible to make the daemon log to stdout or a file and dump that file to stdout on failure? Even if we fix the current issue it will be quite inconvenient if we have to go into syslog every time the test is failing. The test output should provide enough info to debug failures.

#4 lore raw

Hi,

Quoted 12 lines · Jakub Kicinski
Quoted 6 lines · On Wed, 1 Apr 2026 23:45:38 +0800 Qingfang Deng wrote:
Quoted 3 lines

# iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Network is unreachable
# TEST: PPPoE [FAIL]
not ok 1 selftests: net/ppp: pppoe.sh # exit=1

It looks like pppoe-server fails to start. You may check the syslog to see what's going on.

Hm, we don't capture syslog automatically :S We capture stdout and stderr

Quoted 6 lines

I'm not even sure there's something listening on syslog in virtme-ng Is it possible to make the daemon log to stdout or a file and dump that file to stdout on failure? Even if we fix the current issue it will be quite inconvenient if we have to go into syslog every time the test is failing. The test output should provide enough info to debug failures.

Add Cc: Dianne

I checked the man page of pppoe-server and did not find such option. We can instead start our own listener and redirect the syslog to a file or stdout:

socat -u UNIX-RECV:/dev/log,ignoreeof STDOUT &

Regards,
Qingfang

maintainer
#5 lore raw
Quoted 20 lines · On Thu, 2 Apr 2026 10:26:11 +0800 Qingfang Deng wrote:

Hi,

Quoted 2 lines · Jakub Kicinski

On Wed, 1 Apr 2026 23:45:38 +0800 Qingfang Deng wrote:

[...]

Quoted 7 lines
Quoted 3 lines

It looks like pppoe-server fails to start. You may check the syslog to see what's going on.

Hm, we don't capture syslog automatically :S We capture stdout and stderr

Quoted 6 lines

I'm not even sure there's something listening on syslog in virtme-ng Is it possible to make the daemon log to stdout or a file and dump that file to stdout on failure? Even if we fix the current issue it will be quite inconvenient if we have to go into syslog every time the test is failing. The test output should provide enough info to debug failures.

Quoted 7 lines

Add Cc: Dianne

I checked the man page of pppoe-server and did not find such option. We can instead start our own listener and redirect the syslog to a file or stdout:

socat -u UNIX-RECV:/dev/log,ignoreeof STDOUT &

That should work for vng, I confirmed it doesn't seem to have a syslog socket

$ vng -r
...
$ ls /dev/log
ls: cannot access '/dev/log': No such file or directory
maintainer
#6 lore raw
In reply to Qingfang Deng
Quoted 19 lines · Qingfang Deng
Quoted 11 lines · Jakub Kicinski
Quoted 6 lines · On Wed, 1 Apr 2026 23:45:38 +0800 Qingfang Deng wrote:
Quoted 3 lines

# iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Network is unreachable
# TEST: PPPoE [FAIL]
not ok 1 selftests: net/ppp: pppoe.sh # exit=1

It looks like pppoe-server fails to start. You may check the syslog to see what's going on.

Hm, we don't capture syslog automatically :S We capture stdout and stderr

Quoted 6 lines

I'm not even sure there's something listening on syslog in virtme-ng Is it possible to make the daemon log to stdout or a file and dump that file to stdout on failure? Even if we fix the current issue it will be quite inconvenient if we have to go into syslog every time the test is failing. The test output should provide enough info to debug failures.

Quoted 7 lines

Add Cc: Dianne

I checked the man page of pppoe-server and did not find such option. We can instead start our own listener and redirect the syslog to a file or stdout:

socat -u UNIX-RECV:/dev/log,ignoreeof STDOUT &

Note that similar failures in the past in other test-cases were usually due to timing issues. i.e. the pppoe-server starts in background too late for the client.

Possibly a somewhat clean solution is to wait in a loop for the 'pppoe-server ready' event, somewhat similar to wait_local_port_listen().

Otherwise an hackish sleep in between should do.

Note that you should be possibly able to reproduce this kind of failure in a virtualized/slow enough environment (i.e. using vng as described on nipa wiki)

Finally, note that in this test script you should start the socat listener only if /dev/log does not exists, or ignore socat startup errors - because self-test should run also on different systems.

/P

#7 lore raw

Hi Paolo and Jakub,

Quoted 3 lines · Paolo Abeni

Note that similar failures in the past in other test-cases were usually due to timing issues. i.e. the pppoe-server starts in background too late for the client.

I don't think it is a timing issue, otherwise the PADI negotiation won't succeed. The "updetach" option on the client side also make it wait for the negotiation.
It's likely that the pppd instance spawned by pppoe-server fails to find the "rp-pppoe.so" plugin, so the connection fails when handing off the session from pppoe-server to pppd. Note the naming difference:
the client loads "pppoe.so", while the server loads "rp-pppoe.so" by default.

What distro do you run CI tests on? On Ubuntu 24.04, "rp-pppoe.so" is a symlink to "pppoe.so" in apt package "ppp". Maybe an additional package is required for the distro you use, or I may work around that by manually creating the symlink.

maintainer
#8 lore raw
Quoted 14 lines · Qingfang Deng
Quoted 3 lines · Paolo Abeni

Note that similar failures in the past in other test-cases were usually due to timing issues. i.e. the pppoe-server starts in background too late for the client.

I don't think it is a timing issue, otherwise the PADI negotiation won't succeed. The "updetach" option on the client side also make it wait for the negotiation.
It's likely that the pppd instance spawned by pppoe-server fails to find the "rp-pppoe.so" plugin, so the connection fails when handing off the session from pppoe-server to pppd. Note the naming difference:
the client loads "pppoe.so", while the server loads "rp-pppoe.so" by default.

Quoted 4 lines

What distro do you run CI tests on? On Ubuntu 24.04, "rp-pppoe.so" is a symlink to "pppoe.so" in apt package "ppp". Maybe an additional package is required for the distro you use, or I may work around that by manually creating the symlink.

It's fedora 43 with ppp and pppoe installed.

ppp provides pppoe.so, and AFAICS nothink provides rp-pppoe.so, and the pppoe-server is looking for a non existing /etc/ppp/plugins/rp-pppoe.so plugin.

Before I mess with the nipa testbed, could you please double check that

ln -n /usr/lib64/pppd/2.5.1/pppoe.so /etc/ppp/plugins/rp-pppoe.so

should solve?

Thanks,

Paolo

#9 lore raw
Quoted 14 lines · Paolo Abeni
Quoted 4 lines · Qingfang Deng

What distro do you run CI tests on? On Ubuntu 24.04, "rp-pppoe.so" is a symlink to "pppoe.so" in apt package "ppp". Maybe an additional package is required for the distro you use, or I may work around that by manually creating the symlink.

It's fedora 43 with ppp and pppoe installed.

ppp provides pppoe.so, and AFAICS nothink provides rp-pppoe.so, and the pppoe-server is looking for a non existing /etc/ppp/plugins/rp-pppoe.so plugin.

Quoted 5 lines

Before I mess with the nipa testbed, could you please double check that

ln -n /usr/lib64/pppd/2.5.1/pppoe.so /etc/ppp/plugins/rp-pppoe.so

should solve?

Hard links will also work.
Alternatively, if your rp-pppoe version is 4.0, you can use the new option -g to specify the full path of the pppoe.so plugin.

Regards,
Qingfang

#10 lore raw
Quoted 17 lines · Qingfang Deng
Quoted 16 lines · Paolo Abeni
Quoted 4 lines · Qingfang Deng

What distro do you run CI tests on? On Ubuntu 24.04, "rp-pppoe.so" is a symlink to "pppoe.so" in apt package "ppp". Maybe an additional package is required for the distro you use, or I may work around that by manually creating the symlink.

It's fedora 43 with ppp and pppoe installed.

ppp provides pppoe.so, and AFAICS nothink provides rp-pppoe.so, and the pppoe-server is looking for a non existing /etc/ppp/plugins/rp-pppoe.so plugin.

Before I mess with the nipa testbed, could you please double check that

Quoted 7 lines
Quoted 3 lines

ln -n /usr/lib64/pppd/2.5.1/pppoe.so /etc/ppp/plugins/rp-pppoe.so

should solve?

Hard links will also work.
Alternatively, if your rp-pppoe version is 4.0, you can use the new option -g to specify the full path of the pppoe.so plugin.

It should be possible for anybody to run these self tests. So we don't want specially crafted setups, but generic setups which will work for as many people as possible.

It looks like v4.0 we released 2024-09-09. So can we make that the minimum version? Fail the test if an older version is found? Can the test poke around the file system and find rp-pppoe.so and pass it using -g?

Andrew

maintainer
#11 lore raw
Quoted 11 lines · On Thu, 2 Apr 2026 16:37:01 +0200 Andrew Lunn wrote:
Quoted 7 lines
Quoted 3 lines

ln -n /usr/lib64/pppd/2.5.1/pppoe.so /etc/ppp/plugins/rp-pppoe.so

should solve?

Hard links will also work.
Alternatively, if your rp-pppoe version is 4.0, you can use the new option -g to specify the full path of the pppoe.so plugin.

It should be possible for anybody to run these self tests. So we don't want specially crafted setups, but generic setups which will work for as many people as possible.

+1 let's try not to tweak the underlying OS.