[Bug 300511] sys.netpfil.pf.return.py:TestReturn::test_tcp failed because ping returned non-zero exit code

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 04 Nov 2026 21:26:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300511

            Bug ID: 300511
           Summary: sys.netpfil.pf.return.py:TestReturn::test_tcp failed
                    because ping returned non-zero exit code
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: tests
          Assignee: testing@FreeBSD.org
          Reporter: ngie@FreeBSD.org

From
https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29873/testReport/junit/sys.netpfil.pf.return/py/TestReturn__test_tcp/
:

```
============================= test session starts
==============================
platform freebsd16 -- Python 3.12.15, pytest-9.1.1, pluggy-1.6.0 --
/usr/local/bin/python3.12
rootdir: /usr/tests/sys/netpfil/pf
collecting ... collected 1 item

../../../../usr/tests/sys/netpfil/pf/return.py::TestReturn::test_tcp Creating
if2
run: '/sbin/ifconfig epair create'
run: '/sbin/ifconfig epair0a -txcsum -txcsum6'
Creating if1
run: '/sbin/ifconfig epair create'
run: '/sbin/ifconfig epair1a -txcsum -txcsum6'
run: '/usr/sbin/jail -i -c name=pytest:TestReturn:test_tcp persist vnet
vnet.interface=epair1a '
run: '/usr/sbin/jexec pytest:TestReturn:test_tcp /sbin/ifconfig -l'
run: '/usr/sbin/jail -i -c name=pytest:TestReturn:test_tcp_2 persist vnet
vnet.interface=epair1b vnet.interface=epair0a '
run: '/usr/sbin/jexec pytest:TestReturn:test_tcp_2 /sbin/ifconfig -l'
run: '/usr/sbin/jail -i -c name=pytest:TestReturn:test_tcp_3 persist vnet
vnet.interface=epair0b '
run: '/usr/sbin/jexec pytest:TestReturn:test_tcp_3 /sbin/ifconfig -l'
============= TEST TOPOLOGY =============
# vnet vnet1 -> pytest:TestReturn:test_tcp
# vnet vnet2 -> pytest:TestReturn:test_tcp_2 handler: vnet2_handler
# vnet vnet3 -> pytest:TestReturn:test_tcp_3 handler: vnet3_handler
# iface if2: vnet2::epair0a -> vnet3::epair0b
# iface if1: vnet1::epair1a -> vnet2::epair1b

# setup_vnet(pytest:TestReturn:test_tcp_3)
run: '/sbin/sysctl net.inet6.ip6.dad_count=0'
Dropping privs to root/0
======= /sbin/route add default 198.51.100.1 =====
PING 192.0.2.1 (192.0.2.1): 56 data bytes
64 bytes from 192.0.2.1: icmp_seq=0 ttl=64 time=0.098 ms

--- 192.0.2.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.098/0.098/0.098/0.000 ms
PING 198.51.100.1 (198.51.100.1): 56 data bytes
add net default: gateway 198.51.100.1


# setup_vnet(pytest:TestReturn:test_tcp_2)
run: '/sbin/sysctl net.inet6.ip6.dad_count=0'
Dropping privs to root/0
======= /sbin/pfctl -e =====


Set rules:
nat on epair1b inet from 192.0.2.0/24 to any -> (epair1b)
block return
pass inet proto icmp icmp-type echoreq

======= /sbin/pfctl -sr =====
block return all
pass inet proto icmp all icmp-type echoreq keep state


======= /sbin/sysctl net.inet.ip.forwarding=1 =====
net.inet.ip.forwarding: 0 -> 1


======= /sbin/pfctl -x loud =====



--- 198.51.100.1 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
# setup_vnet(pytest:TestReturn:test_tcp)
run: '/sbin/sysctl net.inet6.ip6.dad_count=0'
Dropping privs to root/0
======= /sbin/route add default 192.0.2.1 =====
add net default: gateway 192.0.2.1


FAILED

=================================== FAILURES
===================================
_____________________________ TestReturn.test_tcp
______________________________

self = <return.TestReturn object at 0x1dd825d7a180>

    @pytest.mark.require_user("root")
    @pytest.mark.require_progs(["scapy"])
    def test_tcp(self):
>       self.common_setup()

/usr/tests/sys/netpfil/pf/return.py:78: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/tests/sys/netpfil/pf/return.py:72: in common_setup
    check("/sbin/ping -c 1 198.51.100.1")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cmd = '/sbin/ping -c 1 198.51.100.1'

    def check(cmd):
        ps = subprocess.Popen(cmd, shell=True)
        ret = ps.wait()
        if ret != 0:
>           raise Exception("Command %s returned %d" % (cmd, ret))
E           Exception: Command /sbin/ping -c 1 198.51.100.1 returned 2

/usr/tests/sys/netpfil/pf/return.py:38: Exception
=========================== short test summary info
============================
FAILED ../../../../usr/tests/sys/netpfil/pf/return.py::TestReturn::test_tcp -
Exception: Command /sbin/ping -c 1 198.51.100.1 returned 2
============================== 1 failed in 11.59s
==============================
```

-- 
You are receiving this mail because:
You are the assignee for the bug.