summaryrefslogtreecommitdiff
path: root/tests/atf_python/utils.py
AgeCommit message (Collapse)Author
2025-06-06pf tests: skip TestHeader6::test_too_many if ipfilter is loadedKristof Provost
IPFilter interferes with the header.py:TestHeader6::test_too_many test, so skip it if the module is loaded. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50661
2023-05-15testing: add public method for requiring module presense in pytestAlexander V. Chernikov
MFC after: 2 weeks
2023-04-14Testing: add framework for the kernel unit tests.Alexander V. Chernikov
This changes intends to reduce the bar to the kernel unit-testing by introducing a new kernel-testing framework ("ktest") based on Netlink, loadable test modules and python test suite integration. This framework provides the following features: * Integration to the FreeBSD test suite * Automatic test discovery * Automatic test module loading * Minimal boiler-plate code in both kernel and userland * Passing any metadata to the test * Convenient environment pre-setup using python testing framework * Streaming messages from the kernel to the userland * Running tests in the dedicated taskqueues * Skipping or parametrizing tests Differential Revision: https://reviews.freebsd.org/D39385 MFC after: 2 weeks
2023-04-01tests: refactor atf_python a bitAlexander V. Chernikov
* Move more logic from conftest.py to the actual atf_pytest handler * Move nodeid_to_method_name() to the utils.py so it can be shared MFC after: 2 weeks
2023-02-09testing: handling non-root users with VNETs in pytest-based tests.Alexander V. Chernikov
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
2023-01-01testing: fix tests without cleanup in pytest.Alexander V. Chernikov
It was broken by 89ffac3b01fb3f6749799ac67b7d94056a36778e, which added "cleanup" method to the base test class, resulting in reporting cleanup for all of the tests.
2022-12-29testing: improve python vnet wrapper.Alexander V. Chernikov
* Derive jail name from class name and method name, instead of just method name. This change reduces the chances of different tests clashing. Old: 'jail_test_one'. New: 'pytest:TestExampleSimplest:test_one' * Simplify vnetX_handler() method signature by skipping obj_map (unused) and pipe. The latter can be accessed as the vnet property. * Add `send_object()` method as a pair to the `wait_object` inside the VnetTestTemplate class. * Add `test_id` property to the BaseTest method. Previously it was provided only for the VnetTestTemplate class. This change makes the identifier easily accessible for all users. MFC after: 2 weeks
2022-12-16netlink: connect netlink tests to the buildAlexander V. Chernikov
Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D37708