]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf tests: properly destroy renamed interfaces
authorKajetan Staszkiewicz <vegeta@tuxpowered.net>
Mon, 16 Jan 2023 06:19:41 +0000 (07:19 +0100)
committerKristof Provost <kp@FreeBSD.org>
Mon, 16 Jan 2023 06:23:07 +0000 (07:23 +0100)
commitddcdb534b7669f186184baf164e7647d544f7bd6
tree074257ccdc0bb2708a4e567c5896b90ae9c1c871
parent0f80d5ebc898f487067a3f2232f9ab0a7b291277
pf tests: properly destroy renamed interfaces

The pfsync:pbr tests leaves  lot of interfaces when they finish, making
other tests slower due to long time of loading scapy from pft_ping.py
when more interfaces are present. When both sides of epair are assigned
to jails, they are both removed from created_interfaces.lst and thus
won't be removed during cleanup from this file. An interface assigned to
jail is stored in created_jails.lst but if it is renamed, it won't be
cleaned up either. Furthermore this test uses identical names for
multiple interfaces across multiple jails which after destroying those
jails adds to overall confusion.

To address this issue a new function is provided for renaming interfaces
in jails and storing their new names in created_jails.lst for deletion
during cleanup.

MFC after: 1 week
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D38024
tests/sys/common/vnet.subr
tests/sys/netpfil/pf/pfsync.sh