removing all hardcoded references to the namespace
Change-Id: I9b5ddc065be62b3ad2a5a4757a88001faca61146
diff --git a/libraries/k8s.robot b/libraries/k8s.robot
index f9ce0f3..876a5f6 100755
--- a/libraries/k8s.robot
+++ b/libraries/k8s.robot
@@ -183,14 +183,14 @@
Should Not Be Equal ${pods_status} ${EMPTY} Can't filter out Pods with exptected status ${expectedStatus}
Verify All Voltha Pods For Any Error Logs
- [Arguments] ${datetime}
+ [Arguments] ${datetime} ${namespace}
[Documentation] This keyword checks for the error occurence in the voltha pods
&{errorPodDict} Create Dictionary
&{containerDict} Get Container Dictionary voltha
FOR ${podName} IN @{PODLIST1}
${containerName} Get From Dictionary ${containerDict} ${podName}
${rc} ${logOutput} Run And Return Rc And Output
- ... kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
+ ... kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${containerName}
Run Keyword And Ignore Error
... Run Keyword If '${logOutput}'=='${EMPTY}'
... Run Keywords Log No Log found in pod ${podName}
@@ -210,7 +210,7 @@
FOR ${podName} IN @{PODLIST2}
${containerName} Get From Dictionary ${containerDict} ${podName}
${rc} ${logOutput} Run And Return Rc And Output
- ... kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
+ ... kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${containerName}
Run Keyword And Ignore Error
... Run Keyword If '${logOutput}'=='${EMPTY}'
... Run Keywords Log No Log found in pod ${podName}
@@ -283,19 +283,20 @@
[Return] ${containerDict}
Validate Error For Given Pods
- [Arguments] ${datetime} ${podDict}
+ [Arguments] ${datetime} ${podDict} ${namespace}
[Documentation]
... This keyword is used to get the list of pods if there is any unexpected error
... in a particular pod(s) given the time-${datetime} from which the log needs to
... be analysed and the dictionary of pods and the error in the dictionary format
... ${podDict] .
...
- ... Usage: ${returnStatusFlag} Validate Error For Given Pods ${datetime} ${podDict}
+ ... Usage: ${returnStatusFlag} Validate Error For Given Pods ${datetime} ${podDict} ${namespace}
...
... Arguments:
...
... ${datetime} = time from which the log needs to be taken
... ${podDict} = Key-value pair of the pod name and the error msg
+ ... ${namespace} = the namespace into which look for pods
...
... Example: ${podDict} = Set Dictionary ${podDict} radius sample error message.
...
@@ -306,7 +307,7 @@
${containerName} Get From Dictionary ${containerDict} ${podName}
${expectedError} Get From Dictionary ${podDict} ${podName}
${rc} ${logOutput} Run And Return Rc And Output
- ... kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
+ ... kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${containerName}
Run Keyword And Ignore Error
... Run Keyword If '${logOutput}'=='${EMPTY}'
... Run Keywords Log No Log found in pod ${podName}
diff --git a/libraries/onu_utilities.robot b/libraries/onu_utilities.robot
index fb0e92a..70476a9 100755
--- a/libraries/onu_utilities.robot
+++ b/libraries/onu_utilities.robot
@@ -164,7 +164,7 @@
[Documentation] This keyword kills the passed adaptor.
[Arguments] ${namespace} ${name}
${cmd} Catenate
- ... kubectl exec -it -n voltha $(kubectl get pods -n ${namespace} | grep ${name} | awk 'NR==1{print $1}')
+ ... kubectl exec -it -n ${namespace} $(kubectl get pods -n ${namespace} | grep ${name} | awk 'NR==1{print $1}')
... -- /bin/sh -c "kill 1"
${rc} ${output}= Run and Return Rc and Output ${cmd}
Log ${output}
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 115957a..710fd56 100755
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -1120,7 +1120,7 @@
[Arguments] ${label}
[Documentation] Start logging for test ${label}
${kail_process}= Run Keyword If "${container_log_dir}" != "${None}" Start Process kail -n ${NAMESPACE}
- ... -n ${INFRA_NAMESPACE} cwd=${container_log_dir} stdout=${label}-combined.log
+ ... -n ${INFRA_NAMESPACE} cwd=${container_log_dir} stdout=${label}-combined.log
Set Test Variable ${kail_process}
Run Keyword If ${has_dataplane} Echo Message to OLT Logs START ${label}