From 6ec9d5167032ed82e32cde592f98a4bcffca4c00 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 20 Jun 2021 11:59:37 +0200 Subject: Allow passing extra opts to e2e.test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest_kubernetes/k8stest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'functest_kubernetes') 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"]]) -- cgit 1.2.3-korg