]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Change localhost references in test_nested_stack
authorClint Byrum <clint@fewbar.com>
Tue, 27 Aug 2013 16:04:28 +0000 (09:04 -0700)
committerClint Byrum <clint@fewbar.com>
Tue, 27 Aug 2013 16:19:04 +0000 (09:19 -0700)
These references are using localhost which may be running a server and
provide valid responses, contaminating the test. Using RFC2606's
recommended test TLD of '.test' ensures that these will never resolve.

Change-Id: Ie555a321c2af23fbcf4aca9207acb6a0e40bb703

heat/tests/test_nested_stack.py

index 68a9bcfa5a9625b86a91b684cc03f137e76169c3..dc752564c5548ed0e7b20bca5f1e50c22ebe19d2 100644 (file)
@@ -34,7 +34,7 @@ Resources:
   the_nested:
     Type: AWS::CloudFormation::Stack
     Properties:
-      TemplateURL: https://localhost/the.template
+      TemplateURL: https://server.test/the.template
       Parameters:
         KeyName: foo
 '''
@@ -80,7 +80,7 @@ Outputs:
         return stack
 
     def test_nested_stack_create(self):
-        urlfetch.get('https://localhost/the.template').MultipleTimes().\
+        urlfetch.get('https://server.test/the.template').MultipleTimes().\
             AndReturn(self.nested_template)
         self.m.ReplayAll()
 
@@ -106,9 +106,9 @@ Outputs:
         self.m.VerifyAll()
 
     def test_nested_stack_update(self):
-        urlfetch.get('https://localhost/the.template').MultipleTimes().\
+        urlfetch.get('https://server.test/the.template').MultipleTimes().\
             AndReturn(self.nested_template)
-        urlfetch.get('https://localhost/new.template').MultipleTimes().\
+        urlfetch.get('https://server.test/new.template').MultipleTimes().\
             AndReturn(self.update_template)
 
         self.m.ReplayAll()
@@ -119,8 +119,9 @@ Outputs:
         original_nested_id = rsrc.resource_id
         t = template_format.parse(self.test_template)
         new_res = copy.deepcopy(t['Resources']['the_nested'])
-        new_res['Properties']['TemplateURL'] = 'https://localhost/new.template'
-        prop_diff = {'TemplateURL': 'https://localhost/new.template'}
+        new_res['Properties']['TemplateURL'] = (
+            'https://server.test/new.template')
+        prop_diff = {'TemplateURL': 'https://server.test/new.template'}
         rsrc.handle_update(new_res, {}, prop_diff)
 
         # Expect the physical resource name staying the same after update,
@@ -144,7 +145,7 @@ Outputs:
         self.m.VerifyAll()
 
     def test_nested_stack_suspend_resume(self):
-        urlfetch.get('https://localhost/the.template').AndReturn(
+        urlfetch.get('https://server.test/the.template').AndReturn(
             self.nested_template)
         self.m.ReplayAll()
 
@@ -186,7 +187,7 @@ Outputs:
         super(ResDataNestedStackTest, self).setUp()
 
     def test_res_data_delete(self):
-        urlfetch.get('https://localhost/the.template').AndReturn(
+        urlfetch.get('https://server.test/the.template').AndReturn(
             self.nested_template)
         self.m.ReplayAll()
         stack = self.create_stack(self.test_template)