aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/common
AgeCommit message (Collapse)AuthorFilesLines
2018-06-01Move ErrorClass definition to exceptions moduleRodolfo Alonso Hernandez2-8/+28
JIRA: YARDSTICK-1216 Change-Id: I82556e1d1b0c723221a58e188067cbce560b8338 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-05-31Replace glance delete image with shade client.Shobhi Jain1-0/+27
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-0/+36
Function create_image now uses shade client. JIRA: YARDSTICK-892 Change-Id: Ia41d9ce702a1f24031080f8a365c1b2bd9ac9faa Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-15Merge "Replace cinder detach volume with shade client."Rodolfo Alonso Hernandez1-0/+27
2018-05-15Merge "Replace cinder delete volume with shade client."Rodolfo Alonso Hernandez1-0/+27
2018-05-15Merge "Replace cinder create volume with shade client."Rodolfo Alonso Hernandez1-0/+44
2018-05-09Merge "Re enable pip package unit tests"Rodolfo Alonso Hernandez1-0/+88
2018-05-08Replace cinder detach volume with shade client.Shobhi Jain1-0/+27
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-0/+27
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-0/+44
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-08Replace cinder get_volume_id with shade client.Shobhi Jain1-0/+22
Function get_volume_id now uses shade client. JIRA: YARDSTICK-891 Change-Id: I45ae40982a64f677dbbdeb6c9510a0ec9ac973f1 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Re enable pip package unit testsRodolfo Alonso Hernandez1-0/+88
In [1] the pip unit test cases were removed, because of a problem in pip3 library. Currently there is a reported error in pip 9.0.2 version, in _vendor.urllib3 library [2]. This error is solved in [3]. [1]I43b1edc23cebe0db97b6b56a551acd376986dfea [2]https://github.com/pypa/pip/issues/5079 [3]I2ee28749f146cd3b0e1bf4ed92b51cbe6db8b2f3 JIRA: YARDSTICK-1087 Change-Id: Id4f0e1accf3240b5f27d3698323e679a27f63f87 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-05-04Merge "Add "os_cloud_config" as a new context flag parameter"Emma Foley1-1/+26
2018-05-03Replace nova get flavor with shade client.Shobhi Jain1-0/+22
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-0/+22
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-05-03Add "os_cloud_config" as a new context flag parameterRodolfo Alonso Hernandez1-1/+26
This new parameter will contain the OpenStack cloud specific configuration used by Shade client. This new flag is used only in Heat context. By default, this new parameter (dict) will contain this content: 'os_cloud_config': {'verify': False} This field will be used by HeatStack [1] to create a Shade cloud. Shade retrieves, if not defined, the OpenStack configuration from "os_client_config". This configuration is used to generate the cloud configuration, which is the description of the OpenStackCloud returned. The default parameter defined, "verify", refers to the related bug. By default, in case of using SSL certificate it will not be verified. [1] https://github.com/opnfv/yardstick/blob/b338d3091bb0beb89d4ad9f7c144f43a31a19a74/yardstick/orchestrator/heat.py#L47 JIRA: YARDSTICK-1139 Change-Id: I875a7018401b84e51dab775b8194174645d27e06 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-05-02Merge "Replace nova attach volume to server with shade client."Rodolfo Alonso Hernandez1-0/+22
2018-04-30Replace nova attach volume to server with shade client.Shobhi Jain1-0/+22
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-27Add active wait functionRodolfo Alonso Hernandez1-1/+43
Added function "wait_until_true". This function will make an active wait until the predicate passed as an argument returns True. If the timeout expires, the function will raise a generic exception or a user defined one passed as an argument. This function will be used in YARDSTICK-1127. JIRA: YARDSTICK-1128 Change-Id: I9854e465ac6b586bf4be39ab4b266d5625b39e30 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-04-26Merge "Replace nova delete keypair with shade client."Rodolfo Alonso Hernandez1-0/+27
2018-04-26Merge "Replace nova client create keypair with shade."Rodolfo Alonso Hernandez1-0/+25
2018-04-26Merge "Replace nova delete instance with shade client."Rodolfo Alonso Hernandez1-0/+27
2018-04-26Merge "Replace nova create instance with shade client."Rodolfo Alonso Hernandez1-0/+29
2018-04-23Replace nova delete keypair with shade client.Shobhi Jain1-0/+27
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-0/+25
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-0/+27
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-0/+29
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-19Merge "Update neutron delete_neutron_net function."Emma Foley1-4/+3
2018-04-18Merge "Replace neutron create security group full with shade."Rodolfo Alonso Hernandez1-0/+56
2018-04-16Update neutron delete_neutron_net function.Shobhi Jain1-4/+3
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-0/+56
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-04-13Add MQ consumer, producer and payload base classesRodolfo Alonso Hernandez4-0/+146
Added MessagingProducer base class. A class implementing this base class can send a cast message using the MQ service installed in the Yardstick jumphost (RabbitMQ by default, other MQ could be implemented). The producer will send messages to an specific topic. Added MessagingConsumer base class. A class implementing this base class will be able to receive any message sent by a MessagingPorducer class publishing messages in the topic subscribed. By default both Producer and Consumer "fanout" is True. That means every Consumer will create a fanout Queue attached to the MQ Exchange topic. All Consumers attached to this topic will receive the message sent by the Producer [1]. Added Payload base class. To send data through the message queue service, a Payload derived object should be created. This base class allows to define the attributes container in the class, convert the object to a dict and retrieve the object from a dict. Added a new library, "oslo.messaging", to implement the RPC client and server. [1]http://blog.thedigitalcatonline.com/blog/2013/08/21/some-tips-about-amqp-direct-exchanges/ JIRA: YARDSTICK-1074 Change-Id: I63932b5fb3de2bdc1270fc83295630a2a349e2a6 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-04-12Bugfix: Can't get image list in APIchenjiankun1-0/+18
JIRA: YARDSTICK-1110 To match OpenStack Pike release, we upgrade novaclient from 7.1.1 to 9.1.1. And the client interface has changed, it no longer has nova_client.images attribute. So I use shade instead. Later will change all same issue. Change-Id: Ie4f54069d4346e44e2ad925439930504b945cbad Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-27Replace neutron create security group rule with shade.Shobhi Jain1-0/+25
Rename create_secgroup_rule with create_security_group_rule. Function create_security_group_rule now uses shade client. JIRA: YARDSTICK-890 Change-Id: Ie0ebac67a281e55dc95c0e3e33ba43de80aba9ec Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-27Replace neutron floating ip deletion with shade.Shobhi Jain1-0/+29
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-22/+24
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-0/+23
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-0/+24
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-19temp unblock unittestsRoss Brattain1-88/+0
====================================================================== ERROR: common.test_packages (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: common.test_packages Traceback (most recent call last): File "/usr/lib/python3.5/unittest/loader.py", line 428, in _find_test_path module = self._get_module_from_name(name) File "/usr/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name __import__(name) File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/yardstick/tests/unit/common/test_packages.py", line 17, in <module> from pip.operations import freeze File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/__init__.py", line 45, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/vcs/mercurial.py", line 9, in <module> from pip.download import path_to_url File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/download.py", line 40, in <module> from pip._vendor import requests, six File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/_vendor/requests/__init__.py", line 98, in <module> from . import packages File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/_vendor/requests/packages.py", line 12, in <module> sys.modules['pip._vendor.requests.packages.' + mod] = sys.modules["pip._vendor." + mod] KeyError: 'pip._vendor.urllib3.contrib' File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/yardstick/tests/unit/common/test_packages.py", line 16, in <module> from pip import exceptions as pip_exceptions ====================================================================== ERROR: common.test_packages (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: common.test_packages Traceback (most recent call last): File "/usr/lib/python3.5/unittest/loader.py", line 428, in _find_test_path module = self._get_module_from_name(name) File "/usr/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name __import__(name) File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/yardstick/tests/unit/common/test_packages.py", line 16, in <module> from pip import exceptions as pip_exceptions File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/__init__.py", line 45, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/vcs/mercurial.py", line 9, in <module> from pip.download import path_to_url File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/download.py", line 40, in <module> from pip._vendor import requests, six File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/_vendor/requests/__init__.py", line 98, in <module> from . import packages File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/pip/_vendor/requests/packages.py", line 12, in <module> sys.modules['pip._vendor.requests.packages.' + mod] = sys.modules["pip._vendor." + mod] KeyError: 'pip._vendor.urllib3.packages.backports.makefile' Change-Id: I43b1edc23cebe0db97b6b56a551acd376986dfea Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2018-03-16Merge "Replace assert statements in tests"Abhijit Sinha1-19/+19
2018-03-14Merge "Get SUT information"Jack Chan1-0/+16
2018-03-12Replace neutron router deletion with shade.Shobhi Jain1-0/+28
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-0/+25
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-0/+25
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-03-12Get SUT informationchenjiankun1-0/+16
JIRA: YARDSTICK-1063 We have the demand to get SUT information. In this patch, we use ansible to get the SUT information. Change-Id: I983675d6d367fa528f00c1b50bc6fa2a9cee03f7 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-06Replace assert statements in testsEmma Foley1-19/+19
JIRA: YARDSTICK-966 Change-Id: Ic98711fa1a31d27fcb60bd96b1b3e22b5cca86b3 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-02Merge "Prohibit the importation of a list of libraries"Ross Brattain4-0/+84
2018-03-02Remove main() and __main__ from tests.Emma Foley3-23/+0
Removes the unnecessary main() functions from tests. Also removes shebang (#!) where it appears at the top of files. JIRA: YARDSTICK-861 Change-Id: I79180d1eb9c5bce640142dd62ce28c7437c1b210 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-02Replace assertEqual(None, xx) with assertIsNone(xx)Emma Foley2-2/+2
Change-Id: Ie956d8064a8fbcbd3d56c5a79c4c613d35184af4 JIRA: YARDSTICK-942 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-02Make files pep8 compliant before replacing assertEqual(None, xx)Emma Foley1-1/+1
* tests/unit/network_services/helpers/test_samplevnf_helper.py * tests/unit/network_services/traffic_profile/test_rfc2544.py * yardstick/tests/unit/common/test_ansible_common.py JIRA: YARDSTICK-942 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: Ib3c71db5f5774d2bfb3a9cbd260b838eb5501448