1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 """Constants used in CSIT."""
17 class Constants(object):
18 """Constants used in CSIT.
20 TODO: Yaml files are easier for humans to edit.
21 Figure out how to set the attributes by parsing a file
22 that works regardless of current working directory.
25 # OpenVPP testing directory location at topology nodes
26 REMOTE_FW_DIR = '/tmp/openvpp-testing'
28 # shell scripts location
29 RESOURCES_LIB_SH = 'resources/libraries/bash'
31 # Python API provider location
32 RESOURCES_PAPI_PROVIDER = 'resources/tools/papi/vpp_papi_provider.py'
34 # vat templates location
35 RESOURCES_TPL_VAT = 'resources/templates/vat'
37 # OpenVPP VAT binary name
38 VAT_BIN_NAME = 'vpp_api_test'
40 # VPP service unit name
43 # QEMU version to install
44 QEMU_INSTALL_VERSION = 'qemu-2.11.2'
46 # QEMU install directory
47 QEMU_INSTALL_DIR = '/opt/qemu-2.11.2'
49 # QEMU performance test VM kernel image path
50 QEMU_PERF_VM_KERNEL = '/opt/boot/vmlinuz'
52 # QEMU performance test VM nested image path
53 QEMU_PERF_VM_IMAGE = '/var/lib/vm/csit-nested-1.7.img'
55 # QEMU performance test VM DPDK path
56 QEMU_PERF_VM_DPDK = '/opt/dpdk-19.02'
58 # TRex install version
59 TREX_INSTALL_VERSION = '2.35'
61 # TRex install directory
62 TREX_INSTALL_DIR = '/opt/trex-core-2.35'
64 # Kubernetes templates location
65 RESOURCES_TPL_K8S = 'resources/templates/kubernetes'
67 # KernelVM templates location
68 RESOURCES_TPL_VM = 'resources/templates/vm'
70 # Honeycomb directory location at topology nodes:
71 REMOTE_HC_DIR = '/opt/honeycomb'
73 # Honeycomb persistence files location
74 REMOTE_HC_PERSIST = '/var/lib/honeycomb/persist'
76 # Honeycomb log file location
77 REMOTE_HC_LOG = '/var/log/honeycomb/honeycomb.log'
79 # Honeycomb templates location
80 RESOURCES_TPL_HC = 'resources/templates/honeycomb'
82 # ODL Client Restconf listener port
85 # Sysctl kernel.core_pattern
86 KERNEL_CORE_PATTERN = '/tmp/%p-%u-%g-%s-%t-%h-%e.core'
89 CORE_DUMP_DIR = '/tmp'
91 # Mapping from NIC name to its bps limit.
92 # TODO: Implement logic to lower limits to TG NIC or software. Or PCI.
94 # TODO: Explain why ~40Gbps NICs are using ~25Gbps limit.
95 "Cisco-VIC-1227": 10000000000,
96 "Cisco-VIC-1385": 24500000000,
97 "Intel-X520-DA2": 10000000000,
98 "Intel-X553": 10000000000,
99 "Intel-X710": 10000000000,
100 "Intel-XL710": 24500000000,
101 "Intel-XXV710": 24500000000,
104 # Suite file names use somewhat more rich (less readable) codes for NICs.
106 "Cisco-VIC-1227": "10ge2p1vic1227",
107 "Cisco-VIC-1385": "40ge2p1vic1385",
108 "Intel-X520-DA2": "10ge2p1x520",
109 "Intel-X553": "10ge2p1x553",
110 "Intel-X710": "10ge2p1x710",
111 "Intel-XL710": "40ge2p1xl710",
112 "Intel-XXV710": "25ge2p1xxv710",
115 # TODO CSIT-1481: Crypto HW should be read from topology file instead.
116 NIC_NAME_TO_CRYPTO_HW = {
117 "Intel-X553": "HW_C3xxx",
118 "Intel-X710": "HW_DH895xcc",
119 "Intel-XL710": "HW_DH895xcc",
122 PERF_TYPE_TO_KEYWORD = {
123 "mrr": "Traffic should pass with maximum rate",
124 "ndrpdr": "Find NDR and PDR intervals using optimized search",
125 "soak": "Find critical load using PLRsearch",
128 PERF_TYPE_TO_SUITE_DOC_VER = {
129 "mrr" : '''fication:* In MaxReceivedRate tests TG sends traffic\\
130 | ... | at line rate and reports total received packets over trial period.\\''',
131 # TODO: Figure out how to include the full "*[Ver] TG verification:*"
132 # while keeping this readable and without breaking line length limit.
133 "ndrpdr": '''fication:* TG finds and reports throughput NDR (Non Drop\\
134 | ... | Rate) with zero packet loss tolerance and throughput PDR (Partial Drop\\
135 | ... | Rate) with non-zero packet loss tolerance (LT) expressed in percentage\\
136 | ... | of packets transmitted. NDR and PDR are discovered for different\\
137 | ... | Ethernet L2 frame sizes using MLRsearch library.\\''',
138 "soak": '''fication:* TG sends traffic at dynamically computed\\
139 | ... | rate as PLRsearch algorithm gathers data and improves its estimate\\
140 | ... | of a rate at which a prescribed small fraction of packets\\
141 | ... | would be lost. After set time, the serarch stops\\
142 | ... | and the algorithm reports its current estimate.\\''',
145 PERF_TYPE_TO_TEMPLATE_DOC_VER = {
146 "mrr": '''Measure MaxReceivedRate for ${frame_size}B frames\\
147 | | ... | using burst trials throughput test.\\''',
148 "ndrpdr": '''Measure NDR and PDR values using MLRsearch algorithm.\\''',
149 "soak": '''Estimate critical rate using PLRsearch algorithm.\\''',