Add Glare to python-muranloclient tests

Add possibility to python-muranloclient tests to maintain global
variable for GLARE

Targets bp: murano-glare-devstack-testing
Depends-On: Ia0eb97587dc6a1f2f66006f8cce14997577c4707
Change-Id: Ic14ab4c07434936264690b84e07d7af1d5e682ad
This commit is contained in:
MStolyarenko 2016-08-30 20:36:15 +03:00
parent 9f8e6c3286
commit 399b2a2740
3 changed files with 24 additions and 2 deletions

View File

@ -16,9 +16,15 @@ import unittest
from muranoclient.tests.functional.cli import \
murano_test_utils as utils
from muranoclient.tests.functional import muranoclient as murano_client
from oslo_utils.strutils import bool_from_string as str2bool
# TODO(mstolyarenko): need to remove this raw when
# https://bugs.launchpad.net/python-muranoclient/+bug/1625039 is fixed
flag = murano_client.ClientTestBase.get_backend_flag()
class SimpleReadOnlyMuranoClientTest(utils.CLIUtilsTestBase):
"""Basic, read-only tests for Murano CLI client.
@ -626,7 +632,11 @@ class DeployMuranoEnvironmentTest(utils.CLIUtilsTestPackagesBase):
to the environment, session creation and deployment of
environment.
"""
# TODO(mstolyarenko): need to unskip this test when
# https://bugs.launchpad.net/python-muranoclient/+bug/1625039 is fixed
@unittest.skipUnless(flag == 'glare',
"This test fails when GLARE is used as packages "
"service. To be fixed as part of #1625039")
def test_environment_deployment(self):
"""Test scenario:
@ -660,6 +670,11 @@ class DeployMuranoEnvironmentTest(utils.CLIUtilsTestPackagesBase):
self.assertEqual('success', deployments[0]['State'])
self.assertEqual(1, len(deployments))
# TODO(mstolyarenko): need to unskip this test when
# https://bugs.launchpad.net/python-muranoclient/+bug/1625039 is fixed
@unittest.skipUnless(flag == 'glare',
"This test fails when GLARE is used as packages "
"service. To be fixed as part of #1625039")
def test_add_component_to_deployed_env(self):
"""Test scenario:

View File

@ -22,6 +22,7 @@ class ClientTestBase(base.ClientTestBase):
def murano(self, action, flags='', params='',
fail_ok=False, endpoint_type='publicURL', merge_stderr=True):
flags += self.get_backend_flag()
return self.clients.cmd_with_auth(
'murano', action, flags, params, fail_ok, merge_stderr)
@ -60,3 +61,9 @@ class ClientTestBase(base.ClientTestBase):
for element in somelist:
if element[known_field] == known_value:
return element[need_field]
@staticmethod
def get_backend_flag():
backend = os.environ.get('MURANO_PACKAGES_SERVICE', 'murano')
backend_flag = " --murano-packages-service {0} ".format(backend)
return backend_flag

View File

@ -28,7 +28,7 @@ commands = {posargs}
[testenv:functional]
setenv =
OS_TEST_PATH = ./muranoclient/tests/functional
passenv = OS_*
passenv = OS_* MURANO_PACKAGES_SERVICE
[testenv:uitests]
commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}"