diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-06-20 11:59:37 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-06-20 12:11:37 +0200 |
commit | 90feb7c17908e839bd7e7f9af34e2f1010fbc72f (patch) | |
tree | 8c7156c3e947808b5db4970a112449212be2ce1a | |
parent | 6c159a1dab526cd5af89e413707e21508392d4cd (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>
(cherry picked from commit 6ec9d5167032ed82e32cde592f98a4bcffca4c00)
-rw-r--r-- | functest_kubernetes/k8stest.py | 12 |
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"]]) |