FreeBSD The Power to Serve

Pytest support for the FreeBSD testing framework

Contact: Alexander Chernikov <melifaro@FreeBSD.org>

Native pytest support for atf(7) enhances the capabilities of the FreeBSD test suite.

Pytest simplifies test writing by reducing the amount of boiler-plate code. It offers several advantages over the existing atf-c and atf-shell bindings. One of the most important ones is the test parametrization, which allows improving coverage with writing nearly no code. The other is a rich assert system, offering detailed errors description. Python atf(7) support comes with a number of libraries that abstract a number of commonly-used tasks. For example, running a test within a VNET jail with epair(4) requires adding a single line of code. Such helpers are especially handy in the networking area, where tests with complex VNET setups are not uncommon.

Current status

Python support has been committed to HEAD. Currently, ~80 tests use the Python framework and the number is rising. Example tests have been committed to show the handling of the typical cases.

Next steps

  • Work on increasing the adoption of the framework

  • Rewrite some of the older Python/shell tests in the netinet[6] to pytest (help is appreciated)


Last modified on: January 23, 2023 by Lorenzo Salvadore