diff --git a/qinling_tempest_plugin/config.py b/qinling_tempest_plugin/config.py index 198c44b2..50f33b15 100644 --- a/qinling_tempest_plugin/config.py +++ b/qinling_tempest_plugin/config.py @@ -45,4 +45,8 @@ QinlingGroup = [ cfg.StrOpt("nodejs_runtime_image", default="openstackqinling/nodejs-runtime:0.0.1", help="The NodeJS runtime being used in the tests."), + cfg.BoolOpt("allow_external_connection", + default=False, + help="If the tests which need external network connection " + "should be running."), ] diff --git a/qinling_tempest_plugin/tests/api/test_executions.py b/qinling_tempest_plugin/tests/api/test_executions.py index 58c155dc..21edec6f 100644 --- a/qinling_tempest_plugin/tests/api/test_executions.py +++ b/qinling_tempest_plugin/tests/api/test_executions.py @@ -19,11 +19,14 @@ import requests import futurist from oslo_serialization import jsonutils +from tempest import config from tempest.lib import decorators from tempest.lib import exceptions +import testtools from qinling_tempest_plugin.tests import base +CONF = config.CONF INVOKE_ERROR = "Function execution failed because of too much resource " \ "consumption" @@ -492,6 +495,8 @@ class ExecutionsTest(base.BaseQinlingTest): self.assertLessEqual(lower, first_duration) @decorators.idempotent_id('07edf2ff-7544-4f30-b006-fd5302a2a9cc') + @testtools.skipUnless(CONF.qinling.allow_external_connection, + "External network connection is not allowed") def test_python_execution_public_connection(self): """Test connections from k8s pod to the outside.