K8S: Ensure Correct Mode-Checking. 72/72272/1
authorSridhar Rao <sridhar.rao@spirent.com>
Thu, 25 Mar 2021 16:57:55 +0000 (22:27 +0530)
committerSridhar Rao <sridhar.rao@spirent.com>
Thu, 25 Mar 2021 17:00:14 +0000 (22:30 +0530)
This patch add fix to a minor bug.
Run pod operations only in K8S mode.

Signed-off-by: Sridhar K. N. Rao <sridhar.rao@spirent.com>
Change-Id: I8dd0e6c738e382a2b5981739282cb109c67ab862

testcases/testcase.py

index 51d212b..c300bfc 100644 (file)
@@ -200,6 +200,10 @@ class TestCase(object):
         if S.getValue('LLC_ALLOCATION'):
             self._rmd = rmd.CacheAllocator()
 
+        # If running in k8s mode.
+        # This value is set in main vsperf file
+        self._k8s = S.getValue('K8S')
+
     def run_initialize(self):
         """ Prepare test execution environment
         """
@@ -218,12 +222,11 @@ class TestCase(object):
             len(self._step_vnf_list))
 
         self._vnf_list = self._vnf_ctl.get_vnfs()
-
-        self._pod_ctl = component_factory.create_pod(
-            self.deployment,
-            loader.get_pod_class())
-
-        self._pod_list = self._pod_ctl.get_pods()
+        if self._k8s:
+            self._pod_ctl = component_factory.create_pod(
+                self.deployment,
+                loader.get_pod_class())
+            self._pod_list = self._pod_ctl.get_pods()
 
         # verify enough hugepages are free to run the testcase
         if not self._check_for_enough_hugepages():