From 300d9f201aba1b8e30387138acaba79a72502d82 Mon Sep 17 00:00:00 2001
From: Sridhar Rao <sridhar.rao@spirent.com>
Date: Thu, 25 Mar 2021 22:27:55 +0530
Subject: K8S: Ensure Correct Mode-Checking.

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 | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/testcases/testcase.py b/testcases/testcase.py
index 51d212b4..c300bfc1 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -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():
-- 
cgit