Remove possible existing packages in deployment test

In scenario test, test packages will be uploaded and then deleted after test
executed. But in case of the packages deletion failure, it will block the
following tests.

This patch checks and removes those test packages before uploading them.

Change-Id: I90c5d903d8c5c3eeface2735bba61d01a877aaf8
This commit is contained in:
Rocky 2019-02-27 21:03:19 +11:00
parent 3fb9565f11
commit 42f113e69e
1 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,15 @@ class TestMuranoDeployment(base.BaseApplicationCatalogScenarioTest):
else:
cls.client = cls.application_catalog_client
# remove existing test packages
existing_packages = cls.client.get_list_packages()
for package in existing_packages:
if package["fully_qualified_name"] in \
['io.murano.test.apache.ApacheHttpServerCustom',
'io.murano.apps.test.Lighttpd',
'io.murano.apps.test.UpdateExecutor']:
cls.client.delete_package(package["id"])
cls.packages[0] = cls.client.upload_package(
application_name, archive_name, dir_with_archive,
{"categories": ["Web"], "tags": ["test"]})