aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2021-06-20 11:59:37 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2021-06-20 12:00:44 +0200
commit6ec9d5167032ed82e32cde592f98a4bcffca4c00 (patch)
tree6196ef5cb4363bdbce119ed082840d4dd53522ba /functest_kubernetes
parent34564fb985604eb127638ed02047054cf863cbc5 (diff)
Allow passing extra opts to e2e.test
E2E_TEST_OPTS now allows setting runtime opts. For instance, Functest K8s gates ask for -container-runtime containerd Change-Id: I4f6e1caf57590b16d0c01324dadb040f67f3cee4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest_kubernetes')
-rw-r--r--functest_kubernetes/k8stest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/functest_kubernetes/k8stest.py b/functest_kubernetes/k8stest.py
index 740a3b93..2d17a27d 100644
--- a/functest_kubernetes/k8stest.py
+++ b/functest_kubernetes/k8stest.py
@@ -45,6 +45,15 @@ class E2ETesting(testcase.TestCase):
self.output_log_name = 'functest-kubernetes.log'
self.output_debug_log_name = 'functest-kubernetes.debug.log'
+ @staticmethod
+ def convert_ini_to_dict(value):
+ "Convert oslo.conf input to dict"
+ assert isinstance(value, str)
+ try:
+ return dict((x.rsplit(':', 1) for x in value.split(',')))
+ except ValueError:
+ return {}
+
def run_kubetest(self, **kwargs): # pylint: disable=too-many-branches
"""Run the test suites"""
cmd_line = [
@@ -54,6 +63,9 @@ class E2ETesting(testcase.TestCase):
'-provider', 'skeleton', '-report-dir', self.res_dir]
for arg in kwargs.get("ginkgo", {}):
cmd_line.extend(['-ginkgo.{}'.format(arg), kwargs["ginkgo"][arg]])
+ for key, value in self.convert_ini_to_dict(
+ os.environ.get("E2E_TEST_OPTS", "")).items():
+ cmd_line.extend(['-{}'.format(key), value])
if "NON_BLOCKING_TAINTS" in os.environ:
cmd_line.extend(
['-non-blocking-taints', os.environ["NON_BLOCKING_TAINTS"]])