[stable gate fix] Check if cert_validate is supported
Also check if `cert_validate` is supported in building API tests.
Needed-By: https://review.opendev.org/707663
Needed-By: https://review.opendev.org/707760
Change-Id: Ic96f7becff2753ff72d5dd75bea75fadf21a036e
diff --git a/.zuul.yaml b/.zuul.yaml
index d43343a..7ffc818 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -71,10 +71,12 @@
- heat-functional
- heat-functional-non-apache
- heat-functional-legacy
- - heat-functional-convg-queens
- - heat-functional-orig-queens
- - heat-functional-convg-rocky
- - heat-functional-orig-rocky
+ # block untill https://review.opendev.org/#/q/topic:fix-stable-gate+(
+ # status:open+OR+status:merged)+project:openstack/heat merged
+ #- heat-functional-convg-queens
+ #- heat-functional-orig-queens
+ #- heat-functional-convg-rocky
+ #- heat-functional-orig-rocky
- heat-functional-convg-stein
- heat-functional-orig-stein
- heat-functional-convg-train
diff --git a/heat_tempest_plugin/tests/api/test_heat_api.py b/heat_tempest_plugin/tests/api/test_heat_api.py
index 7ad35c8..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
@@ -93,9 +94,20 @@
register_test_case_id(test_case)
cert_validate = not conf.disable_ssl_certificate_validation,
- api_tests = driver.build_tests(test_dir, loader, url=endpoint, host="",
- fixture_module=fixtures,
- cert_validate=cert_validate,
- test_loader_name=__name__)
+ 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