Page MenuHomeFreeBSD

tests/net*: destroy interface from inside a jail
ClosedPublic

Authored by glebius on Jan 19 2022, 4:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 6:51 AM
Unknown Object (File)
Sun, Apr 14, 10:59 AM
Unknown Object (File)
Wed, Apr 10, 5:52 PM
Unknown Object (File)
Mon, Mar 25, 3:33 PM
Unknown Object (File)
Mar 19 2024, 4:23 PM
Unknown Object (File)
Mar 19 2024, 2:22 PM
Unknown Object (File)
Mar 19 2024, 3:30 AM
Unknown Object (File)
Mar 18 2024, 7:12 PM

Details

Reviewers
bz
zec
kp
Group Reviewers
network
Summary

There is no guarentee that upon return of 'jail -r' all jail resources
will be released. The test suite used to rely on that. Recent changes
to the PCB zones made jails delay releasing their resources, which ended
with interface leak in the test suite.

Fix that by executing 'ifconfig foo0 destroy' inside the jail, instead
of doing 'jail -r' and expecting interfaces to pop up back immediately
in the parent jail.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43986
Build 40874: arc lint + arc unit

Event Timeline

kp added a subscriber: kp.

Note that there's at least one test case that does ifconfig ${epair}b vnet jail name (pf/set_skip:set_skip_dynamic).

We'll get away with that because it's an epair and deleting one end is sufficient to destroy them both.

This revision is now accepted and ready to land.Jan 19 2022, 3:07 PM
In D33943#767615, @kp wrote:

Note that there's at least one test case that does ifconfig ${epair}b vnet jail name (pf/set_skip:set_skip_dynamic).

We'll get away with that because it's an epair and deleting one end is sufficient to destroy them both.

Thanks for noticing! Will address that.

Thanks for noticing! Will address that.

That's quite deliberate in that test, because it wants to set rules in the jail prior to creating the interface. Presumably we'd address that by adding it to the created_jails.lst file.

Address special case for pf:set_skip, that needs to first create
a jail, then move interface there.

This revision now requires review to proceed.Jan 19 2022, 4:39 PM
This revision is now accepted and ready to land.Jan 20 2022, 8:33 AM