summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-14 01:59:53 +0000
committerGerrit Code Review <review@openstack.org>2016-12-14 01:59:53 +0000
commitfca51403a07894afbb816db79da8133dcc6846af (patch)
tree8ef2340bccd783348689c04e5aecb0620dd74bf2
parentd45f484641231527f3af8619be5a1fbf1ed1591b (diff)
parent3636cb8419cbdace1b17313207f6253587f36cde (diff)
downloadpython-heatclient-fca51403a07894afbb816db79da8133dcc6846af.tar.gz
Merge "Add heat CLI test for creating stack from URL"
-rw-r--r--heatclient/tests/functional/config.py14
-rw-r--r--heatclient/tests/functional/osc/v1/test_stack.py18
2 files changed, 28 insertions, 4 deletions
diff --git a/heatclient/tests/functional/config.py b/heatclient/tests/functional/config.py
new file mode 100644
index 0000000..246c45c
--- /dev/null
+++ b/heatclient/tests/functional/config.py
@@ -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
diff --git a/heatclient/tests/functional/osc/v1/test_stack.py b/heatclient/tests/functional/osc/v1/test_stack.py
index 8f7ecc8..c409a07 100644
--- a/heatclient/tests/functional/osc/v1/test_stack.py
+++ b/heatclient/tests/functional/osc/v1/test_stack.py
@@ -12,6 +12,7 @@
from tempest.lib.common.utils import data_utils as utils
+from heatclient.tests.functional import config
from heatclient.tests.functional.osc.v1 import base
@@ -25,16 +26,25 @@ class OpenStackClientStackTest(base.OpenStackClientTestBase):
super(OpenStackClientStackTest, self).setUp()
self.stack_name = utils.rand_name(name='test-stack')
- def _stack_create_minimal(self):
- template = self.get_template_path('heat_minimal_hot.yaml')
+ 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')
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()
self.assertEqual(self.stack_name, stack['stack_name'])
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):
stack = self._stack_create_minimal()
stack = self._stack_suspend(stack['id'])