aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/openstack_clean.py
AgeCommit message (Collapse)AuthorFilesLines
2017-06-30Define console_scriptsCédric Ollivier1-6/+1
Only prepare_env.py and run_tests.py remain executable to avoid breaking the gate. As soon as the jenkins jobs are updated to run them from $PATH, tox will be updated to protect against chmod a+x py files. Dockerfile will be simplified as well. Change-Id: Iac1a7ceb6b344e800177226ea39919826f6d3735 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-26Fix floating ips issue in openstack_cleanjose.lausuch1-2/+2
floatingips is a list of dictionaries where the attributes are a bit different than in the previous implementation. Change-Id: I8e8429b1819bba35a4a829f274c60b77ab2eea7e Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-06-26Merge "Use glance to list images"Jose Lausuch1-7/+11
2017-06-26Change floating ips management from nova to neutronjose.lausuch1-5/+5
Nova does not longer support floating ip creation/deletion. This patch moves that logic to neutron client. Change-Id: I2c4146149fe5be534d9c50d78d831b5af1957ad7 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-06-24Use glance to list imagesLinda Wang1-7/+11
1. Images list is not supported by novaclient 8.0.0 2. It moves images list out of nova and into glance Change-Id: I2a2d40a2ca3a0cf1ebfb55697b3c58af8748a805 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-06-07Bugfix: fix the return valueLinda Wang1-0/+1
openstack_snapshot and openstack_clean should return 0 when they are run successfully. JIRA: FUNCTEST-835 Change-Id: I3fcc24ab985de382e0e59b129cb467d66a9a0de2 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-05-30Define create_snapshot() and clean() in TestCaseCédric Ollivier1-5/+5
They replace the former calls in run_tests which are not suitable for all test cases. Now any test case can define how to clean its resources. If the snapshot cannot be created, the test case is considered as failed. Only a message is printed if any failure during cleaning. It also defines a new class called OSGCTestCase useful for test cases which don't clean their OpenStack resources. All test cases located in opnfv_tests/openstack inherit from it to keep the global behavior unchanged. It also deletes exit instructions in openstack_clean and openstack_snapshot, removes clean flags in testcases.yaml and updates the related utils. All Docs are modified as well. JIRA: FUNCTEST-438 Change-Id: I8938e6255708012380389763a24059ace4ce45d8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-04Delete functest.utils.functest_loggerCédric Ollivier1-2/+3
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-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>
2016-12-26Enable the tenant related featureshelenyao1-5/+3
JIRA: FUNCTEST-670 The tenant related features were enabled for OpenStack snapshot and cleanup. Change-Id: Ie9a4012c0d29f57ed5a14139ccb5f8e29b6000dd Signed-off-by: helenyao <yaohelan@huawei.com>
2016-12-21Refactor test run related modules using new constants providerSerenaFeng1-3/+5
JIRA: FUNCTEST-673 Change-Id: Ia37fb5a08c8fbc4a8acb666565ea887f9ae48b83 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2016-12-14Authenticate clients with keystoneauth1.sessionhelenyao1-4/+8
JIRA: FUNCTEST-529 1. use keystoneauth1.session to initialize the client for each service The keystoneauth1.session.Session class was introduced into keystoneauth1 as an attempt to bring a unified interface to the various OpenStack clients that share common authentication and request parameters between a variety of services. 2. update ODL case to leverage session to get the endpoint info Change-Id: Ic8c01b9b7ed86d3bdd9f5125504bc47f46a37700 Signed-off-by: helenyao <yaohelan@huawei.com>
2016-12-07Revert commits that handle tacker objectsRomanos Skiadas1-121/+0
These break CI in deployments where tacker is not present. Revert them for now and reintroduce them later in a way that will work for cases where tacker is not there. Revert "Tacker objects in openstack clean" This reverts commit 510a71f74ef5f47c28995f93b461cf361a18aa74. Revert "Tacker objects in openstack snapshot" This reverts commit c2f950adc4391d312f84da016e7443758506cf8c. Change-Id: If6c470302a7be6363844eed212d25afd6e57dbc9 Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
2016-12-05Tacker objects in openstack cleanGeorge Paraskevopoulos1-0/+121
Add VNFD, VNF, SFC and SFC classifiers cleaning capabilities DEPENDS ON: https://gerrit.opnfv.org/gerrit/#/c/25485/ https://gerrit.opnfv.org/gerrit/#/c/25475/ Change-Id: I1405ed69a9dfac5d3dba7f16019288afdf65d0ff Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
2016-11-24Extracted all global parameters into functest_constants.pyhelenyao1-4/+2
JIRA: FUNCTEST-533 1. Extracted all global variables into functest_constants.py and updated all affected areas accordingly 2. Used os.path.join to replace '/' to come up with the path for better cross-platform support and improve the path accuracy 3. Removed unused variables 4. Updated the hardcoded path in Dockerfile by using variable reference 5. Removed "/" ending from all path variables 6. Updated the unit test Change-Id: Ib30a81d1f0c83fbaef042d63c187c27bd18301bb Signed-off-by: helenyao <yaohelan@huawei.com>
2016-11-09Repo structure modificationMorgan Richomme1-0/+424
- create functest subdirectory - rename unit tests - adapt path in exec and config files JIRA: FUNCTEST-525 Change-Id: Ifd5c6edfb5bda1b09f82848e2269ad5fbeb84d0a Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>