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:20 +0200 |
commit | d0de7fde9f605e2179e95ae7a7fe9dffb9f72269 (patch) | |
tree | 86989bab4abe8220850b2c8617982cdd373057af | |
parent | 34163d9bb3aa11e9b584bd2673162fe742c9544c (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"]]) |