summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/tests/create_stack_tests.py
diff options
context:
space:
mode:
authorTaseer Ahmed <taseer94@gmail.com>2017-10-13 12:34:00 +0500
committerTaseer Ahmed <taseer94@gmail.com>2017-10-19 20:07:54 +0500
commitbc8f8f580bf356dace5fa0a0968f9d179d5e515a (patch)
treec6be68211d750e81910a75f3cc747fe9b27f4efc /snaps/openstack/tests/create_stack_tests.py
parent530153597deb5030c296358431d9549d13b7288b (diff)
Add reason for stack creation failure
JIRA: SNAPS-190 Change-Id: I59b7d416ef16cd1f301ccbdcdd8a7529527b3dd6 Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'snaps/openstack/tests/create_stack_tests.py')
-rw-r--r--snaps/openstack/tests/create_stack_tests.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/snaps/openstack/tests/create_stack_tests.py b/snaps/openstack/tests/create_stack_tests.py
index d2b138e..f4eb1eb 100644
--- a/snaps/openstack/tests/create_stack_tests.py
+++ b/snaps/openstack/tests/create_stack_tests.py
@@ -30,7 +30,8 @@ import unittest
import uuid
from snaps.openstack import create_stack
-from snaps.openstack.create_stack import StackSettings, StackSettingsError
+from snaps.openstack.create_stack import (
+ StackSettings, StackSettingsError, StackCreationError)
from snaps.openstack.tests import openstack_tests, create_instance_tests
from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
from snaps.openstack.utils import heat_utils, neutron_utils, nova_utils
@@ -214,6 +215,23 @@ class CreateStackSuccessTests(OSIntegrationTestCase):
self.assertEqual(created_stack.id, retrieved_stack.id)
self.assertEqual(0, len(self.stack_creator.get_outputs()))
+ def test_create_stack_short_timeout(self):
+ """
+ Tests the creation of an OpenStack stack from Heat template file.
+ """
+ # Create Stack
+ # Set the default stack settings, then set any custom parameters sent
+ # from the app
+ stack_settings = StackSettings(
+ name=self.__class__.__name__ + '-' + str(self.guid) + '-stack',
+ template_path=self.heat_tmplt_path,
+ env_values=self.env_values, stack_create_timeout=0)
+
+ self.stack_creator = create_stack.OpenStackHeatStack(self.heat_creds,
+ stack_settings)
+ with self.assertRaises(StackCreationError):
+ self.stack_creator.create()
+
def test_create_stack_template_dict(self):
"""
Tests the creation of an OpenStack stack from a heat dict() object.