fixing onos pod log collection in atests
Change-Id: I289ebfd2702333ab42ebb3df97384f1ddf6ed980
diff --git a/tests/atests/common/volthaMngr.py b/tests/atests/common/volthaMngr.py
index 1978f82..c164989 100755
--- a/tests/atests/common/volthaMngr.py
+++ b/tests/atests/common/volthaMngr.py
@@ -112,8 +112,12 @@
for nsName in allRunningPods:
Namespace = nsName.get('NS')
podName = nsName.get('Name')
- os.system('/usr/bin/kubectl logs -n %s -f %s > %s/%s.log 2>&1 &' %
- (Namespace, podName, testCaseUtils.getDir(self, 'log'), podName))
+ if 'onos' not in podName:
+ os.system('/usr/bin/kubectl logs -n %s -f %s > %s/%s.log 2>&1 &' %
+ (Namespace, podName, testCaseUtils.getDir(self, 'log'), podName))
+ else:
+ os.system('/usr/bin/kubectl logs -n %s -f %s onos > %s/%s.log 2>&1 &' %
+ (Namespace, podName, testCaseUtils.getDir(self, 'log'), podName))
def voltha_Initialize(rootDir, volthaDir, logDir):
diff --git a/tests/atests/robot/voltha_automated_test_suite.robot b/tests/atests/robot/voltha_automated_test_suite.robot
index 60115eb..d720321 100755
--- a/tests/atests/robot/voltha_automated_test_suite.robot
+++ b/tests/atests/robot/voltha_automated_test_suite.robot
@@ -103,7 +103,6 @@
Stop Voltha
Start All Pods
Sleep 60
- Collect Pod Logs
${pod_status} Run kubectl get pods --all-namespaces
Log To Console \n ${pod_status}
Alter Onos NetCfg
@@ -111,5 +110,6 @@
Stop Voltha
[Documentation] Stop Voltha infrastucture. This includes clearing all installation milestones
... files and stopping all Kubernetes pods
+ Collect Pod Logs
Stop All Pods
Reset Kube Adm