Fix the condition of nova cert tests

This changes nova certification tests to run only if nova_cert is enabled.

Change-Id: I41e53401418c68758830d3009516b5017531b03b
Closes-Bug: 1488420
diff --git a/tempest/api/compute/certificates/test_certificates.py b/tempest/api/compute/certificates/test_certificates.py
index 78a0a93..0096fc2 100644
--- a/tempest/api/compute/certificates/test_certificates.py
+++ b/tempest/api/compute/certificates/test_certificates.py
@@ -14,13 +14,22 @@
 #    under the License.
 
 from tempest.api.compute import base
+from tempest import config
 from tempest import test
 
+CONF = config.CONF
+
 
 class CertificatesV2TestJSON(base.BaseComputeTest):
 
     _api_version = 2
 
+    @classmethod
+    def skip_checks(cls):
+        super(CertificatesV2TestJSON, cls).skip_checks()
+        if not CONF.compute_feature_enabled.nova_cert:
+            raise cls.skipException("Nova cert is not available")
+
     @test.idempotent_id('c070a441-b08e-447e-a733-905909535b1b')
     def test_create_root_certificate(self):
         # create certificates
diff --git a/tempest/config.py b/tempest/config.py
index 295b74d..b415d89 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -398,6 +398,9 @@
     cfg.BoolOpt('ec2_api',
                 default=True,
                 help='Does the test environment have the ec2 api running?'),
+    cfg.BoolOpt('nova_cert',
+                default=True,
+                help='Does the test environment have the nova cert running?'),
     # TODO(mriedem): Remove preserve_ports once juno-eol happens.
     cfg.BoolOpt('preserve_ports',
                 default=False,