From 8137692dd94e112943dcc576470f4b361fbd8c5c Mon Sep 17 00:00:00 2001 From: "Sridhar K. N. Rao" Date: Wed, 2 Jun 2021 19:11:18 +0530 Subject: WIP:Infrastructure for supporting more K8S Tests. This patch add multiple changes to ViNePerf to support following tests. 1. External virtual switch - not managed by Vineperf. 2. CNI not based on virtual switch 3. Fixed bugs after successful testing. 4. Pylint issues fixed 4. Fix some license-content and comments Signed-off-by: Sridhar K. N. Rao Change-Id: Ie01735f99c0687cc812eae8e67ee2353347924f2 --- testcases/testcase.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testcases') diff --git a/testcases/testcase.py b/testcases/testcase.py index c300bfc1..40bec186 100644 --- a/testcases/testcase.py +++ b/testcases/testcase.py @@ -35,6 +35,7 @@ from tools import hugepages from tools import functions from tools import namespace from tools import veth +from tools import extvswitchflctl from tools.teststepstools import TestStepsTools from tools.llc_management import rmd @@ -76,6 +77,7 @@ class TestCase(object): self._pod_ctl = None self._pod_list = None self._vswitch_ctl = None + self._evfctl = None self._collector = None self._loadgen = None self._output_file = None @@ -203,6 +205,10 @@ class TestCase(object): # If running in k8s mode. # This value is set in main vsperf file self._k8s = S.getValue('K8S') + if self._k8s: + if S.getValue('EXT_VSWITCH'): + self._evfctl = extvswitchfctl.ExtVswitchFlowCtl() + def run_initialize(self): """ Prepare test execution environment @@ -619,6 +625,12 @@ class TestCase(object): Add connections for Kubernetes Usecases """ logging.info("Kubernetes: Adding Connections") + if self._evfctl: + self._evfctl.add_connections() + return + if self._vswitch_none: + logging.info("Vswitch cannot be None when switch is not external") + return vswitch = self._vswitch_ctl.get_vswitch() bridge = S.getValue('VSWITCH_BRIDGE_NAME') if S.getValue('K8S') and 'sriov' not in S.getValue('PLUGIN'): -- cgit 1.2.3-korg