Add heat CLI test for creating stack from URL
Change-Id: I63eb0958cb53b5e8d3843e59f0cfc9f55947708f
This commit is contained in:
14
heatclient/tests/functional/config.py
Normal file
14
heatclient/tests/functional/config.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
|
HEAT_MINIMAL_HOT_TEMPLATE_URL = 'https://raw.githubusercontent.com/openstack/python-heatclient/acb378364c96f9c5d46d8d4095d69a81fe91727a/heatclient/tests/functional/templates/heat_minimal_hot.yaml' # noqa
|
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
from tempest.lib.common.utils import data_utils as utils
|
from tempest.lib.common.utils import data_utils as utils
|
||||||
|
|
||||||
|
from heatclient.tests.functional import config
|
||||||
from heatclient.tests.functional.osc.v1 import base
|
from heatclient.tests.functional.osc.v1 import base
|
||||||
|
|
||||||
|
|
||||||
@@ -25,16 +26,25 @@ class OpenStackClientStackTest(base.OpenStackClientTestBase):
|
|||||||
super(OpenStackClientStackTest, self).setUp()
|
super(OpenStackClientStackTest, self).setUp()
|
||||||
self.stack_name = utils.rand_name(name='test-stack')
|
self.stack_name = utils.rand_name(name='test-stack')
|
||||||
|
|
||||||
def _stack_create_minimal(self):
|
def _stack_create_minimal(self, from_url=False):
|
||||||
|
if from_url:
|
||||||
|
template = config.HEAT_MINIMAL_HOT_TEMPLATE_URL
|
||||||
|
else:
|
||||||
template = self.get_template_path('heat_minimal_hot.yaml')
|
template = self.get_template_path('heat_minimal_hot.yaml')
|
||||||
parameters = ['test_client_name=test_client_name']
|
parameters = ['test_client_name=test_client_name']
|
||||||
return self._stack_create(self.stack_name, template, parameters)
|
return self._stack_create(self.stack_name, template=template,
|
||||||
|
parameters=parameters)
|
||||||
|
|
||||||
def test_stack_create_minimal(self):
|
def test_stack_create_minimal_from_file(self):
|
||||||
stack = self._stack_create_minimal()
|
stack = self._stack_create_minimal()
|
||||||
self.assertEqual(self.stack_name, stack['stack_name'])
|
self.assertEqual(self.stack_name, stack['stack_name'])
|
||||||
self.assertEqual("CREATE_COMPLETE", stack['stack_status'])
|
self.assertEqual("CREATE_COMPLETE", stack['stack_status'])
|
||||||
|
|
||||||
|
def test_stack_create_minimal_from_url(self):
|
||||||
|
stack = self._stack_create_minimal(from_url=True)
|
||||||
|
self.assertEqual(self.stack_name, stack['stack_name'])
|
||||||
|
self.assertEqual("CREATE_COMPLETE", stack['stack_status'])
|
||||||
|
|
||||||
def test_stack_suspend_resume(self):
|
def test_stack_suspend_resume(self):
|
||||||
stack = self._stack_create_minimal()
|
stack = self._stack_create_minimal()
|
||||||
stack = self._stack_suspend(stack['id'])
|
stack = self._stack_suspend(stack['id'])
|
||||||
|
Reference in New Issue
Block a user