[VOL-3717] Allowing to pass the olt type via pod-configs yaml file

Change-Id: Ic3873d05d15b40bbbac02eb1d221644a7aaa4c56
diff --git a/tests/functional/K8S_SystemTest.robot b/tests/functional/K8S_SystemTest.robot
index 13c55bc..13023ef 100644
--- a/tests/functional/K8S_SystemTest.robot
+++ b/tests/functional/K8S_SystemTest.robot
@@ -36,7 +36,7 @@
 ${common_pod_label_key}    app
 ${rwcore_pod_label_value}    rw-core
 ${ofagent_pod_label_value}    ofagent
-${adapter_openolt_pod_label_value}    adapter-open-olt
+${adapter_openolt_pod_label_value}    ${OLT_ADAPTER_APP_LABEL}
 ${teardown_device}      false
 ${has_dataplane}        false
 
diff --git a/tests/functional/Voltha_ErrorScenarios.robot b/tests/functional/Voltha_ErrorScenarios.robot
index 458a89d..c5840f5 100644
--- a/tests/functional/Voltha_ErrorScenarios.robot
+++ b/tests/functional/Voltha_ErrorScenarios.robot
@@ -77,7 +77,9 @@
         #${olt_device_id}=    Get OLTDeviceID From OLT List    ${olt_serial_number}
         Run Keyword If    ${has_dataplane}    Wait Until Keyword Succeeds    120s    10s
         ...    Check Remote System Reachability    True    ${olt_ssh_ip}
-        ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
+        ${olt_device_id}=    Run Keyword If    "${list_olts}[${I}][type]" == "${None}"
+        ...    Create Device    ${olt_ip}    ${OLT_PORT}
+        ...    ELSE    Create Device    ${olt_ip}    ${OLT_PORT}    ${list_olts}[${I}][type]
         Set Suite Variable    ${olt_device_id}
         Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED    UNKNOWN    UNKNOWN
         ...    ${olt_device_id}
@@ -195,7 +197,9 @@
         ${olt_serial_number}=    Get From Dictionary    ${list_olts}[${I}]    sn
         #${olt_device_id}=    Get OLTDeviceID From OLT List    ${olt_serial_number}
         #create/preprovision device
-        ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
+        ${olt_device_id}=    Run Keyword If    "${list_olts}[${I}][type]" == "${None}"
+        ...    Create Device    ${olt_ip}    ${OLT_PORT}
+        ...    ELSE    Create Device    ${olt_ip}    ${OLT_PORT}    ${list_olts}[${I}][type]
         Set Suite Variable    ${olt_device_id}
         #validate olt states
         Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED    UNKNOWN
@@ -240,7 +244,9 @@
         ${olt_serial_number}=    Get From Dictionary    ${list_olts}[${I}]    sn
         #${olt_device_id}=    Get OLTDeviceID From OLT List    ${olt_serial_number}
         #create/preprovision OLT device
-        ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
+        ${olt_device_id}=    Run Keyword If    "${list_olts}[${I}][type]" == "${None}"
+        ...    Create Device    ${olt_ip}    ${OLT_PORT}
+        ...    ELSE    Create Device    ${olt_ip}    ${OLT_PORT}    ${list_olts}[${I}][type]
         Set Suite Variable    ${olt_device_id}
         #validate olt states
         Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED    UNKNOWN
@@ -288,7 +294,9 @@
         Should Be Empty    ${logical_id}
         Run Keyword If    ${has_dataplane}    Sleep    180s
         ...    ELSE   Sleep    10s
-        ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
+        ${olt_device_id}=    Run Keyword If    "${list_olts}[${I}][type]" == "${None}"
+        ...    Create Device    ${olt_ip}    ${OLT_PORT}
+        ...    ELSE    Create Device    ${olt_ip}    ${OLT_PORT}    ${list_olts}[${I}][type]
         Set Suite Variable    ${olt_device_id}
         Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED    UNKNOWN
         ...    UNKNOWN    ${olt_device_id}
diff --git a/tests/functional/Voltha_FailureScenarios.robot b/tests/functional/Voltha_FailureScenarios.robot
index cbebeff..9889db8 100644
--- a/tests/functional/Voltha_FailureScenarios.robot
+++ b/tests/functional/Voltha_FailureScenarios.robot
@@ -203,7 +203,7 @@
     ${podStatusOutput}=    Run    kubectl get pods -n ${NAMESPACE}
     Log    ${podStatusOutput}
     ${countBforRestart}=    Run    kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
-    ${podName}    Set Variable     adapter-open-olt
+    ${podName}    Set Variable     ${OLT_ADAPTER_APP_LABEL}
     Wait Until Keyword Succeeds    ${timeout}    15s    Delete K8s Pods By Label    ${NAMESPACE}    app    ${podName}
     Sleep    5s
     Wait Until Keyword Succeeds    ${timeout}    2s    Validate Pods Status By Label    ${NAMESPACE}
@@ -302,12 +302,13 @@
         ...    ${ONOS_SSH_PORT}     ${onu_port}
     END
     # Scale down the open OLT adapter deployment to 0 PODs and once confirmed, scale it back to 1
-    Scale K8s Deployment    voltha    open-olt-voltha-adapter-openolt    0
-    Wait Until Keyword Succeeds    ${timeout}    2s    Pod Does Not Exist    voltha    open-olt-voltha-adapter-openolt
+    Scale K8s Deployment by Pod Label    ${NAMESPACE}    app    ${OLT_ADAPTER_APP_LABEL}    0
+    Wait Until Keyword Succeeds    ${timeout}    2s    Pods Do Not Exist By Label    ${NAMESPACE}    app
+    ...    ${OLT_ADAPTER_APP_LABEL}
     # Scale up the open OLT adapter deployment and make sure both it and the ofagent deployment are back
-    Scale K8s Deployment    voltha   open-olt-voltha-adapter-openolt    1
+    Scale K8s Deployment by Pod Label    ${NAMESPACE}    app    ${OLT_ADAPTER_APP_LABEL}    1
     Wait Until Keyword Succeeds    ${timeout}    2s
-    ...    Check Expected Available Deployment Replicas    voltha    open-olt-voltha-adapter-openolt    1
+    ...    Check Expected Available Deployment Replicas By Pod Label     ${NAMESPACE}    app    ${OLT_ADAPTER_APP_LABEL}    1
 
     # Ensure the device is available in ONOS, this represents system connectivity being restored
     FOR   ${I}    IN RANGE    0    ${olt_count}
diff --git a/tests/functional/Voltha_PODTests.robot b/tests/functional/Voltha_PODTests.robot
index 1fb30f8..36ad29d 100644
--- a/tests/functional/Voltha_PODTests.robot
+++ b/tests/functional/Voltha_PODTests.robot
@@ -384,7 +384,10 @@
     ...    Verify Device Flows Removed    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}
     # Recreate the OLT
     Run Keyword If    ${has_dataplane}    Sleep    180s
-    ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
+    # This dneeds to be done in for loop, test is not ready
+    ${olt_device_id}=    Run Keyword If    "${list_olts}[${I}][type]" == "${None}"
+    ...    Create Device    ${list_olts}[${I}][ip]    ${OLT_PORT}
+    ...    ELSE    Create Device    ${list_olts}[${I}][ip]    ${OLT_PORT}    ${list_olts}[${I}][type]
     Set Suite Variable    ${olt_device_id}
     Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED
     ...    UNKNOWN    UNKNOWN    ${olt_device_id}
diff --git a/tests/functional/Voltha_StartContainerPODTests.robot b/tests/functional/Voltha_StartContainerPODTests.robot
index e4b429c..fd6e0c4 100755
--- a/tests/functional/Voltha_StartContainerPODTests.robot
+++ b/tests/functional/Voltha_StartContainerPODTests.robot
@@ -104,7 +104,7 @@
     ${list_sim_names}   Create List    sim-voltha-adapter-simulated-olt    sim-voltha-adapter-simulated-onu
     ${sim}    CreateDictionary    helmchart=sim    namespace=voltha
     ...    apps=${list_sim_apps}    names=${list_sim_names}
-    ${list_openolt_apps}   Create List    adapter-open-olt
+    ${list_openolt_apps}   Create List    ${OLT_ADAPTER_APP_LABEL}
     ${list_openolt_names}   Create List    open-olt-voltha-adapter-openolt
     ${open-olt}    CreateDictionary    helmchart=open-olt    namespace=voltha
     ...    apps=${list_openolt_apps}    names=${list_openolt_names}
diff --git a/tests/functional/Voltha_multipleOLTTests.robot b/tests/functional/Voltha_multipleOLTTests.robot
index 831afc1..ed59324 100755
--- a/tests/functional/Voltha_multipleOLTTests.robot
+++ b/tests/functional/Voltha_multipleOLTTests.robot
@@ -112,7 +112,7 @@
     Set Suite Variable    ${k8s_node_ip}
     Set Suite Variable    ${k8s_node_user}
     Set Suite Variable    ${k8s_node_pass}
-    @{container_list}=    Create List    adapter-open-olt    adapter-open-onu    voltha-api-server
+    @{container_list}=    Create List    ${OLT_ADAPTER_APP_LABEL}    adapter-open-onu    voltha-api-server
     ...    voltha-ro-core    voltha-rw-core-11    voltha-rw-core-12    voltha-ofagent
     Set Suite Variable    ${container_list}
     ${datetime}=    Get Current Date
@@ -131,7 +131,9 @@
     Should Not Be Equal As Integers    ${num_bbsims}    0
     Run Keyword Unless    ${has_dataplane}    Set Suite Variable    ${num_olts}    ${num_bbsims}
     FOR    ${I}    IN RANGE    0    ${num_olts}
-        ${olt_device_id}=    Create Device    ${list_olts}[${I}][ip]    ${OLT_PORT}
+        ${olt_device_id}=    Run Keyword If    "${list_olts}[${I}][type]" == "${None}"
+        ...    Create Device    ${list_olts}[${I}][ip]    ${OLT_PORT}
+        ...    ELSE    Create Device    ${list_olts}[${I}][ip]    ${OLT_PORT}    ${list_olts}[${I}][type]
         Set Suite Variable    ${olt_device_id}
         #validate olt states
         Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED    UNKNOWN    UNKNOWN