aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils
AgeCommit message (Collapse)AuthorFilesLines
2017-05-17Add Python3 support to the ODL testcaseCédric Ollivier3-66/+66
It also adds this support to its dependencies. Change-Id: I0534f0c7b0e15a9ee89f522f314cf5200874454c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-14Assign the wrapped function’s attributesCédric Ollivier1-0/+2
It mainly assigns to the wrapper push_results_to_db's __name__, __module__ and __doc__ and the documentation string. Change-Id: Idc882ac4e743699a4887e46c5066e0983c90afd9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-05Merge "Delete functest.utils.functest_logger"Jose Lausuch6-94/+12
2017-05-04Delete functest.utils.functest_loggerCédric Ollivier6-94/+12
It deletes functest.utils.functest_logger and the related unit tests. Then it modifies all functest modules to get all loggers via logging.getLogger(). __name__ is mainly used as getLogger arg as proposed by logging [1]. All loggers and handlers are now defined via functest/ci/logging.ini instead of a dict loaded by an external json file. Now only warn messages and info messages from ci and core packages are printed in console. [1] https://docs.python.org/2/library/logging.html Change-Id: Ic192855e0f9bf94825d8f7ec73549a0f3b8d44c5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-04Merge "Update rally_conf.json for creating deployment"Jose Lausuch1-2/+10
2017-05-04Merge "Add the choice of interface for keystoneclient"Jose Lausuch1-1/+3
2017-05-03Remove openstack directoryjose.lausuch5-35/+0
It is useles right now and won't be used in the future. Change-Id: I9aa121544051f49f7e7e794ae3b2c4a9ea516e47 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-05-02Add the choice of interface for keystoneclientLinda Wang1-1/+3
1. When functest is running on external host not jumpserver, keystoneclient is used to retrieve or create projects/tenants and users, which would fail to establish connection to the admin endpoint. 2. Keystoneclient will connect to the public endpoint by setting the env OS_INTERFACE to be public. 3. Remove the admin endpoint check in check_os.sh. JIRA: FUNCTEST-801 Change-Id: I324f5c8fdf61447319070a23f6b6bc6b1bbc1d48 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-04-27Update rally_conf.json for creating deploymentLinda Wang1-2/+10
1. The rally_conf.json is obtained via def get_credentials_for_rally(), where the parameter endpoint_type is supposed to get from the env OS_ENDPOINT_TYPE or OS_INTERFACE, just as the def get_creds_from_env_vars() in rally project [1]. [1] https://github.com/openstack/rally/blob/master/rally/cli/envutils.py JIRA: FUNCTEST-801 Change-Id: I6b6be82b9ff7f04948b47c4fca836d415fe13f8b Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-04-26Logger must be a singletonCédric Ollivier1-0/+7
It avoids creating a python object for every message printed. Change-Id: Ia42b59db9f7ce4eadc7e91da4d193db646b54d85 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-26Manage criteria in TestCaseCédric Ollivier1-16/+7
It converts all criteria values to the corresponding percent in functest/ci/testcases.yaml. Result is expected to be equal or greater than criteria. If both are 0, result is considered as false. It is compatible with the old behavior but warns to update. It will allow a safer remove. It also fixes a bug in test_tempest to allow merging [1] and tier_handler.py which required that type criteria was str. [1] https://gerrit.opnfv.org/gerrit/#/c/27949/ Change-Id: Ib6edcfa3103b7d51b0bdc83119f1cea2a8be9fbc Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-26Switch TestCase attribute criteria to resultCédric Ollivier1-3/+3
It mainly avoids mixing input and output. Criteria is now an input set in functest/ci/testcases.yaml and then must be passed as __init__() args (which will be proposed in an additional change). Then it also renames the related TestCase method to check_result(). Change-Id: Ifc3c8e3ea6cde7e3edf7174bed4bf2bf0894e8e3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-21Merge "Fix pylint warnings in decorators.py"Cedric Ollivier1-8/+12
2017-04-21Merge "Stop hardcoding results suffix in push_to_db"Cedric Ollivier2-3/+4
2017-04-20[VNF_base] Support existing tenant and userboucherv1-0/+18
Support existing tenant and user with a get_or_create_tenant method. If the tenant and user already exist it only get the id of those JIRA: FUNCTEST-799 Change-Id: Id5daf2904592e42199471bdd3547e861e6db6e32 Signed-off-by: boucherv <valentin.boucher@orange.com>
2017-04-20Fix pylint warnings in decorators.pyCédric Ollivier1-8/+12
Change-Id: Ie6c53feb97053248c909d641753b44b5f51c8719 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-19Stop hardcoding results suffix in push_to_dbMatthewLi2-3/+4
Adding results in url is useless as it is defined in results section in config_functest.yaml. It allows defining the full name in case of dumping to file (see decorator.py). The commented local file is the value required by dovetail. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: I35ba9b34d99e138292f099934e28585ee8b85604 Signed-off-by: MatthewLi <matthew.lijun@huawei.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-04-11Modify TestCase constructor attributesCédric Ollivier1-1/+1
Every feature/testcase now allows receiving the data defined in testcases.yaml as args (name is renamed to case_name). From the time being, only project and case names are handled. Next pending patches will add criteria, cmd and repo to this list. It keeps the default values for case names except for features which will be aggregated into Feature. Change-Id: Id742d100b8183d7f10894c24ae6879d1b2b60ac9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-30Check a rule existence for a specific security grouptomsou1-0/+34
Implement a functionality to check if a rule concerning a specific security group exists - function get_security_group_rules(neutron_client, sg_id) returns the list of the security rules for a specific security group - function check_security_group_rules(neutron_client, sg_id, direction, protocol, port_min=None, port_max=None) checks if a specific rule for a specific security group exists and returns True or False - implement unit tests for the two new functions This new functionality is needed for sdnvpn project Change-Id: Ib930bc9a76141932f4164d88e2640b49f3df4d77 Signed-off-by: tomsou <soth@intracom-telecom.com>
2017-03-23Merge "Ignore certain modules for logging"Jose Lausuch1-1/+12
2017-03-23Merge "Switch test_db_url to a directory"Morgan Richomme1-1/+8
2017-03-23Merge "Support running on openstack which enabled https"Jose Lausuch1-2/+15
2017-03-22Ignore certain modules for loggingjose.lausuch1-1/+12
Some modules are logged to functest.log or the console and are not relevant for us since they are already in the openstack logs. This causes a huge log which makes it unreadable. Change-Id: I3f0fb83e2080e41cd5bf815f8448f5bc25e3464a Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-03-22Switch test_db_url to a directoryxudan1-1/+8
We must now set a dir (e.g. /home/opnfv/db) to dump results. It avoids replacing "results" and prevent from limiting the use of this decorator. All data will be dumped into url/dump.txt As also proposed in FUNCTEST-729, missing directories are created too. The decorator will raise exceptions if dir exists or if target is not a directory. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> JIRA: FUNCTEST-729 Change-Id: I9650c72493043539f17725f5c328c12639ecc059 Signed-off-by: xudan <xudan16@huawei.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-22Merge changes from topics '644', 'improve_unix_permission_check'Cedric Ollivier2-0/+0
* changes: Change execute bits Improve unix permissions fixes
2017-03-21Change execute bitsCédric Ollivier2-0/+0
It applies the rules proposed by "Improve unix permissions fixes" [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/31171/ Change-Id: If5142befb74165a982f9281e8770289b303d483d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-03-20bug fix: version not retrieved on weekly jobsMorgan Richomme1-7/+1
a first fix had been done but the version was retrieved 2 times with the regex this patch removes the second regex and re-use get_version the associated unit tests has been removed because even if the build_tag is badly formated, it will not prevent the results to be pushed with version = unknown JIRA: FUNCTEST-765 Change-Id: I2cbe8ba1dd7278c3f3510a47c667c433f65e00f8 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-03-17Bug Fix: retrieve version from build tag in weekly jobsMorgan Richomme1-4/+3
- fix regex issue - add unit test to cover weekly and dummy build tags - remove useless logs JIRA: FUNCTEST-765 Change-Id: I7a8d40b4662f4557cd080669da46fb1c32d2ad6d Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-03-15env variable support for test DB urlMorgan Richomme1-1/+9
So far DB url was retrieved from configuration file If you want to use the CI chain (jenkins, testapi, test DB, functest, ..) then you have a problem calling functest will systematically point to the configuration from the repo Supporting env variable allow to avoid post processing in the configuration file and as a consequence offer the possibility to create a local DB to host local results Change-Id: Ie64b8b265827d7f5724c7066a8c173de8cf012e2 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-03-13Support running on openstack which enabled httpshelenyao1-2/+15
JIRA: FUNCTEST-757 Change-Id: Ic87bee3020b9714bcd83105127440a9c1a7ff2ad Signed-off-by: helenyao <yaohelan@huawei.com>
2017-03-10Merge "Add extra check to avoid double delete of instances"Morgan Richomme1-1/+6
2017-03-07delete ft_constants and file functest_constants.pySerenaFeng1-209/+0
delete no longer used ft_constants in run_test.py substitute ft_constants with CONST in foundation.py and remove useless str() finally delete not-used file functest_constants.py Change-Id: I109a5409e501b610f41aae7d75c55ca745a3d4c1 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-03Add extra check to avoid double delete of instancesCiprian Barbu1-1/+6
JIRA: FUNCTEST-748 Sometimes Openstack doesn't handle deletion in a timely manner which can lead to openstack_clean to think there are leftovers from a previous test when in fact the instances are pending deletion. This patch tries to better handle this kind of situation that would otherwise result in a double free and eventually <class 'nova.exception.InstanceInvalidState'> (HTTP 500) Change-Id: Id0d9b61d8380e9b12fc7acd46cd84260714f4baf Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com>
2017-03-01Merge "Adopt TestcaseBase for ONOS and ONOS SFC"Jose Lausuch1-9/+0
2017-03-01Adopt TestcaseBase for ONOS and ONOS SFChelenyao1-9/+0
1. Adopted TestcaseBase for ONOS and ONOS SFC 2. Removed the ONOS testcase from exec_test.sh This patch is not meant to refactor the code which can be improved in a later patch. Change-Id: Ib8ac47742f598648c7575c9a8968477307629d42 Signed-off-by: helenyao <yaohelan@huawei.com>
2017-03-01Merge "Fix bad log message when trying to create an existing sec group"Jose Lausuch1-26/+33
2017-03-01Merge "[odl-sfc] Add function to retrieve a resource from HEAT"Morgan Richomme1-0/+28
2017-03-01Fix bad log messageMorgan Richomme1-26/+33
when trying to create an existing sec group JIRA: FUNCTEST-741 Change-Id: I049cdbd854bf5c4fbc490fb0fd52689800159da5 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
2017-03-01Merge "config_functest support muiltilevel query"Morgan Richomme1-8/+12
2017-02-28[odl-sfc] Add function to retrieve a resource from HEATJuan Vidal1-0/+28
Introduces function to retrieve a HEAT client. For the moment, the only wrapper function is the one to retrieve resources. Added unit tests to cover the new functions. python-heatclient is added to requirements.txt and test_requirements.txt. Change-Id: I547138141c6aad611f2353599fb70a013c83058a Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
2017-02-25Merge "Bugfix:Added the adapter info for compass and joid"Jose Lausuch1-1/+1
2017-02-24Merge "Use new-style classes which inherit from object"Morgan Richomme1-1/+1
2017-02-23Bugfix:Added the adapter info for compass and joidhelenyao1-1/+1
CI for compass and joid failed as there is no key defined in installer_params.yaml Change-Id: I8d17d36d854974c0751d3fd3bab4994205f786bb Signed-off-by: helenyao <yaohelan@huawei.com>
2017-02-23Merge "Prepare env will exit when an error is raised"Jose Lausuch1-0/+7
2017-02-23Merge "[odl-sfc] Fix wait_for_vnf returning vnf_id on timeout"Jose Lausuch1-0/+5
2017-02-23Use new-style classes which inherit from objectLinda Wang1-1/+1
JIRA: FUNCTEST-707 Change-Id: Ieaa888375136eddbbe003a24b32bf09fd0f92923 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-02-22Prepare env will exit when an error is raisedhelenyao1-0/+7
JIRA: FUNCTEST-727 Change-Id: I4d8e24c0cb6272d92dc777dc82d56490948598db Signed-off-by: helenyao <yaohelan@huawei.com>
2017-02-22Merge "Undo setting CI_DEBUG to true by default"Cedric Ollivier1-1/+1
2017-02-22Merge "Add deployment_handler printout to prepare env"Jose Lausuch1-0/+2
2017-02-21Add deployment_handler printout to prepare envjose.lausuch1-0/+2
Example virtual deployment apex: http://paste.openstack.org/raw/599536/ Example CI POD: http://paste.openstack.org/raw/599537/ Change-Id: I0711b45a525bc074a9c05f0ea3a194b2db05f2d9 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>