Merge "Correctly initialize copies of stack during updating stack"
diff --git a/common/config.py b/common/config.py
index f07ee86..5ced77b 100644
--- a/common/config.py
+++ b/common/config.py
@@ -38,6 +38,8 @@
     cfg.StrOpt('instance_type',
                help="Instance type for tests. Needs to be big enough for a "
                     "full OS plus the test workload"),
+    cfg.StrOpt('minimal_instance_type',
+               help="Instance type enough for simplest cases."),
     cfg.StrOpt('image_ref',
                help="Name of image to use for tests which boot servers."),
     cfg.StrOpt('keypair_name',
@@ -65,6 +67,9 @@
     cfg.StrOpt('fixed_network_name',
                default='private',
                help="Visible fixed network name "),
+    cfg.StrOpt('floating_network_name',
+               default='public',
+               help="Visible floating network name "),
     cfg.StrOpt('boot_config_env',
                default=('heat_integrationtests/scenario/templates'
                         '/boot_config_none_env.yaml'),
diff --git a/common/remote_client.py b/common/remote_client.py
index 2955418..f0405b8 100644
--- a/common/remote_client.py
+++ b/common/remote_client.py
@@ -143,7 +143,7 @@
         connection.close()
 
 
-class RemoteClient():
+class RemoteClient(object):
 
     # NOTE(afazekas): It should always get an address instead of server
     def __init__(self, server, username, password=None, pkey=None,
diff --git a/functional/test_autoscaling.py b/functional/test_autoscaling.py
index d640915..cbb0fec 100644
--- a/functional/test_autoscaling.py
+++ b/functional/test_autoscaling.py
@@ -720,3 +720,31 @@
         self.assertTrue(test.call_until_true(
             self.build_timeout, self.build_interval,
             self.check_instance_count, stack_identifier, 5))
+
+    def test_signal_during_suspend(self):
+        """Prove that a signal will fail when the stack is in suspend."""
+
+        stack_identifier = self.stack_create(template=self.template,
+                                             files=self.files,
+                                             environment=self.env)
+
+        self.assertTrue(test.call_until_true(
+            self.build_timeout, self.build_interval,
+            self.check_instance_count, stack_identifier, 2))
+
+        nested_ident = self.assert_resource_is_a_stack(stack_identifier,
+                                                       'JobServerGroup')
+
+        # suspend the top level stack.
+        self.client.actions.suspend(stack_id=stack_identifier)
+        self._wait_for_resource_status(
+            stack_identifier, 'JobServerGroup', 'SUSPEND_COMPLETE')
+
+        # Send a signal and confirm nothing happened.
+        self.client.resources.signal(stack_identifier, 'ScaleUpPolicy')
+        # still SUSPEND_COMPLETE (not gone to UPDATE_COMPLETE)
+        self._wait_for_stack_status(nested_ident, 'SUSPEND_COMPLETE')
+        # still 2 instances.
+        self.assertTrue(test.call_until_true(
+            self.build_timeout, self.build_interval,
+            self.check_instance_count, stack_identifier, 2))
diff --git a/functional/test_hooks.py b/functional/test_hooks.py
index f7d455a..5c6f6bd 100644
--- a/functional/test_hooks.py
+++ b/functional/test_hooks.py
@@ -191,8 +191,6 @@
             reason='Hook pre-update is cleared',
             rsrc_name='rg')
         self.assertEqual('CREATE_COMPLETE', ev[0].resource_status)
-        self._wait_for_resource_status(
-            stack_identifier, 'rg', 'CREATE_COMPLETE')
         self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE')
         res_after = self.client.resources.get(stack_identifier, 'rg')
         self.assertEqual(res_before.physical_resource_id,
diff --git a/functional/test_validation.py b/functional/test_validation.py
index 2df6356..6a65091 100644
--- a/functional/test_validation.py
+++ b/functional/test_validation.py
@@ -22,8 +22,9 @@
         if not self.conf.minimal_image_ref:
             raise self.skipException("No image configured to test")
 
-        if not self.conf.instance_type:
-            raise self.skipException("No instance_type configured to test")
+        if not self.conf.minimal_instance_type:
+            raise self.skipException(
+                "No minimal_instance_type configured to test")
 
         self.assign_keypair()
 
@@ -72,7 +73,7 @@
         env = {'resource_registry':
                {'My::Config': 'provider.yaml'}}
         parameters = {'keyname': self.keypair_name,
-                      'flavor': self.conf.instance_type,
+                      'flavor': self.conf.minimal_instance_type,
                       'image': self.conf.minimal_image_ref}
         # Note we don't wait for CREATE_COMPLETE, because we're using a
         # minimal image without the tools to apply the config.
diff --git a/scenario/scenario_base.py b/scenario/scenario_base.py
index 77c3624..dd25b89 100644
--- a/scenario/scenario_base.py
+++ b/scenario/scenario_base.py
@@ -31,6 +31,11 @@
         if not self.conf.instance_type:
             raise self.skipException("No flavor configured to test")
 
+        if not self.conf.minimal_image_ref:
+            raise self.skipException("No minimal image configured to test")
+        if not self.conf.minimal_instance_type:
+            raise self.skipException("No minimal flavor configured to test")
+
     def launch_stack(self, template_name, expected_status='CREATE_COMPLETE',
                      parameters=None, **kwargs):
         template = self._load_template(__file__, template_name, self.sub_dir)
diff --git a/scenario/test_neutron_autoscaling.py b/scenario/test_neutron_autoscaling.py
index 2ba085b..9bbfbab 100644
--- a/scenario/test_neutron_autoscaling.py
+++ b/scenario/test_neutron_autoscaling.py
@@ -20,8 +20,6 @@
 
     def setUp(self):
         super(NeutronAutoscalingTest, self).setUp()
-        if not self.conf.minimal_image_ref:
-            raise self.skipException("No minimal image configured to test")
         if not self.conf.fixed_subnet_name:
             raise self.skipException("No sub-network configured to test")
         self.template_name = 'test_neutron_autoscaling.yaml'
@@ -41,7 +39,7 @@
         parameters = {
             "image_id": self.conf.minimal_image_ref,
             "capacity": "1",
-            "instance_type": self.conf.instance_type,
+            "instance_type": self.conf.minimal_instance_type,
             "fixed_subnet_name": self.conf.fixed_subnet_name,
         }
 
diff --git a/scenario/test_neutron_loadbalancer.py b/scenario/test_neutron_loadbalancer.py
index 3f49251..bbe85bc 100644
--- a/scenario/test_neutron_loadbalancer.py
+++ b/scenario/test_neutron_loadbalancer.py
@@ -24,7 +24,7 @@
 
     def setUp(self):
         super(NeutronLoadBalancerTest, self).setUp()
-        self.public_net = self._get_network('public')
+        self.public_net = self._get_network(self.conf.floating_network_name)
         self.template_name = 'test_neutron_loadbalancer.yaml'
 
     def collect_responses(self, ip, expected_resp):
@@ -52,7 +52,7 @@
 
         parameters = {
             'key_name': self.keypair_name,
-            'flavor': self.conf.instance_type,
+            'flavor': self.conf.minimal_instance_type,
             'image': self.conf.image_ref,
             'private_subnet_id': self.net['subnets'][0],
             'external_network_id': self.public_net['id']
diff --git a/scenario/test_volumes.py b/scenario/test_volumes.py
index 9b12a9c..79d4931 100644
--- a/scenario/test_volumes.py
+++ b/scenario/test_volumes.py
@@ -119,7 +119,7 @@
         """
         parameters = {
             'key_name': self.keypair_name,
-            'instance_type': self.conf.instance_type,
+            'instance_type': self.conf.minimal_instance_type,
             'image_id': self.conf.minimal_image_ref,
             'volume_description': self.volume_description,
             'timeout': self.conf.build_timeout,