Skip integration tests when Swift is not available
Let's skip integration tests using Swift when the service is not available. It will help turn the py3 gate green. Change-Id: Ib3536583dbb3bbf50d9c64976e909fd352391d05
This commit is contained in:
parent
30e6359517
commit
9398dedd98
@ -18,6 +18,7 @@ import time
|
|||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from heatclient import exc as heat_exceptions
|
from heatclient import exc as heat_exceptions
|
||||||
|
from keystoneauth1 import exceptions as kc_exceptions
|
||||||
from neutronclient.common import exceptions as network_exceptions
|
from neutronclient.common import exceptions as network_exceptions
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
@ -194,6 +195,15 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def is_service_available(self, service_type):
|
||||||
|
try:
|
||||||
|
self.identity_client.get_endpoint_url(
|
||||||
|
service_type, self.conf.region)
|
||||||
|
except kc_exceptions.EndpointNotFound:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _stack_output(stack, output_key, validate_errors=True):
|
def _stack_output(stack, output_key, validate_errors=True):
|
||||||
"""Return a stack output value for a given key."""
|
"""Return a stack output value for a given key."""
|
||||||
|
@ -72,6 +72,8 @@ Outputs:
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(AwsStackTest, self).setUp()
|
super(AwsStackTest, self).setUp()
|
||||||
|
if not self.is_service_available('object-store'):
|
||||||
|
self.skipTest('object-store service not available, skipping')
|
||||||
self.object_container_name = test.rand_name()
|
self.object_container_name = test.rand_name()
|
||||||
self.project_id = self.identity_client.project_id
|
self.project_id = self.identity_client.project_id
|
||||||
self.swift_key = hashlib.sha224(
|
self.swift_key = hashlib.sha224(
|
||||||
|
@ -34,6 +34,8 @@ outputs:
|
|||||||
class SwiftSignalHandleUpdateTest(functional_base.FunctionalTestsBase):
|
class SwiftSignalHandleUpdateTest(functional_base.FunctionalTestsBase):
|
||||||
|
|
||||||
def test_stack_update_same_template_replace_no_url(self):
|
def test_stack_update_same_template_replace_no_url(self):
|
||||||
|
if not self.is_service_available('object-store'):
|
||||||
|
self.skipTest('object-store service not available, skipping')
|
||||||
stack_identifier = self.stack_create(template=test_template)
|
stack_identifier = self.stack_create(template=test_template)
|
||||||
stack = self.client.stacks.get(stack_identifier)
|
stack = self.client.stacks.get(stack_identifier)
|
||||||
orig_url = self._stack_output(stack, 'signal_url')
|
orig_url = self._stack_output(stack, 'signal_url')
|
||||||
|
Loading…
Reference in New Issue
Block a user