|
1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | 2 |
|
| 3 | +""" |
| 4 | +Driver test environment. |
| 5 | +NetDrvEnv and NetDrvEpEnv are the main environment classes. |
| 6 | +Former is for local host only tests, latter creates / connects |
| 7 | +to a remote endpoint. See NIPA wiki for more information about |
| 8 | +running and writing driver tests. |
| 9 | +""" |
| 10 | + |
3 | 11 | import sys |
4 | 12 | from pathlib import Path |
5 | 13 |
|
|
8 | 16 | try: |
9 | 17 | sys.path.append(KSFT_DIR.as_posix()) |
10 | 18 |
|
11 | | - from net.lib.py import * |
12 | | - |
13 | 19 | # Import one by one to avoid pylint false positives |
| 20 | + from net.lib.py import NetNS, NetNSEnter, NetdevSimDev |
14 | 21 | from net.lib.py import EthtoolFamily, NetdevFamily, NetshaperFamily, \ |
15 | 22 | NlError, RtnlFamily, DevlinkFamily, PSPFamily |
16 | 23 | from net.lib.py import CmdExitFailure |
17 | 24 | from net.lib.py import bkg, cmd, bpftool, bpftrace, defer, ethtool, \ |
18 | 25 | fd_read_timeout, ip, rand_port, tool, wait_port_listen, wait_file |
19 | | - from net.lib.py import fd_read_timeout |
20 | 26 | from net.lib.py import KsftSkipEx, KsftFailEx, KsftXfailEx |
21 | 27 | from net.lib.py import ksft_disruptive, ksft_exit, ksft_pr, ksft_run, \ |
22 | 28 | ksft_setup |
23 | 29 | from net.lib.py import ksft_eq, ksft_ge, ksft_in, ksft_is, ksft_lt, \ |
24 | 30 | ksft_ne, ksft_not_in, ksft_raises, ksft_true, ksft_gt, ksft_not_none |
| 31 | + |
| 32 | + __all__ = ["NetNS", "NetNSEnter", "NetdevSimDev", |
| 33 | + "EthtoolFamily", "NetdevFamily", "NetshaperFamily", |
| 34 | + "NlError", "RtnlFamily", "DevlinkFamily", "PSPFamily", |
| 35 | + "CmdExitFailure", |
| 36 | + "bkg", "cmd", "bpftool", "bpftrace", "defer", "ethtool", |
| 37 | + "fd_read_timeout", "ip", "rand_port", "tool", |
| 38 | + "wait_port_listen", "wait_file", |
| 39 | + "KsftSkipEx", "KsftFailEx", "KsftXfailEx", |
| 40 | + "ksft_disruptive", "ksft_exit", "ksft_pr", "ksft_run", |
| 41 | + "ksft_setup", |
| 42 | + "ksft_eq", "ksft_ge", "ksft_in", "ksft_is", "ksft_lt", |
| 43 | + "ksft_ne", "ksft_not_in", "ksft_raises", "ksft_true", "ksft_gt", |
| 44 | + "ksft_not_none", "ksft_not_none"] |
| 45 | + |
| 46 | + from .env import NetDrvEnv, NetDrvEpEnv |
| 47 | + from .load import GenerateTraffic |
| 48 | + from .remote import Remote |
| 49 | + |
| 50 | + __all__ += ["NetDrvEnv", "NetDrvEpEnv", "GenerateTraffic", "Remote"] |
25 | 51 | except ModuleNotFoundError as e: |
26 | | - ksft_pr("Failed importing `net` library from kernel sources") |
27 | | - ksft_pr(str(e)) |
28 | | - ktap_result(True, comment="SKIP") |
| 52 | + print("Failed importing `net` library from kernel sources") |
| 53 | + print(str(e)) |
29 | 54 | sys.exit(4) |
30 | | - |
31 | | -from .env import * |
32 | | -from .load import * |
33 | | -from .remote import Remote |
|
0 commit comments