Merge "Add tls support for tests"
diff --git a/.zuul.yaml b/.zuul.yaml
index 88da946..40b003e 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,33 +1,32 @@
 - job:
-    name: heat-functional-convg-queens
-    parent: heat-functional-convg-mysql-lbaasv2
-    override-checkout: stable/queens
+    name: heat-functional-convg-stein
+    parent: heat-functional-convg-mysql-lbaasv2-py3
+    override-checkout: stable/stein
+    vars:
+      branch_override: stable/stein
 
 - job:
-    name: heat-functional-orig-queens
+    name: heat-functional-orig-stein
     parent: heat-functional-orig-mysql-lbaasv2
-    override-checkout: stable/queens
+    override-checkout: stable/stein
+    vars:
+      branch_override: stable/stein
+      use_python3: 1
 
 - job:
-    name: heat-functional-convg-queens-py35
-    parent: heat-functional-convg-mysql-lbaasv2-py35
-    override-checkout: stable/queens
+    name: heat-functional-convg-train
+    parent: heat-functional-convg-mysql-lbaasv2-py3
+    override-checkout: stable/train
+    vars:
+      branch_override: stable/train
 
 - job:
-    name: heat-functional-convg-rocky
-    parent: heat-functional-convg-mysql-lbaasv2
-    override-checkout: stable/rocky
-
-- job:
-    name: heat-functional-orig-rocky
+    name: heat-functional-orig-train
     parent: heat-functional-orig-mysql-lbaasv2
-    override-checkout: stable/rocky
-
-- job:
-    name: heat-functional-convg-rocky-py35
-    parent: heat-functional-convg-mysql-lbaasv2-py35
-    override-checkout: stable/rocky
-
+    override-checkout: stable/train
+    vars:
+      branch_override: stable/train
+      use_python3: 1
 
 - project:
     templates:
@@ -35,19 +34,15 @@
       - tempest-plugin-jobs
     check:
       jobs:
-        - heat-functional-orig-mysql-lbaasv2
-        - heat-functional-convg-mysql-lbaasv2
-        - heat-functional-convg-mysql-lbaasv2-non-apache
-        - heat-functional-convg-mysql-lbaasv2-py35
-        - heat-functional-convg-queens
-        - heat-functional-convg-queens-py35
-        - heat-functional-orig-queens
-        - heat-functional-convg-rocky
-        - heat-functional-convg-rocky-py35
-        - heat-functional-orig-rocky
+        - heat-functional
+        - heat-functional-non-apache
+        - heat-functional-legacy
+        - heat-functional-convg-stein
+        - heat-functional-orig-stein
+        - heat-functional-convg-train
+        - heat-functional-orig-train
     gate:
       queue: heat
       jobs:
-        - heat-functional-orig-mysql-lbaasv2
-        - heat-functional-convg-mysql-lbaasv2
-        - heat-functional-convg-mysql-lbaasv2-py35
+        - heat-functional
+        - heat-functional-legacy
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)
diff --git a/setup.cfg b/setup.cfg
index 3bdd080..8776610 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -13,10 +13,10 @@
     License :: OSI Approved :: Apache Software License
     Operating System :: POSIX :: Linux
     Programming Language :: Python
-    Programming Language :: Python :: 2
-    Programming Language :: Python :: 2.7
     Programming Language :: Python :: 3
     Programming Language :: Python :: 3.5
+    Programming Language :: Python :: 3.6
+    Programming Language :: Python :: 3.7
 
 keywords =
     setup
diff --git a/tox.ini b/tox.ini
index 45e17be..cf89710 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,11 @@
 [tox]
-envlist = py27,py35,pep8
-minversion = 0.1
+envlist = py37,pep8
+minversion = 3.1.1
 skipsdist = True
+ignore_basepython_conflict = True
 
 [testenv]
+basepython = python3
 userdevelop = True
 setenv = VIRTUAL_ENV={envdir}
 deps = -r{toxinidir}/requirements.txt
@@ -12,7 +14,6 @@
            testr run {posargs}
 
 [testenv:pep8]
-basepython = python3
 setenv =
     PYTHONPATH = .
 commands =
@@ -26,7 +27,6 @@
     check-uuid --fix --package heat_tempest_plugin
 
 [testenv:venv]
-basepython = python3
 commands = {posargs}
 
 [flake8]