aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py
AgeCommit message (Collapse)AuthorFilesLines
2018-06-18Refactor RFC2455 TRex traffic profile injectionRodolfo Alonso Hernandez1-60/+27
The TRex RFC2455 traffic profile configures the duration of the traffic injection. Once the traffic is started, the traffic profile should poll the traffic injector client for the injection status. When the injection is finished, the traffic execution should end. Instead of this, the traffic profile waits a fixed time (using time.sleep method) and then stops the traffic. This approach is not accurate and may cause shorter injection periods. JIRA: YARDSTICK-1197 Change-Id: I5090df81ef4ec7945ff6c1aff070656b48e0fe77 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-09-14NSB: fix port topologyMartin Banszel1-24/+14
Add a new PortPair class to resolve the topology into list of public and private ports. Before we were calculating public/private in multiple locations and using different conventions. In addition for all the DPDK test we need to use the DPDK port number and no rely on interface ordering or interface naming conventions. We used to use xe0 -> 0, xe1 -> 1, etc. This is not the DPDK port number. Use the new dpdknicbind_helper class to parse the output of dpdk-devbind.py to find the actual DPDK port number at runtime. We then use this DPDK port number to correctly calculate the port_mask_hex. The port mask maps the DPDK port num (PMD ID) to the LINK ID used in the pipeline config We also need to make sure we only use the interfaces matched to the topology and not use all the interfaces, because in some cases we will have unused interfaces. In particular TRex always requires an even number of interfaces, so for single port TRex tests we have to create the second port and not use it. Thus we had to modify the traffic generator stats code to only dump stats for used ports and no unused ports. Ixia was using interface ordering to map to Ixia ports, instead we use the dpdk_port_num which must be hardcoded for Ixia. Renamed traffic_profile.execute to traffic_profile.execute_traffic so we can trace the code easier. We pass the port used by the traffic profile to generate_samples so we don't get stats for unused ports. Fixed up vPE config creation and bring up issues. Fixed up CGNAPT and UDP_Replay to work correctly. Tested with 4-port scale-out Change-Id: I2e4f328bff2904108081e92a4bf712333fa73869 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-08-25Trex: fix KPI collectionRoss Brattain1-1/+1
return super result Change-Id: I723a37281da15c1887ae1b3cf91d7e957b1924d1 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-19Support traffic generator for testing more than 10 portsDeepak S1-2/+2
Change-Id: I9c027af082cedbadc23b0151d403dab4e9756da4 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2017-08-15run_traffic: capture and exit gracefully if crash in trex run_trafficDeepak S1-0/+3
new non-blocking code of run_traffic has raise condition which causes trex client to exit with STLError. This patches captures the exception and exit gracefully Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) File "/opt/nsb_bin/yardstick_venv/lib/python2.7/site-packages/yardstick-0.1.dev0-py2.7.egg/yardstick/network_services/vnf_generic/vnf/sample_vnf.py", line 945, in _traffic_runner self.resource_helper.run_traffic(traffic_profile) File "/opt/nsb_bin/yardstick_venv/lib/python2.7/site-packages/yardstick-0.1.dev0-py2.7.egg/yardstick/network_services/vnf_generic/vnf/sample_vnf.py", line 506, in run_traffic self._run_traffic_once(traffic_profile) File "/opt/nsb_bin/yardstick_venv/lib/python2.7/site-packages/yardstick-0.1.dev0-py2.7.egg/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py", line 63, in _run_traffic_once self.client.stop(self.my_ports) File "/opt/nsb_bin/trex/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py", line 1202, in wrap2 raise STLError("'{0}' - connection to the server had been lost: '{1}'".format(func_name, client.conn.get_disconnection_cause())) STLError: Change-Id: Ie5741339451e0a3f9c4bb48f64fd35d86d18e5d4 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-08NSB updateDeepak S1-236/+67
Refactored main NSB VNF classes accroding to class diagram https://wiki.opnfv.org/display/yardstick/NSB+class+diagram All the SampleVNFs have been separated and placed under the SampleVNF class. Added AutoConnectSSH to automatically create SSH conneciton on demand. Added VnfdHelper class to wrap the VNFD dictionary in prepartion for class-based modeling. Extracted DpdkVnfSetupEnvHelper for DPDK based VNF setup. Extracted Stats and other client config to ResourceHelper Had to replace dict_key_flatten with deepgetitem due to Python 2.7 Jinja2 infinite recursion. Change-Id: Ia8840e9c44cdbdf39aab6b02e6d2176b31937dc9 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-04-11standardize ssh authRoss Brattain1-8/+4
we need to be following defautl paramiko rules, first use pkey, then key_filenames (autodetecting ~/.ssh/ keys), then password We have too much boilerplate redudant code everywhere, we need to standardize on a factory function that takes a node dict. Using Python3 ChainMap we can layer overrides and defaults. VNF descriptors have to default key_filename, password to Python None. The only way to do this is to omit key values if the variable is not defined, this way the dict will not have the value and it will default to Python None Add python2 chainmap backport Updated unittest mocking to use ssh.SSH.from_node Change-Id: I80b0cb606e593b33e317c9e5e8ed0b74da591514 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-02-07fix unittests failures due to py3Deepak S1-1/+1
Traceback (most recent call last): File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py", line 306, in test_instantiate self.context_cfg)) AssertionError: 0 != None Traceback (most recent call last): File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/tests/unit/network_services/vnf_generic/vnf/test_base.py", line 55, in test_clear self.assertEqual(queue_file_wrapper.q_out.empty(), True) File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib/python3.5/unittest/case.py", line 813, in _baseAssertEqual raise self.failureException(msg) AssertionError: False != True Traceback (most recent call last): File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py", line 321, in test_run_traffic self.assertEqual(True, result) File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib/python3.5/unittest/case.py", line 813, in _baseAssertEqual raise self.failureException(msg) AssertionError: True != False Traceback (most recent call last): File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py", line 369, in test_run_traffic self.assertEqual(True, result) File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual\ assertion_func(first, second, msg=msg) File "/usr/lib/python3.5/unittest/case.py", line 813, in _baseAssertEqual\ raise self.failureException(msg) AssertionError: True != False Change-Id: I68340196b8cc9f0fc2e4e0ef1022e8098fc860f0 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2017-01-19Adding Trex rfc2544 VNF class to initate Traffic for throughputDeepak S1-0/+285
JIRA: YARDSTICK-520 Change-Id: I1c683236a7fb946873418fb67f63500e1ba8fc91 Signed-off-by: Deepak S <deepak.s@linux.intel.com>