-
Notifications
You must be signed in to change notification settings - Fork 9
Guidance for test authors
This document mostly applies to Python tests but some of the guidance may be more broadly applicable.
Test files should be relatively self contained. The libraries should only include very core or non-trivial code. It may be tempting to "factor out" the common code, but ignore that urge. Library code increases the barrier of entry, and complexity in general.
Dual-host tests (tests with an endpoint) should be written from the DUT perspective. IOW the local machine should be the one tested, remote is just for traffic generation and may be shared.
Try not to make configuration changes to the remote system.
The env must be clean after test exits. Register a defer() for any action that needs an "undo" as soon as possible. If you need to run the cancel action as part of the test - defer returns an object you can execute.
Use ksft_pr()
instead of print()
to avoid breaking TAP format.
By default the tests are expected to be able to run on a single-interface systems. All tests which may disconnect NETIF
must be annotated with @ksft_disruptive
.