aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/lib
AgeCommit message (Collapse)AuthorFilesLines
2018-07-31Change assert statements to raises in CheckValueMiikka Koistinen1-11/+6
* Instead of using assert statements, raise a custom exception. * Modify the unit tests so that they do not test unused parameters for equality. * Fix pylint and pep8 errors. JIRA: YARDSTICK-966 Change-Id: I41e13a5a22086827792eaf9de8da2e4ed6dd42de Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
2018-05-31Replace glance delete image with shade client.Shobhi Jain1-19/+17
Remove get_image_id function. Function delete_image now uses shade client. JIRA: YARDSTICK-892 Change-Id: I6e8510dfa49aa14786ed7ac3382b85c4e699fb9e Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-29Replace glance create image with shade client.Shobhi Jain1-34/+37
Function create_image now uses shade client. JIRA: YARDSTICK-892 Change-Id: Ia41d9ce702a1f24031080f8a365c1b2bd9ac9faa Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder detach volume with shade client.Shobhi Jain1-14/+19
Function detach volume now uses shade client. JIRA: YARDSTICK-891 Change-Id: Ie437ccf1172cb82dc869963f0d62e31a5ab23ebb Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder delete volume with shade client.Shobhi Jain1-14/+16
Function delete volume now uses shade client. JIRA: YARDSTICK-891 Change-Id: I016e1d3bf5972879cad176b56c7282e35413945e Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder create volume with shade client.Shobhi Jain1-24/+25
Adds get_volume function. Function create volume now uses shade client. JIRA: YARDSTICK-891 Change-Id: I0b2fae5f2cf52eaf2e4a0062c858d49bc4ce9ccd Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-03Replace nova get flavor with shade client.Shobhi Jain1-16/+21
Rename get_flavor_by_name with get_flavor. Function get_flavor now uses shade client. JIRA: YARDSTICK-1088 Change-Id: Ic82127e475baf39643be0a254b177f3058b85748 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-03Replace nova get server with shade client.Shobhi Jain1-46/+38
Rename get_server_by_name with get_server. Function get_server now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I69c59145cefdb565f3ece27baaaf932905e1b757 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-30Replace nova attach volume to server with shade client.Shobhi Jain1-15/+20
Function attach_volume_to_server now uses shade client instead of nova client. JIRA: YARDSTICK-1088 Change-Id: Id00df672c2c195b5c338cbbc30ddf2742a4e4d29 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova delete keypair with shade client.Shobhi Jain1-15/+14
Function delete_keypair now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I46b895748c5c44b0bf7d5b035395676ebff48d7f Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova client create keypair with shade.Shobhi Jain1-31/+18
Function create_keypair now uses shade client instead of nova client. JIRA: YARDSTICK-1088 Change-Id: I060580504d6969c5ba859ed4494082feb998d37d Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova delete instance with shade client.Shobhi Jain1-13/+20
Function delete_instance now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I5772a74c6dc2d103edd410042a8eaf721d1bcc5c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova create instance with shade client.Shobhi Jain1-34/+40
Remove redundant functions: *get_instances *get_instance_status *get_instance_by_name Function create_instance_and_wait_for_active now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I766da333dabbb1b83a7b4ede4bf73567ec70eb8c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-16Update neutron delete_neutron_net function.Shobhi Jain1-11/+13
Update the changes done in patch [1]. JIRA: YARDSTICK-890 [1] https://gerrit.opnfv.org/gerrit/#/c/52361/ Change-Id: Iccbf16d0a2e72919d5092366241ff41686f01a58 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-16Replace neutron create security group full with shade.Shobhi Jain1-23/+17
Function create_security_group_full now uses shade client. Remove openstack util's private 'get_security_groups', 'get_security_group_id' & 'create_security_group' functions as 'create_security_group_full' now uses 'get_security_group' & 'create_security_group' function defined in shade client library. JIRA: YARDSTICK-890 Change-Id: Ibd5b9ca9b7ce99b3e40c5dcc545f2af672ce2203 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-27Replace neutron floating ip deletion with shade.Shobhi Jain1-12/+14
Function delete_floating_ip now uses shade client. JIRA: YARDSTICK-890 Change-Id: I960630926b664266afbe7be00bb1352243b41be0 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-20Replace neutron floating ip creation with shade.Shobhi Jain1-9/+23
Function create_floating_ip now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I3defd691dad998cebf98442b52f0555b176f1af4 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-20Replace neutron router interface deletion with shade.Shobhi Jain1-14/+14
Function remove_interface_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I6bd36e35a339cce64dfa8b69c1e7b56cd70af956 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-20Replace neutron router creation with shade.Shobhi Jain1-23/+23
Function create_neutron_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I819d26f4edb3af5e50f777e8ddbadf4d24820b7f Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-12Replace neutron router deletion with shade.Shobhi Jain1-12/+12
Function delete_neutron_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I5b557b640396f343b85b5f5eff415384decc083c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-12Replace neutron subnet creation with shade.Shobhi Jain1-23/+37
Function 'create_neutron_subnet' now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I8eb5295cecd73742bfb5a7d0764af6f45ef0685e Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-12Replace neutron network creation with shade.Shobhi Jain1-20/+21
Function create_neutron_net now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I456078e98550901c1f736640c9f9bd0d5f9c3df6 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-02-19Replace neutron network deletion with shade.Shobhi Jain1-5/+4
Function delete_neutron_net now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I99b6f3ecd37d6e3b783f7eb3da9f971398fc3bdd Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-02-09Replace neutron get network id with shade.Shobhi Jain1-15/+11
Function get_network_id now uses shade client instead of shade client. Removed redundant function: get_port_id. JIRA: YARDSTICK-890 Change-Id: I6081477fee39fa78131187e65daf3d7d3a9e439f Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-01-22Clean unit tests in "benchmark.scenarios.lib.test_create_volume.pyEmma Foley1-5/+4
* Use mock_object.assert_called_with instead of self.assertTrue(mock_object.called) * Remove an unneeded if clause in CreateVolume * Add individual tests for each method in CreateVolume Change-Id: I54cc56434d316f059b3822879145e6a299866fcb Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2017-10-19add CheckConnectivity scenarioJingLu51-0/+99
Change-Id: I9d246828790467c2a57ba410826ee9751fff89c5 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-09-14improve logging, clear using printrexlee87761-1/+1
Change-Id: I744353f631cf1771d75f750543e8612f81be71ee Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-25Add common openstack opertation scenarios: router & portJingLu56-1/+277
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: Id436a201aa04f8f6b98576e8fbf599ca3654827c Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-23Add common openstack opertation scenarios: volume & floating ipJingLu54-0/+219
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I1300a61b389202242f112b6d280ab47746379546 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-21Add common openstack opertation scenarios: subnet & portJingLu57-0/+331
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/+182
2017-08-15YAML fixesRoss Brattain1-2/+2
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-11Merge "Add common openstack opertation scenarios: image & volume"Jing Lu4-0/+255
2017-08-11Add common openstack opertation scenarios: networkJingLu53-0/+182
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I854fc435a5c951245a5997cd4e3e63c5162030af Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-11Add common openstack opertation scenarios: image & volumeJingLu54-0/+255
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I3de7dbb30eaebac4feebcf07dd6a0d2bdcf428d9 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-11Add common openstack opertation scenarios: flavor & serverJingLu54-0/+247
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I9e84a8894fe9b9c1754a45a0ddfdf93739164b9a Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-08NSB updateDeepak S1-1/+10
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-07-26Test Case: OPNFV_YARDSTICK_TC023: VM availability during live migrationchenjiankun9-0/+587
JIRA: YARDSTICK-174 This live migration test case is based on share storage, default share storage is enabled. This test case will do some config work. And do live migration and calculate the migration time and downtime. Change-Id: I6601601edebdd0ac6434ba632b1eba9e9bd4fda0 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>