Merge "[ussuri][goal] Drop python 2.7 support and testing"
diff --git a/heat_tempest_plugin/tests/api/gabbits/environments.yaml b/heat_tempest_plugin/tests/api/gabbits/environments.yaml
index 03849df..3d98a68 100644
--- a/heat_tempest_plugin/tests/api/gabbits/environments.yaml
+++ b/heat_tempest_plugin/tests/api/gabbits/environments.yaml
@@ -43,7 +43,7 @@
   redirects: True
   poll:
     count: 10
-    delay: 1.0
+    delay: 2.0
   response_json_paths:
     $.stack.stack_status: CREATE_COMPLETE
 
diff --git a/heat_tempest_plugin/tests/api/gabbits/resources.yaml b/heat_tempest_plugin/tests/api/gabbits/resources.yaml
index c99b6a9..f21fa67 100644
--- a/heat_tempest_plugin/tests/api/gabbits/resources.yaml
+++ b/heat_tempest_plugin/tests/api/gabbits/resources.yaml
@@ -38,7 +38,7 @@
   redirects: True
   poll:
     count: 10
-    delay: 1.0
+    delay: 2.0
   response_json_paths:
     $.stack.stack_status: CREATE_COMPLETE
 
diff --git a/heat_tempest_plugin/tests/api/gabbits/stacks.yaml b/heat_tempest_plugin/tests/api/gabbits/stacks.yaml
index ba15f7e..e2ce6a6 100644
--- a/heat_tempest_plugin/tests/api/gabbits/stacks.yaml
+++ b/heat_tempest_plugin/tests/api/gabbits/stacks.yaml
@@ -38,7 +38,7 @@
   redirects: True
   poll:
     count: 10
-    delay: 1.0
+    delay: 2.0
   response_json_paths:
     $.stack.stack_status: CREATE_COMPLETE
 
@@ -88,7 +88,7 @@
   redirects: True
   poll:
     count: 10
-    delay: 1.0
+    delay: 2.0
   response_json_paths:
     $.stack.stack_status: CREATE_COMPLETE
 
@@ -132,7 +132,7 @@
   redirects: True
   poll:
     count: 10
-    delay: 1.0
+    delay: 2.0
   response_json_paths:
     $.stack.stack_status: UPDATE_COMPLETE
 
@@ -152,7 +152,7 @@
   redirects: True
   poll:
     count: 10
-    delay: 1.0
+    delay: 2.0
   response_json_paths:
     $.stack.stack_status: UPDATE_COMPLETE
 
diff --git a/heat_tempest_plugin/tests/api/test_heat_api.py b/heat_tempest_plugin/tests/api/test_heat_api.py
index 7ba3a62..38df5b8 100644
--- a/heat_tempest_plugin/tests/api/test_heat_api.py
+++ b/heat_tempest_plugin/tests/api/test_heat_api.py
@@ -13,13 +13,14 @@
 
 """A test module to exercise the Heat API with gabbi.  """
 
-import keystoneauth1
 import os
 import sys
 import unittest
 
 from gabbi import driver
+import keystoneauth1
 from oslo_log import log as logging
+import six
 from tempest import config
 
 from heat_tempest_plugin.common import test
@@ -92,8 +93,21 @@
             else:
                 register_test_case_id(test_case)
 
-    api_tests = driver.build_tests(test_dir, loader, url=endpoint, host="",
-                                   fixture_module=fixtures,
-                                   test_loader_name=__name__)
+    cert_validate = not conf.disable_ssl_certificate_validation,
+    try:
+        api_tests = driver.build_tests(test_dir, loader, url=endpoint, host="",
+                                       fixture_module=fixtures,
+                                       cert_validate=cert_validate,
+                                       test_loader_name=__name__)
+    except TypeError as ex:
+        err_msg = "got an unexpected keyword argument 'cert_validate'"
+        if err_msg in six.text_type(ex):
+            api_tests = driver.build_tests(test_dir, loader,
+                                           url=endpoint, host="",
+                                           fixture_module=fixtures,
+                                           test_loader_name=__name__)
+        else:
+            raise
+
     register_test_suite_ids(api_tests)
     return api_tests
diff --git a/heat_tempest_plugin/tests/scenario/scenario_base.py b/heat_tempest_plugin/tests/scenario/scenario_base.py
index db38c4e..9cad2fa 100644
--- a/heat_tempest_plugin/tests/scenario/scenario_base.py
+++ b/heat_tempest_plugin/tests/scenario/scenario_base.py
@@ -51,11 +51,6 @@
         template = self._load_template(__file__, template_name, self.sub_dir,
                                        files)
 
-        parameters = parameters or {}
-
-        if kwargs.get('add_parameters'):
-            parameters.update(kwargs['add_parameters'])
-
         stack_id = self.stack_create(
             stack_name=kwargs.get('stack_name'),
             template=template,
diff --git a/heat_tempest_plugin/tests/scenario/test_volumes.py b/heat_tempest_plugin/tests/scenario/test_volumes.py
index 732213c..3a179a9 100644
--- a/heat_tempest_plugin/tests/scenario/test_volumes.py
+++ b/heat_tempest_plugin/tests/scenario/test_volumes.py
@@ -12,6 +12,7 @@
 
 
 from cinderclient import exceptions as cinder_exceptions
+import copy
 from oslo_log import log as logging
 import six
 from tempest.lib import decorators
@@ -38,8 +39,7 @@
         self.assertIsNotNone(volume)
         self.assertEqual(expected_status, volume.status)
         self.assertEqual(self.volume_size, volume.size)
-        self.assertEqual(self.volume_description,
-                         volume.display_description)
+        self.assertEqual(self.volume_description, volume.description)
 
     def _outputs_verify(self, stack, expected_status='available'):
         self.assertEqual(expected_status,
@@ -49,7 +49,7 @@
         self.assertEqual(self.volume_description,
                          self._stack_output(stack, 'display_description'))
 
-    def check_stack(self, stack_id, parameters):
+    def check_stack(self, stack_id, default_parameters):
         stack = self.client.stacks.get(stack_id)
 
         # Verify with cinder that the volume exists, with matching details
@@ -73,13 +73,14 @@
         backup = backups_filtered[0]
         self.addCleanup(self.volume_client.backups.delete, backup.id)
 
+        parameters = copy.deepcopy(default_parameters)
+        parameters.update({'backup_id': backup.id})
         # Now, we create another stack where the volume is created from the
         # backup created by the previous stack
         try:
             stack_identifier2 = self.launch_stack(
                 template_name='test_volumes_create_from_backup.yaml',
-                parameters=parameters,
-                add_parameters={'backup_id': backup.id})
+                parameters=parameters)
             stack2 = self.client.stacks.get(stack_identifier2)
         except exceptions.StackBuildErrorException:
             LOG.exception("Halting test due to bug: #1382300")
@@ -113,7 +114,7 @@
            4. Create a new stack, where the volume is created from the backup
            5. Verify the test data written in (1) is present in the new volume
         """
-        parameters = {
+        default_parameters = {
             'key_name': self.keypair_name,
             'instance_type': self.conf.minimal_instance_type,
             'image_id': self.conf.minimal_image_ref,
@@ -122,13 +123,15 @@
             'network': self.net['id']
         }
         if self.conf.vm_to_heat_api_insecure:
-            parameters['wc_extra_args'] = '--insecure'
+            default_parameters['wc_extra_args'] = '--insecure'
+
+        parameters = copy.deepcopy(default_parameters)
+        parameters.update({'volume_size': self.volume_size})
         # Launch stack
         stack_id = self.launch_stack(
             template_name='test_volumes_delete_snapshot.yaml',
-            parameters=parameters,
-            add_parameters={'volume_size': self.volume_size}
+            parameters=parameters
         )
 
         # Check stack
-        self.check_stack(stack_id, parameters)
+        self.check_stack(stack_id, default_parameters)