HomeFreeBSD

testing: handling non-root users with VNETs in pytest-based tests.

Description

testing: handling non-root users with VNETs in pytest-based tests.

Currently isolation and resource requirements are handled directly
by the kyua runner, based on the requirements specified by the test.
It works well for simple tests, but may cause discrepancy with tests
doing complex pre-setups. For example, all tests that perform
VNET setups require root access to properly function.

This change adds additional handling of the "require_user" property
within the python testing framework. Specifically, it requests
root access if the test class signals its root requirements and
drops privileges to the desired user after performing the pre-setup.

Differential Revision: https://reviews.freebsd.org/D37923
MFC after: 2 weeks

(cherry picked from commit 6332ef8941999b0c074d1ece0e1e108447c70b98)

Details

Provenance
melifaroAuthored on Feb 9 2023, 2:31 PM
Differential Revision
D37923: testing: handling non-root users with VNETs in pytests.
Parents
rGf9f0d2f475e0: netlink: fix style(9) after c3d3f3594fdf.
Branches
Unknown
Tags
Unknown