aboutsummaryrefslogtreecommitdiff
path: root/tests/atf_python
Commit message (Collapse)AuthorAgeFilesLines
* rtnetlink: Add native SR-IOV VF statusKevin Bowling13 days2-0/+150
| | | | | | | | | | | | | | | | | | | | | | Add a transport neutral kernel snapshot for NIC-specific SR-IOV VF status and an optional iflib provider method. Providers gather state under driver defined synchronization. Honor RTEXT_FILTER_VF on RTM_GETLINK requests and encode the status as native typed route Netlink attributes. Represent VFs, driver namespaces, and namespace fields as directly repeated nested attributes. Presence masks in consumers can distinguish omission from false or zero. Drivers may add custom status under stable, versioned namespaces. The named, typed representation lets generic transports and consumers carry or display fields without knowing their driver-specific schemas, while the driver retains ownership of their names and meanings. Document the ABI and add parser and RTM_GETLINK coverage. Reviewed by: melifaro, iflib (gallatin), kgalazka (previous version) Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58776
* net: Revert the ioctl SR-IOV VF status interfaceKevin Bowling2026-08-102-145/+0
| | | | | | | | | | | | | | | | | | | | | | A native route Netlink interface will replace this stack. Requested by: glebius This reverts commit 1ccf543b21eff6e0828142e5c1d09519247143f4. This reverts commit 2c04cfa148ec4dd5cef7e228aaea6a05957fcb15. This reverts commit 2d6114f6d26bf7dfa5ad94e1db9b09ee7108dc7a. This reverts commit d15f2551b25f79ddcbe289faa95e655100b952da. This reverts commit ceb282bbd62eed5e84df9abaede0dd183f66997a. This reverts commit c30021fe0df9e045a17292dbe50dfc054b69871f. This reverts commit fb1820d23a04856a6d3047b4c088cc8df8f76da1. This reverts commit 8696cc600f44767e7988a92c8e6fb943e97d4cc7.
* rtnetlink: Report SR-IOV VF statusKevin Bowling2026-08-092-0/+145
| | | | | | | | | | | | | | | | Honor RTEXT_FILTER_VF on RTM_GETLINK requests and expose the versioned SR-IOV VF status through typed nested FreeBSD attributes. Report IFLA_NUM_VF with a successful requested query and preserve per-provider errors in the status container. Map the common nvlist schema to native integer, boolean, string, and binary attributes. Carry namespaced driver extensions as packed versioned nvlists so adding a driver-specific field does not expand the common netlink ABI. Add SNL parsers, parser verification, a constructed nested-status test, and an RTM_GETLINK test for an interface without SR-IOV support. Document the query contract and every attribute.
* ipfw: treat ipv6 address with zero mask as 'any'Andrey V. Elsukov2026-05-171-0/+2
| | | | | | | | | Make the behaviour similar for both IPv4 and IPv6. Also add the corresponding tests. PR: 294733 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56618
* ipfw: add support for masked ip-address lookupsBoris Lytochkin2026-03-014-28/+230
| | | | | | | | | | | | | | | | | Current radix-based implementation of lookup tables in ipfw does not support non-contiguous prefixes while this type of lookup is needed to write CPU-effective firewall configurations. For some of the cases we can reach the goal using a masked table lookup by adding masked (e.g. zero non-significant bits) records into a table and then zero non-significant bits in lookup key prior to making a table lookup. Obtained from: Yandex LLC MFC after: 3 weeks Relnotes: yes Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D53694
* atf_python/vnet: Make it possible to set the FIB of vnet interfacesMark Johnston2026-02-131-1/+15
| | | | | | | | Reviewed by: zlei, ngie MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54972
* atf_python: Run vnet handlers in $HOMEMark Johnston2026-02-021-0/+1
| | | | | | | | | | | | | | | When kyua runs a test, it creates a temp directory and sets $HOME to point to it. Tests are run with the cwd set to that temp directory. When a process attaches to a jail, its cwd is set to the root of the jail. Modify atf_python to cd to $HOME instead, so that it's easier for tests to share files. Reviewed by: zlei, ngie MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54971
* atf_python: Fix a typo in a type annotationMark Johnston2026-01-271-1/+1
| | | | | | | | No functional change intended. MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc.
* atf_python: support setting interface mtuKristof Provost2025-12-221-0/+6
| | | | | | | | | | | Teach the vnet support code to set interface MTU. Some tests make use of this, so have the framework handle it. Adapt a few pf tests to use this. Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D54333
* tcp: Initial ktest for HPTSNick Banks2025-10-131-2/+10
| | | | | | Reviewed by: rrs, tuexen Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52979
* tests/ipfw: Update regression tests to match new 32-bit size rule numbersOlivier Cochard2025-10-031-8/+11
| | | | | | | | Commit 4a77657cbc01 increased the size of several opcodes to ipfw_insn_u32. Approved by: ae Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D52876
* atf_python: allow test scripts to pass jail optionsKristof Provost2025-09-301-4/+8
| | | | | | | | | | Test scripts based on atf_python can now pass jail command options via the 'opts' key in the 'vnetX' key of TOPOLOGY. Reviewed by: melifaro MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52761
* atf_pytest: fix xfail detection from pytest reportSiva Mahadevan2025-09-181-2/+2
| | | | | | | | | | | The location of the 'wasxfail' attribute was moved from the 'reason' attribute back to the parent 'report'. This fixes an issue where xfails are wrongly reported to ATF as skipped tests. Signed-off-by: Siva Mahadevan <me@svmhdvn.name> Pull-request: https://github.com/freebsd/freebsd-src/pull/1849 Sponsored by: The FreeBSD Foundation
* tests: disable transmit checksum offloading for epair interfacesMichael Tuexen2025-09-041-0/+1
| | | | | | | | | | | When transmit checksum offloading is enabled, if_epair does not compute checksums, it just marks packets that this computation still needs to be done. However, some test cases verify the checksum. Therefore disable this for IPv4 and IPv6. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52379
* tests: Get the MAC from the epairs.Ronald Klop2025-07-091-2/+6
| | | | | | | | This removes knowledge of the implementation of if_epair. Makes it easier to modify if_epair in future commits. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D51205
* pf tests: skip TestHeader6::test_too_many if ipfilter is loadedKristof Provost2025-06-061-0/+10
| | | | | | | | 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
* aft_python: fix incorrect ndp useKristof Provost2025-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | If we want to clear a flag we have to include '--' before the flag we clear, otherwise ndp will misparse our command (the getopt call will interpret it as another option, and reject it). This caused spurious errors at the end of every atf_python test case such as: ============================== 1 passed in 7.26s =============================== usage: ndp [-nt] hostname ndp [-nt] -a | -c | -p | -r | -H | -P | -R ndp [-nt] -A wait ndp [-nt] -d hostname ndp [-nt] -f filename ndp [-nt] -i interface [flags...] ndp [-nt] -I [interface|delete] ndp [-nt] -s nodename etheraddr [temp] [proxy] Sponsored by: Rubicon Communications, LLC ("Netgate")
* vnet tests: verify that we can load if_epair and if_bridgeKristof Provost2024-07-231-0/+6
| | | | | | | | | | | | | | | | | | | | | We're going to start running many of the vnet tests in nested jails (so they can run in parallel). That means the tests won't be able to load kernel modules, which we commonly do for if_epair and if_bridge. Just assume that all vnet tests need this, because so many of them do that we don't want to manually annotate all of them. This is essentially a no-op on non-nested tests. Do the same for the python test framework. While here also have pflog_init actually call pft_init. While having pflog loaded implies we have pf too pft_init also checks for vimage support, and now for if_epair. Reviewed by: markj MFC after: 1 month Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46039
* tests: move atf_python/sys/ into the tests packageLexi Winter2024-04-195-0/+5
| | | | | | Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1174
* atf_python: Standardize custom sectionsJose Luis Duran2023-10-131-1/+1
| | | | | | | | To be replaced with pytest's section/add_report_section. Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/865
* atf_python: Set verbosity for commands in a vnetJose Luis Duran2023-10-131-2/+2
| | | | | | Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/865
* atf_python: vnet: Use absolute paths within helpersJose Luis Duran2023-10-131-10/+6
| | | | | | | | | | | | | Usually tests are run in sterile environments; however, there is a slight chance that the PATH overrides the utilities used for testing. Pedantically use absolute paths, even inside VNETs, to avoid ambiguity. Chiefly, jexec -> /usr/sbin/jexec, and ifconfig -> /sbin/ifconfig. Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/865
* atf_python: Actually implement verbosity for run_cmdJose Luis Duran2023-10-131-1/+2
| | | | | | Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/865
* atf_python: Do not attempt to automatically delete lo0Jose Luis Duran2023-10-131-0/+2
| | | | | | | | | | Else `ifconfig lo0 destroy` will throw an: ifconfig: SIOCIFDESTROY: Invalid argument Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/865
* pkgbase: Put atf_python files in FreeBSD-testsEmmanuel Vadot2023-10-121-0/+2
| | | | Sponsored by: Beckhoff Automation GmbH & Co. KG
* pf: test rules evaluation in the face of multiple IPv6 fragment headersKristof Provost2023-08-041-0/+21
| | | | | | | | | | | | | Send an ICMPv6 echo request packet with multiple IPv6 fragment headers. Set rules to pass all packets, except for ICMPv6 echo requests. pf ought to drop the echo request, but doesn't because it reassembles the packet, and then doesn't handle the second fragment header. In other words: it fails to detect the ICMPv6 echo header. Reported by: Enrico Bassetti bassetti@di.uniroma1.it (NetSecurityLab @ Sapienza University of Rome) MFC after: instant Sponsored by: Rubicon Communications, LLC ("Netgate")
* ipfw: add eaction testsAlexander V. Chernikov2023-06-151-0/+6
| | | | MFC after: 2 weeks
* ipfw(8): add ioctl/instruction generation testsAlexander V. Chernikov2023-06-1311-1/+1551
| | | | | Differential Revision: https://reviews.freebsd.org/D40488 MFC after: 2 weeks
* ktest: make ktest work with Netlink loaded as a module.Alexander V. Chernikov2023-06-131-1/+1
| | | | MFC after: 2 weeks
* netlink: add support for decoding genl ops/groups in pytestAlexander V. Chernikov2023-06-014-10/+73
| | | | MFC after: 2 weeks
* netlink: add support for adding/deleting interface addressesAlexander V. Chernikov2023-05-161-65/+158
| | | | | Differential Revision: https://reviews.freebsd.org/D40103 MFC after: 2 weeks
* testing: improve vnet support in pytestAlexander V. Chernikov2023-05-161-10/+36
| | | | | | | | | | | | | * Allow vnet object to be directly referenced (self.vnet1 vs self.vnet_map["vnet1"]) * Allow iface object to be directly reference (vnet.bridge vs vnet.iface_alias_map["bridge"]) * Allow arbitrary interface alias names insted of ifX * Add wait_objects_any() method for waiting object from multiple vnets * Add wait() method for indefinite sleep on vnet handlers MFC after: 2 weeks
* testing: rename IfattrType to IfaAttrType for consistencyAlexander V. Chernikov2023-05-151-7/+7
| | | | | | | All other attribute classes are named as 'type'AttrType and 'type' int this case is ifa (interface address). MFC after: 2 weeks
* testing: add public method for requiring module presense in pytestAlexander V. Chernikov2023-05-151-6/+13
| | | | MFC after: 2 weeks
* testing: add support for handling Netlink carp messagesAlexander V. Chernikov2023-05-152-2/+99
| | | | MFC after: 2 weeks
* testing: add support for using custom interfaces in pytest framework.Alexander V. Chernikov2023-05-152-7/+23
| | | | MFC after: 2 weeks
* tests: fix netlink type parsing.Alexander V. Chernikov2023-04-182-2/+2
| | | | | | Netlink attribute type field is 2 bytes, not one. MFC after: 2 weeks
* Testing: add framework for the kernel unit tests.Alexander V. Chernikov2023-04-148-2/+313
| | | | | | | | | | | | | | | | | | | | 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
* tests: fix utils import in netlink testsAlexander V. Chernikov2023-04-022-4/+2
| | | | MFC after: 2 weeks
* tests: refactor atf_python a bitAlexander V. Chernikov2023-04-012-6/+20
| | | | | | | * 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
* tests: add support for parsing generic netlink families.Alexander V. Chernikov2023-04-016-71/+299
| | | | | MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39370
* tests: split netlink.py into multiple files to impove maintainability.Alexander V. Chernikov2023-04-0111-1730/+1735
| | | | | | | | | | This diff does not contain any functional changes. Its sole purpose is splitting netlink.py into smaller chunks. The new code simplifies the upcoming generic netlink support introduction. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39365
* tests: fix python parsing of netlink nested attributesAlexander V. Chernikov2023-03-131-2/+3
| | | | MFC after: 2 weeks
* tests: add more netlink tests for neighbors/routesAlexander V. Chernikov2023-03-071-15/+106
| | | | | Differential Revision: https://reviews.freebsd.org/D38912 MFC after: 2 weeks
* tests: add netlink large dump buffer checkAlexander V. Chernikov2023-02-201-9/+11
| | | | | Differential Revision: https://reviews.freebsd.org/D38665 MFC after: 2 weeks
* netlink: improve attribute decoding in python testsAlexander V. Chernikov2023-02-171-39/+92
| | | | MFC after: 2 weeks
* netlink: return optional metadata with the operation result.Alexander V. Chernikov2023-02-091-56/+70
| | | | | | | | | | | | | | | Some operations like interface creation may need to return metadata - in this case, interface name - back to the caller if the operation is successful. This change implements attaching an `NLMSGERR_ATTR_COOKIE` nla to the operation reply message via `nlmsg_report_cookie()`. Additionally, on successful interface creation, interface index and interface name are returned in the `IFLA_NEW_IFINDEX` and `IFLA_IFNAME TLVs, encapsulated in the `NLMSGERR_ATTR_COOKIE`. Reviewed By: pauamma Differential Revision: https://reviews.freebsd.org/D38283 MFC after: 1 week
* testing: handling non-root users with VNETs in pytest-based tests.Alexander V. Chernikov2023-02-093-6/+74
| | | | | | | | | | | | | | | | 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
* pytest: delete interfaces from inside the jail.Alexander V. Chernikov2023-01-251-9/+37
| | | | | | | This change follows the approach used in 80fc25025ffc, to minimise the impact of the delayed interface migration. MFC after: 2 weeks
* tests: Add an IPv4 loopback address of 127.0.0.1/8 to the lo0Jose Luis Duran2023-01-111-0/+1
| | | | | | | interface by default when creating VNETSs using pytest. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D38021