aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2017-08-31Introduced default values and remove unnecessary ones from ansible code ↵Maciej Skrocki1-5/+0
image build code. Change-Id: Id711d6fdacaddeafb8550290503d6cb6c814ea70 Signed-off-by: Maciej Skrocki <maciej.skrocki@intel.com>
2017-08-30_get_ip_flow_range: fix bug with single IP rangesRoss Brattain1-3/+3
If we have a /32 or for some reason find a range of IPs to use, we can default to the single IP specified on the interface. Change-Id: Ieaa1d57b04e1d57e8cef344d5a53bbca05e7887f Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-30ssh: fix unittest race conditionRoss Brattain1-2/+2
os.stat is being called multiple times for some reason we only care that is it called at some point. ====================================================================== FAIL: tests.unit.test_ssh.SSHRunTestCase.test__put_file_sftp tags: worker-1 ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched return func(*args, **keywargs) File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/tests/unit/test_ssh.py", line 458, in test__put_file_sftp mock_stat.assert_called_once_with("localfile") File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/mock/mock.py", line 947, in assert_called_once_with raise AssertionError(msg) AssertionError: Expected 'stat' to be called once. Called 3 times. Ran 1209 tests in 2.618s FAILED (id=0, failures=1) error: testr failed (1) + testr failing ====================================================================== FAIL: tests.unit.test_ssh.SSHRunTestCase.test__put_file_sftp tags: worker-1 ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched return func(*args, **keywargs) File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/tests/unit/test_ssh.py", line 458, in test__put_file_sftp mock_stat.assert_called_once_with("localfile") File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/mock/mock.py", line 947, in assert_called_once_with raise AssertionError(msg) AssertionError: Expected 'stat' to be called once. Called 3 times. Ran 1 tests in 0.110s FAILED (id=0, failures=1) Change-Id: I73370996e6e0543419eec8ecbe81be424ec15822 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-29Merge "DRAFT: model: remove vld_id not needed"Ross Brattain1-3/+0
2017-08-29Merge "Add common openstack opertation scenarios: router & port"Ross Brattain5-0/+179
2017-08-28DRAFT: model: remove vld_id not neededRoss Brattain1-3/+0
it seems vld_id is not needed now that we add it in _resolve_topology. Remove it from the model and Heat context first and see what happens Needs testing Change-Id: I30d13c80bd90246ee3be67a2bd3439db45e20bcd Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-28Kubernetes context adoption when run in CIchenjiankun1-31/+37
JIRA: YARDSTICK-801 We need kubernetes test case run in CI. We have one scenario k8-nosdb-lb-noha for kubernetes. But for now, we need to do some adoption in CI script. Also I move check OS_AUTH_URL in heat.py. Change-Id: Iff86caf77fd74e70469ad2dc43f2238097ce0001 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-26Merge "Test case: Fio volume benchmark testcase using job file"Jing Lu2-0/+82
2017-08-26Merge "Raise Exception if HA test case failed"Kubi1-0/+1
2017-08-26Merge "Create test suite k8-nosdn-lb-noha run with k8s context"Rex Lee3-0/+121
2017-08-26Merge "improve tc002 to make packet size parameterize"Ross Brattain1-2/+3
2017-08-26Raise Exception if HA test case failedJingLu51-0/+1
Change-Id: Ia3677724075c1c1408f50bbfcebd3cbcde251d66 Signed-off-by: JingLu5 <lvjing5@huawei.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-25Create test suite k8-nosdn-lb-noha run with k8s contextchenjiankun3-0/+121
JIRA: YARDSTICK-800 We have k8-nosdn-lb-noha scenario with kubernetes deployment. So we need to add k8-nosdn-lb-noha test suite to run test case. Change-Id: Id6dc73ad999733ddfa2e03673c20f7e92a8250a3 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-25Merge "Test case: add test config file for TC078 and TC079"Jing Lu2-0/+93
2017-08-25Add common openstack opertation scenarios: router & portJingLu55-0/+179
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: Id436a201aa04f8f6b98576e8fbf599ca3654827c Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-24Merge "add ppm into result of pktgen to make result clear"Ross Brattain1-5/+5
2017-08-24Standardized TRex client library pathMaciej Skrocki26-1496/+134
- path should be defined via TREX_CLIENT_LIB environmental variable e.g. TREX_CLIENT_LIB=/opt/trex_client/stl - refactored unit tests Change-Id: I18767e48daf774432c010f1b88d18a4f0ee4e156 Signed-off-by: Maciej Skrocki <maciej.skrocki@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-24Merge "Add common openstack opertation scenarios: volume & floating ip"Jing Lu4-0/+143
2017-08-23Merge "samplevnf_helper: use network address"Ross Brattain1-0/+2
2017-08-23Merge "Re-define the framesize and flow dynamic define in testcase"Ross Brattain3-16/+49
2017-08-23improve tc002 to make packet size parameterizerexlee87761-2/+3
JIRA: YARDSTICK-793 Change-Id: I95d014ad3d2e19dd2df1f5e72d994da2f44d4544 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-23Add test case file, document and related scripts of yardsticktjuyinkanglin1-0/+179
tc057(HA_TC014) JIRA: YARDSTICK-779 Change-Id: I6a812b1c88229b20a0dd0ce5bc135c9ba15266db Signed-off-by: tjuyinkanglin <14_ykl@tongji.edu.cn>
2017-08-23Test case: add test config file for TC078 and TC079JingLu52-0/+93
Change-Id: I47c6f1bf85caa814f019a8aec446c99bb8d99f0d Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-23Add common openstack opertation scenarios: volume & floating ipJingLu54-0/+143
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I1300a61b389202242f112b6d280ab47746379546 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-23Merge "Add test case file and document of Tardstick TC056(HA_TC013)"Jing Lu1-0/+81
2017-08-23Merge "Add test case file, document and related scripts of yardstick ↵Jing Lu1-0/+111
tc058(HA_TC015)"
2017-08-22Test case: Fio volume benchmark testcase using job fileJingLu52-0/+82
JIRA: YARDSTICK-791 In some use cases, Fio is used with a job file instead of parameters. This work is about adding support for the job file and add a new test case for volume testing. Change-Id: I312d61bf6e7d95f23eedb0b6487f6103b7d76355 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-22Merge "Add common openstack opertation scenarios: subnet & port"Jing Lu5-0/+194
2017-08-22Merge "test_vsperf_dpdk: remove unused and incorrect mock open"Ross Brattain1-2/+0
2017-08-21samplevnf_helper: use network addressRoss Brattain1-0/+2
use network address with netmasks to be proper ports_mac_list is no longer valid, remove it nd_route_tbl needs to default to something otherwise the VNF will segfault if it receives IPv6 on the port, which it will because something in Neutron is sending out IPv6 packets. disable use of the routing table gateways to set arp add. We set the next hop IP to always be the TG IP address, so we need to always use the TG IP in arp add to send to the TG MAC address don't use gateways to get local addresses. we can't use gateways because with OpenStack if we define a gateway is breaks the default route and we can no longer connect to the instance via floating IP. Change-Id: I0ebefe8ac09812b6030046f73bf772edda1c7d27 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-21Re-define the framesize and flow dynamic define in testcaseDeepak S3-16/+49
This patch adds the framesize and flow into test option instead of adding a seperate file to avoid the multiple file update incase of ip change. Change-Id: Ic473c73773ad36422ecc02618b8c646a5336b70a Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2017-08-21Refactor to make file sys more like class inheritanceEdward MacGillivray10-18/+23
Change-Id: I5471d2e894ca78407a57f3ba01202264c69ad174 Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-08-21add ppm into result of pktgen to make result clearrexlee87761-5/+5
Change-Id: I6649960dc9fbc61c22c9b7434805fc335634960b Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-20test_vsperf_dpdk: remove unused and incorrect mock openRoss Brattain1-2/+0
need to use create=True with mock open anyway Change-Id: I3a35688cf8c367434db9d0cf057030d49deddd0d Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-20remove apexlake-verifyRoss Brattain1-29/+0
Change-Id: I5ac8e5d573c390460e2472c7b3b4649cc78dd295 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-21Add common openstack opertation scenarios: subnet & portJingLu55-0/+194
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: Ie59f0d5ae0842f8347824c961436b889a95b1a72 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-21Merge "Add common openstack opertation scenarios: network"Jing Lu3-0/+102
2017-08-19Merge "import_modules_from_package: refactor with generators"Ross Brattain1-28/+7
2017-08-19Merge "Fix IxLoad traffic generator issue around running the traffic."Ross Brattain2-5/+27
2017-08-19Fix IxLoad traffic generator issue around running the traffic.Deepak S2-5/+27
Change-Id: Ic1f13c0d28c1a1b01bbf3c8a6a618a5b3ab5bbeb Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-19import_modules_from_package: refactor with generatorsRoss Brattain1-28/+7
remove ..... split and use os.path.relpath to remove prefix use set operations to find missing modules, so we don't need to check dict contains multiple times Change-Id: I9531360fb9b2999e83874f144f1d06d825b22b2c Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-19Fix parsing of the results from collectd pluginsDeepak S1-2/+2
Change-Id: I3f7b9ca17164564b11517116e7e73b47f42243b9 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2017-08-17Fix import error in IxNetworkDeepak S1-9/+4
This patch fixes import error related to ixnetwork and do not wait for TG server to start as IXIA is always running :) Change-Id: I49d6b100eadafad75431cb8974605a6faa496f23 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-17Merge "utils: create TASK_LOG_DIR if it doesn't exist"Ross Brattain1-1/+2
2017-08-17Merge "run_traffic: capture and exit gracefully if crash in trex run_traffic"Ross Brattain1-1/+1
2017-08-15YAML fixesRoss Brattain4-5/+87
There are multiple issues wiht YAML loading. 1. Jinja2 renders None values as a string 'None'. This is not valid YAML we need to render None values to '~' or 'null' which is the native YAML None value. 2. Jinja2 renders dict and lists that contain unicode with u'foo' values. This is not value YAML syntax. Because we are serializing dict and lists into YAML, we need to encode them as valid YAML. We can override Jinja2 finalize to use yaml.dump to dump inline YAML. We use yaml.safe_dump(elem, default_flow_style=True).replace('\n', '') to generate valid single-line YAML dict and list values. But this problem highlights the general difficulties with templating and loading files. We could avoid this Python->Jinja2->YAML->Python issue by directly injecting the list or dict after the YAML is loaded. I'm not sure of the real utility of these templates. 3. On Python 2 YAML loader is rendering all strings as unicode. This does not work for Trex because Trex is broken and badly coded. Trex does type checking against str() which is different for Python 2 and Python 3. The default YAML loader will return native string types, str() or unicode() for Python 2 and Python 3 respectively. The bad Trex codes is in convert_val: https://github.com/cisco-system-traffic-generator/trex-core/blob/master/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py#L674 def convert_val (val): if is_integer(val): return val if type(val) == str: return ipv4_str_to_num (is_valid_ipv4(val)) raise CTRexPacketBuildException(-11,("init val invalid %s ") % val ); This code is doing type(val) == str. This is bad and broken. We can't fix Trex, so we have to render all strings as native str() types The bug here was that the Heat template loader template_format.py was overriding the global YAML loader to always return unicode. We don't want this global override. To fix this we have to use local subclasses of the yaml.SafeLoader class. But in order to dynamically subclass from CSafeLoader or SafeLoader we have to use the type() builtin to define a new class at runtime. Once we have new classes defined, we can safely isolate different YAML constructors and return unicode or not depending on the case. To be consistent we implement a new yaml_loader.py module to centralize all non-Heat template yaml loading to ensure correct uncode/str conversion Change-Id: Iebf9cf78fbda390977c390436b0869e7bbf503eb Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-15run_traffic: capture and exit gracefully if crash in trex run_trafficDeepak S1-1/+1
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-15Enable ixnet traffic generator to run trafficDeepak S1-1/+1
Change-Id: I8d7cea75aa864c37a058a154a38c9828ea5da434 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-15deepgetitem: try string index before intRoss Brattain1-0/+13
Change-Id: I3b353c5887db0ebbe33e37db505e72b85167b54e Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>