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}
 
diff --git a/tests/functional/Voltha_StartContainerPODTests.robot b/tests/functional/Voltha_StartContainerPODTests.robot
index ce1bef1..3606378 100755
--- a/tests/functional/Voltha_StartContainerPODTests.robot
+++ b/tests/functional/Voltha_StartContainerPODTests.robot
@@ -265,7 +265,7 @@
     ...    --set services.kafka.cluster.service=kafka.default.svc --set services.kafka.cluster.port=9092
     ...    --set services.kafka.adapter.address=kafka.default.svc:9092
     ...    --set services.kafka.cluster.address=kafka.default.svc:9092 --set defaults.log_level=WARN
-    ...    --namespace voltha sim onf/voltha-adapter-simulated
+    ...    --namespace ${NAMESPACE} sim onf/voltha-adapter-simulated
     ${rc}    Run And Return Rc    ${cmd}
     Should Be Equal as Integers    ${rc}    0
 
@@ -279,7 +279,7 @@
     ...    --set services.kafka.cluster.service=kafka.default.svc --set services.kafka.cluster.port=9092
     ...    --set services.kafka.cluster.address=kafka.default.svc:9092
     ...    --set services.kafka.adapter.address=kafka.default.svc:9092 --set defaults.log_level=WARN
-    ...    --namespace voltha open-olt onf/voltha-adapter-openolt
+    ...    --namespace ${NAMESPACE} open-olt onf/voltha-adapter-openolt
     ${rc}    Run And Return Rc    ${cmd}
     Should Be Equal as Integers    ${rc}    0
 
@@ -293,7 +293,7 @@
     ...    --set services.kafka.cluster.service=kafka.default.svc --set services.kafka.cluster.port=9092
     ...    --set services.kafka.adapter.address=kafka.default.svc:9092
     ...    --set services.kafka.cluster.address=kafka.default.svc:9092 --set replicas.adapter_open_onu=1
-    ...    --set defaults.log_level=WARN --namespace voltha open-onu onf/voltha-adapter-openonu
+    ...    --set defaults.log_level=WARN --namespace ${NAMESPACE} open-onu onf/voltha-adapter-openonu
     ${rc}    Run And Return Rc    ${cmd}
     Should Be Equal as Integers    ${rc}    0
 
@@ -310,7 +310,7 @@
     ...    --set 'services.controller[0].service=onos-onos-classic-0.onos-onos-classic-hs.default.svc'
     ...    --set 'services.controller[0].port=6653'
     ...    --set 'services.controller[0].address=onos-onos-classic-0.onos-onos-classic-hs.default.svc:6653'
-    ...    --set defaults.log_level=WARN --namespace voltha voltha onf/voltha
+    ...    --set defaults.log_level=WARN --namespace ${NAMESPACE} voltha onf/voltha
     ${rc}    Run And Return Rc    ${cmd}
     Should Be Equal as Integers    ${rc}    0
 
diff --git a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
index 5a22947..18c6b88 100755
--- a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
@@ -242,7 +242,7 @@
     Run Keyword If    ${pausebeforecleanup}    Log    Teardown will be continued...    console=yes
     Run Keyword If    ${teardown_device}    Delete All Devices and Verify
     # delete etcd MIB Template Data
-    Delete MIB Template Data
+    Delete MIB Template Data    ${INFRA_NAMESPACE}
     # check etcd data are empty
     Run Keyword If    ${etcdcheckintestteardown}    Wait Until Keyword Succeeds    ${timeout}    1s
     ...    Validate Onu Data In Etcd    ${INFRA_NAMESPACE}    0    ${kvstoreprefix}    without_pm_data=False
diff --git a/tests/pm-data/Voltha_ONUPMTests.robot b/tests/pm-data/Voltha_ONUPMTests.robot
index b3d3151..d69233a 100755
--- a/tests/pm-data/Voltha_ONUPMTests.robot
+++ b/tests/pm-data/Voltha_ONUPMTests.robot
@@ -187,7 +187,7 @@
     Run Keyword If  "${switch_type}"!=""    Set Global Variable    ${powerswitch_type}    ${switch_type}
     # set ${kafka} depending on environment in case of port-forward is needed
     ${rc}    ${kafka}=    Run Keyword If    ${PORT_FORWARDING}    Run and Return Rc and Output
-    ...    kubectl get svc -n default | grep kafka-0-external | awk '{print $1}'
+    ...    kubectl get svc -n ${INFRA_NAMESPACE} | grep kafka-0-external | awk '{print $1}'
     Run Keyword If    ${PORT_FORWARDING}    Should Not Be Empty    ${kafka}    Service kafka-0-external not found
     # start port forwarding if needed (when voltha runs in k8s)
     ${portFwdHandle} =    Run Keyword If    ${PORT_FORWARDING}    Start Process