aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/pytests/conftest.py
blob: c118aa7c57dc553c932fbec162b580671e6f3b80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import test_length_utils

dut_type_list = [
   "N310",
   "N320",
   "B210",
   "E320",
   "X310",
   "X310_TwinRx",
   "x4xx"
]


test_length_list = [
    test_length_utils.Test_Length_Smoke,
    test_length_utils.Test_Length_Full,
    test_length_utils.Test_Length_Stress
]


def pytest_addoption(parser):
    parser.addoption(
        "--addr",
        type=str,
        nargs='?',
        help="address of first 10 GbE interface",)
    parser.addoption(
        "--second_addr",
        type=str,
        nargs='?',
        help="address of second 10 GbE interface")
    parser.addoption(
        "--name",
        type=str,
        nargs='?',
        help="name of B2xx device")
    parser.addoption(
        "--mgmt_addr",
        type=str,
        nargs='?',
        help="address of management interface. only needed for DPDK test cases")
    parser.addoption(
        "--dut_type",
        type=str,
        required=True,
        choices=dut_type_list,
        help="")
    parser.addoption(
        "--test_length",
        type=str,
        default=test_length_utils.Test_Length_Full,
        choices=test_length_list,
        help="")
    parser.addoption(
        "--uhd_build_dir",
        required=True,
        type=str,
        help="")
    parser.addoption(
        "--num_recv_frames",
        type=str,
        nargs='?',
        help="configures num_recv_frames parameter")
    parser.addoption(
        "--num_send_frames",
        type=str,
        nargs='?',
        help="configures num_send_frames parameter")

def pytest_configure(config):
    # register additional markers
    config.addinivalue_line("markers", "dpdk: run with DPDK enable")