diff options
author | Rabi Mishra <ramishra@redhat.com> | 2016-03-23 10:20:21 +0530 |
---|---|---|
committer | Anant Patil <anant.patil@hp.com> | 2016-03-24 15:32:43 +0530 |
commit | 97b748e65c0e9ce5ace242b72c761559e1dfb73f (patch) | |
tree | 528e71444530b066d62741c062de6e4a323a6f57 /heat_integrationtests | |
parent | b8cd5f9ac30629eb6ae48051fbe0b6df16719f48 (diff) | |
download | heat-97b748e65c0e9ce5ace242b72c761559e1dfb73f.tar.gz |
Use region from config in functional tests
We seem to be using hardcoded region in some inline
templates of fucntional tests. They would fail if
the region name is different. This changes to use
it from the config.
Closes-Bug: #1560585
(cherry picked from commit cbed62355cb006dabd6a160f4c9f04d423a353c0)
Change-Id: Iafd1251545e00c6cba292b042352b1ef34da81e0
Diffstat (limited to 'heat_integrationtests')
-rw-r--r-- | heat_integrationtests/functional/test_remote_stack.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/heat_integrationtests/functional/test_remote_stack.py b/heat_integrationtests/functional/test_remote_stack.py index 91a165cb0..d7b2cdf00 100644 --- a/heat_integrationtests/functional/test_remote_stack.py +++ b/heat_integrationtests/functional/test_remote_stack.py @@ -45,6 +45,9 @@ outputs: def setUp(self): super(RemoteStackTest, self).setUp() + # replacing the template region with the one from the config + self.template = self.template.replace('RegionOne', + self.conf.region) def test_remote_stack_alone(self): stack_id = self.stack_create(template=self.remote_template) @@ -79,7 +82,7 @@ outputs: def test_stack_create_bad_region(self): stack_name = self._stack_rand_name() - tmpl_bad_region = self.template.replace('RegionOne', 'DARKHOLE') + tmpl_bad_region = self.template.replace(self.conf.region, 'DARKHOLE') files = {'remote_stack.yaml': self.remote_template} kwargs = { 'stack_name': stack_name, @@ -101,8 +104,9 @@ outputs: ex = self.assertRaises(exc.HTTPBadRequest, self.stack_create, **kwargs) error_msg = ('ERROR: Failed validating stack template using Heat ' - 'endpoint at region "RegionOne" due to ' - '"ERROR: The template section is invalid: resource"') + 'endpoint at region "%s" due to ' + '"ERROR: The template section is ' + 'invalid: resource"') % self.conf.region self.assertEqual(error_msg, six.text_type(ex)) def test_stack_update(self): |