VOL-1821: Voltha 2.0 Functional Test Case: OLT Provisioning and Enabling (BBSIM)
VOL-1822: Voltha 2.0 Functional Test Case: ONU Discovery (BBSIM)

First two Functional Test Cases to run in its own Kind Voltha framework
in a new Jenkins Job to be run at given periods during the day (nightly?)
This uses BBSIM with 16 ONUs and is intented to perform more indept testing
than what the sanity tests does
Added config and sadis files to handle 8 pon, 2 onus or single pon, 16 onus

Change-Id: I4a02bbffacb24b76f2166366b47437120b91ce67
diff --git a/libraries/utils.robot b/libraries/utils.robot
index db67643..4546d72 100644
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -33,3 +33,13 @@
     ${kubectl_rc}=    Run And Return RC    ${KUBECTL_CONFIG}; kubectl get pods
     Run Keyword If    ${voltctl_rc} != 0 or ${kubectl_rc} != 0    FATAL ERROR
     ...    VOLTCTL and KUBECTL not configured. Please configure before executing tests.
+
+Send File To Onos
+    [Documentation]  Send the content of the file to Onos to selected section of configuration using Post Request
+    [Arguments]  ${CONFIG_FILE}  ${section}
+    ${Headers}=  Create Dictionary  Content-Type   application/json
+    ${File_Data}=   Get Binary File   ${CONFIG_FILE}
+    Log     ${Headers}
+    Log     ${File_Data}
+    ${resp}=   Post Request  ONOS  /onos/v1/network/configuration/${section}  headers=${Headers}   data=${File_Data}
+    Should Be Equal As Strings    ${resp.status_code}  200
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 5600f06..1dc4f53 100644
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -26,6 +26,15 @@
 Library           OperatingSystem
 
 *** Keywords ***
+Test Empty Device List
+    [Documentation]   Verify that there are no devices in the system
+    ${rc}  ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device list -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    [Return]  ${length}
+
 Create Device
     [Arguments]    ${ip}    ${port}
     [Documentation]    Creates a device in VOLTHA
@@ -69,11 +78,12 @@
     Should Be Equal As Integers    ${rc2}    0
 
 Validate Device
-    [Arguments]    ${serial_number}    ${admin_state}    ${oper_status}    ${connect_status}    ${onu_reasons}=${EMPTY}
-    ...    ${onu}=False
-    [Documentation]    Parses the output of "voltctl device list" and inspects device ${serial_number}
+    [Arguments]    ${admin_state}  ${oper_status}  ${connect_status}  ${serial_number}=${EMPTY}  ${device_id}=${EMPTY}
+    ...    ${onu_reason}=${EMPTY}   ${onu}=False
+    [Documentation]    Parses the output of "voltctl device list" and inspects device ${serial_number} and ${device_id}
     ...    Arguments are matched for device states of: "admin_state", "oper_status", and "connect_status"
-    ${output}=    Run    ${VOLTCTL_CONFIG}; voltctl device list -o json
+    ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device list -o json
+    Should Be Equal As Integers    ${rc}    0
     ${jsondata}=    To Json    ${output}
     Log    ${jsondata}
     ${length}=    Get Length    ${jsondata}
@@ -83,15 +93,210 @@
         ${opstatus}=    Get From Dictionary    ${value}    operstatus
         ${cstatus}=    Get From Dictionary    ${value}    connectstatus
         ${sn}=    Get From Dictionary    ${value}    serialnumber
+        ${devId}=    Get From Dictionary    ${value}    id
         ${mib_state}=    Get From Dictionary    ${value}    reason
-        Run Keyword If    '${sn}' == '${serial_number}'    Exit For Loop
+        Run Keyword If    '${sn}' == '${serial_number}' or '${devId}' == '${device_id}'    Exit For Loop
     END
-    Should Be Equal    ${astate}    ${admin_state}    Device ${serial_number} admin_state != ENABLED    values=False
-    Should Be Equal    ${opstatus}    ${oper_status}    Device ${serial_number} oper_status != ACTIVE    values=False
-    Should Be Equal    ${cstatus}    ${connect_status}    Device ${serial_number} connect_status != REACHABLE
+    Should Be Equal    '${astate}'    '${admin_state}'    Device ${serial_number} admin_state != ${admin_state}
     ...    values=False
-    Run Keyword If    '${onu}' == 'True'    Should Contain    ${onu_reasons}    ${mib_state}
-    ...    Device ${serial_number} mib_state incorrect    values=False
+    Should Be Equal    '${opstatus}'   '${oper_status}'    Device ${serial_number} oper_status != ${oper_status}
+    ...    values=False
+    Should Be Equal    '${cstatus}'    '${connect_status}'    Device ${serial_number} conn_status != ${connect_status}
+    ...    values=False
+    Run Keyword If    '${onu}' == 'True'    Should Be Equal    '${mib_state}'    '${onu_reason}'
+    ...  Device ${serial_number} mib_state incorrect (${mib_state}) values=False
+
+Validate OLT Device
+    [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}   ${serial_number}=${EMPTY}
+    ...    ${device_id}=${EMPTY}
+    [Documentation]    Parses the output of "voltctl device list" and inspects device ${serial_number} and/or
+    ...    ${device_id}   Match on OLT Serial number or Device Id and inspect states
+    Validate Device  ${admin_state}    ${oper_status}    ${connect_status}   ${serial_number}   ${device_id}
+
+Validate ONU Devices
+    [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}    ${List_ONU_Serial}
+    [Documentation]    Parses the output of "voltctl device list" and inspects device  ${List_ONU_Serial}
+    ...    Iteratively match on each Serial number contained in ${List_ONU_Serial} and inspect
+    ...    states including MIB state
+    FOR   ${serial_number}  IN  @{List_ONU_Serial}
+        Validate Device    ${admin_state}    ${oper_status}    ${connect_status}    ${serial_number}
+    ...    onu_reason=omci-flows-pushed    onu=True
+    END
+
+Validate Device Port Types
+    [Arguments]    ${device_id}    ${pon_type}    ${ethernet_type}
+    [Documentation]    Parses the output of voltctl device ports <device_id> and matches the port types listed
+    ${rc}  ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device ports ${device_id} -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${jsondata}    ${INDEX}
+        ${astate}=    Get From Dictionary    ${value}    adminstate
+        ${opstatus}=    Get From Dictionary    ${value}    operstatus
+        ${type}=    Get From Dictionary    ${value}    type
+        Should Be Equal    '${astate}'    'ENABLED'    Device ${device_id} port admin_state != ENABLED    values=False
+        Should Be Equal    '${opstatus}'    'ACTIVE'    Device ${device_id} port oper_status != ACTIVE    values=False
+        Should Be True    '${type}' == '${pon_type}' or '${type}' == '${ethernet_type}'
+    ...     Device ${device_id} port type is neither ${pon_type} or ${ethernet_type}
+    END
+
+Validate OLT Port Types
+    [Documentation]  Parses the output of voltctl device ports ${olt_device_id} and matches the port types listed
+    [Arguments]     ${pon_type}     ${ethernet_type}
+    Validate Device Port Types   ${olt_device_id}    ${pon_type}     ${ethernet_type}
+
+Validate ONU Port Types
+    [Arguments]     ${List_ONU_Serial}  ${pon_type}     ${ethernet_type}
+    [Documentation]  Parses the output of voltctl device ports for each ONU SN listed in ${List_ONU_Serial}
+    ...     and matches the port types listed
+    FOR    ${serial_number}    IN    @{List_ONU_Serial}
+        ${onu_dev_id}=    Get Device ID From SN    ${serial_number}
+        Validate Device Port Types    ${onu_dev_id}    ${pon_type}     ${ethernet_type}
+    END
+
+Validate Device Flows
+    [Arguments]    ${device_id}    ${test}=${EMPTY}
+    [Documentation]    Parses the output of voltctl device flows <device_id> and expects flow count > 0
+    ${rc}  ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device flows ${device_id} -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    Log    'Number of flows = ' ${length}
+    Run Keyword If    '${test}' == '${EMPTY}'    Should Be True    ${length} > 0
+    ...    Number of flows for ${device_id} was 0
+    ...    ELSE    Should Be True  ${length} == ${test}
+    ...    Number of flows for ${device_id} was not ${test}
+
+Validate OLT Flows
+    [Documentation]    Parses the output of voltctl device flows ${olt_device_id} and expects flow count > 0
+    Validate Device Flows    ${olt_device_id}
+
+Validate ONU Flows
+    [Arguments]    ${List_ONU_Serial}    ${test}
+    [Documentation]    Parses the output of voltctl device flows for each ONU SN listed in ${List_ONU_Serial}
+    ...    and expects flow count == 0
+    FOR     ${serial_number}    IN    @{List_ONU_Serial}
+        ${onu_dev_id}=    Get Device ID From SN    ${serial_number}
+        Validate Device Flows    ${onu_dev_id}    ${test}
+    END
+
+Validate Logical Device
+    [Documentation]    Validate Logical Device is listed
+    ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl logicaldevice list -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${jsondata}    ${INDEX}
+        ${devid}=    Get From Dictionary    ${value}    id
+        ${rootdev}=    Get From Dictionary    ${value}    rootdeviceid
+        ${sn}=    Get From Dictionary    ${value}    serialnumber
+        Exit For Loop
+    END
+    Should Be Equal    '${rootdev}'    '${olt_device_id}'    Root Device does not match ${olt_device_id}    values=False
+    Should Be Equal    '${sn}'    '${BBSIM_OLT_SN}'    Logical Device ${sn} does not match ${BBSIM_OLT_SN}
+    ...    values=False
+    [Return]  ${devid}
+
+Validate Logical Device Ports
+    [Arguments]    ${logical_device_id}
+    [Documentation]    Validate Logical Device Ports are listed and are > 0
+    ${rc}    ${output}=    Run and Return Rc and Output
+    ...    ${VOLTCTL_CONFIG}; voltctl logicaldevice ports ${logical_device_id} -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    Should Be True    ${length} > 0    Number of ports for ${logical_device_id} was 0
+
+Validate Logical Device Flows
+    [Arguments]    ${logical_device_id}
+    [Documentation]    Validate Logical Device Flows are listed and are > 0
+    ${rc}    ${output}=    Run and Return Rc and Output
+    ...    ${VOLTCTL_CONFIG}; voltctl logicaldevice flows ${logical_device_id} -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    Should Be True  ${length} > 0    Number of flows for ${logical_device_id} was 0
+
+Retrieve Peer List From OLT
+    [Arguments]     ${olt_peer_list}
+    [Documentation]    Retrieve the list of peer device id list from port list
+    ${rc}  ${output}=    Run and Return Rc and Output
+    ...    ${VOLTCTL_CONFIG}; voltctl device ports ${olt_device_id} -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${jsondata}    ${INDEX}
+        ${type}=    Get From Dictionary    ${value}    type
+        ${peers}=    Get From Dictionary    ${value}    peers
+        Run Keyword If    '${type}' == 'PON_OLT'    Exit For Loop
+    END
+    ${length}=    Get Length    ${peers}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${peers}    ${INDEX}
+        ${peer_id}=    Get From Dictionary    ${value}    deviceid
+        Append To List    ${olt_peer_list}    ${peer_id}
+    END
+
+Validate OLT Peer Id List
+    [Arguments]    ${olt_peer_id_list}
+    [Documentation]    Match each entry in the ${olt_peer_id_list} against ONU device ids.
+    FOR    ${peer_id}    IN    @{olt_peer_id_list}
+        Match OLT Peer Id    ${peer_id}
+    END
+
+Match OLT Peer Id
+    [Arguments]    ${olt_peer_id}
+    [Documentation]    Lookup the OLT Peer Id in against the list of ONU device Ids
+    ${rc}  ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device list -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    FOR     ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${jsondata}    ${INDEX}
+        ${devid}=    Get From Dictionary    ${value}    id
+        Run Keyword If    '${devid}' == '${olt_peer_id}'    Exit For Loop
+        Run Keyword If    '${INDEX}' == '${length}'    Fail    Peer id ${olt_peer_id} does not match any ONU device id;
+    END
+
+Validate ONU Peer Id
+    [Arguments]    ${olt_device_id}    ${List_ONU_Serial}
+    [Documentation]    Match each ONU peer to that of the OLT device id
+    FOR    ${onu_serial}    IN    @{List_ONU_Serial}
+        ${onu_dev_id}=    Get Device ID From SN    ${onu_serial}
+        Match ONU Peer Id    ${onu_dev_id}
+    END
+
+Match ONU Peer Id
+    [Arguments]    ${onu_dev_id}
+    [Documentation]    Match an ONU peer to that of the OLT device id
+    ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device ports ${onu_dev_id} -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${jsondata}    ${INDEX}
+        ${type}=    Get From Dictionary    ${value}    type
+        ${peers}=    Get From Dictionary    ${value}    peers
+        Run Keyword If    '${type}' == 'PON_ONU'    Exit For Loop
+    END
+    ${length}=    Get Length    ${peers}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${peers}    ${INDEX}
+        ${peer_id}=    Get From Dictionary    ${value}    deviceid
+    END
+    Should Be Equal    '${peer_id}'    '${olt_device_id}'
+    ...    Mismatch between ONU peer ${peer_id} and OLT device id ${olt_device_id}    values=False
 
 Get Device ID From SN
     [Arguments]    ${serial_number}
@@ -123,6 +328,29 @@
     END
     [Return]    ${id}
 
+Build ONU SN List
+    [Arguments]    ${serial_numbers}
+    [Documentation]    Appends all ONU SNs to the ${serial_numbers} list
+    FOR    ${INDEX}    IN RANGE    0    ${num_onus}
+        Append To List    ${serial_numbers}    ${hosts.src[${INDEX}].onu}
+    END
+
+Get SN From Device ID
+    [Arguments]    ${device_id}
+    [Documentation]    Gets the device id by matching for ${device_id}
+    ${rc}  ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device list -o json
+    Should Be Equal As Integers    ${rc}    0
+    ${jsondata}=    To Json    ${output}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata}
+    FOR    ${INDEX}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${jsondata}    ${INDEX}
+        ${id}=    Get From Dictionary    ${value}    id
+        ${sn}=    Get From Dictionary    ${value}    serialnumber
+        Run Keyword If    '${id}' == '${device_id}'    Exit For Loop
+    END
+    [Return]    ${sn}
+
 Validate Device Removed
     [Arguments]    ${id}
     [Documentation]    Verifys that device, ${serial_number}, has been removed
diff --git a/tests/data/bbsim-kind-16.yaml b/tests/data/bbsim-kind-16.yaml
new file mode 100644
index 0000000..67dfbf7
--- /dev/null
+++ b/tests/data/bbsim-kind-16.yaml
@@ -0,0 +1,75 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Automated deployment configuration for kind-voltha running BBSim
+
+# Change default values in tests
+has_dataplane: False
+external_libs: False
+teardown_device: True
+ONOS_REST_PORT: 8181
+ONOS_SSH_PORT: 8101
+OLT_PORT: 50060
+num_onu_flows: 4
+
+nodes:
+  -
+    ip: '127.0.0.1'
+
+olts:
+  -
+    ip: bbsim.voltha.svc
+    serial: BBSIM_OLT_0
+
+hosts:
+  src:
+    - onu: 'BBSM00000001'
+    - onu: 'BBSM00000002'
+    - onu: 'BBSM00000003'
+    - onu: 'BBSM00000004'
+    - onu: 'BBSM00000005'
+    - onu: 'BBSM00000006'
+    - onu: 'BBSM00000007'
+    - onu: 'BBSM00000008'
+    - onu: 'BBSM00000009'
+    - onu: 'BBSM0000000a'
+    - onu: 'BBSM0000000b'
+    - onu: 'BBSM0000000c'
+    - onu: 'BBSM0000000d'
+    - onu: 'BBSM0000000e'
+    - onu: 'BBSM0000000f'
+    - onu: 'BBSM00000010'
+
+  dst:
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+
+sadis:
+  file: ${CURDIR}/../tests/data/sadis-with-tp-16.json
\ No newline at end of file
diff --git a/tests/data/bbsim-kind-8x2.yaml b/tests/data/bbsim-kind-8x2.yaml
new file mode 100644
index 0000000..c9633a5
--- /dev/null
+++ b/tests/data/bbsim-kind-8x2.yaml
@@ -0,0 +1,75 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Automated deployment configuration for kind-voltha running BBSim
+
+# Change default values in tests
+has_dataplane: False
+external_libs: False
+teardown_device: True
+ONOS_REST_PORT: 8181
+ONOS_SSH_PORT: 8101
+OLT_PORT: 50060
+num_onu_flows: 4
+
+nodes:
+  -
+    ip: '127.0.0.1'
+
+olts:
+  -
+    ip: bbsim.voltha.svc
+    serial: BBSIM_OLT_0
+
+hosts:
+  src:
+    - onu: 'BBSM00000001'
+    - onu: 'BBSM00000002'
+    - onu: 'BBSM00000101'
+    - onu: 'BBSM00000102'
+    - onu: 'BBSM00000201'
+    - onu: 'BBSM00000202'
+    - onu: 'BBSM00000301'
+    - onu: 'BBSM00000302'
+    - onu: 'BBSM00000401'
+    - onu: 'BBSM00000402'
+    - onu: 'BBSM00000501'
+    - onu: 'BBSM00000502'
+    - onu: 'BBSM00000601'
+    - onu: 'BBSM00000602'
+    - onu: 'BBSM00000701'
+    - onu: 'BBSM00000702'
+
+  dst:
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+    - ip: null
+
+sadis:
+  file: ${CURDIR}/../tests/data/sadis-with-tp-8x2.json
\ No newline at end of file
diff --git a/tests/data/sadis-with-tp-16.json b/tests/data/sadis-with-tp-16.json
new file mode 100755
index 0000000..d667854
--- /dev/null
+++ b/tests/data/sadis-with-tp-16.json
@@ -0,0 +1,241 @@
+{
+   "org.opencord.sadis": {
+      "sadis": {
+         "integration": {
+            "cache": {
+               "enabled": false,
+               "maxsize": 50,
+               "ttl": "PT0m"
+            }
+         },
+         "entries": [
+            {
+               "id": "BBSIM_OLT_0",
+               "hardwareIdentifier": "00:00:0a:62:ce:e2",
+               "ipAddress": "192.168.1.252",
+               "nasId": "BBSIM_OLT_0",
+               "uplinkPort": 65536
+            },
+            {
+               "id": "BBSM00000001-1",
+               "cTag": 55,
+               "sTag": 66,
+               "nasPortId": "BBSM00000001-1",
+               "circuitId": "BBSM00000001-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000002-1",
+               "cTag": 56,
+               "sTag": 66,
+               "nasPortId": "BBSM00000002-1",
+               "circuitId": "BBSM00000002-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000003-1",
+               "cTag": 57,
+               "sTag": 66,
+               "nasPortId": "BBSM00000003-1",
+               "circuitId": "BBSM00000003-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000004-1",
+               "cTag": 58,
+               "sTag": 66,
+               "nasPortId": "BBSM00000004-1",
+               "circuitId": "BBSM00000004-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "User_Bandwidth1",
+               "downstreamBandwidthProfile": "User_Bandwidth1"
+            },
+            {
+               "id": "BBSM00000005-1",
+               "cTag": 60,
+               "sTag": 77,
+               "nasPortId": "BBSM00000005-1",
+               "circuitId": "BBSM00000005-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000006-1",
+               "cTag": 61,
+               "sTag": 77,
+               "nasPortId": "BBSM00000006-1",
+               "circuitId": "BBSM00000006-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000007-1",
+               "cTag": 62,
+               "sTag": 77,
+               "nasPortId": "BBSM00000007-1",
+               "circuitId": "BBSM00000007-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000008-1",
+               "cTag": 63,
+               "sTag": 77,
+               "nasPortId": "BBSM00000008-1",
+               "circuitId": "BBSM00000008-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000009-1",
+               "cTag": 70,
+               "sTag": 88,
+               "nasPortId": "BBSM00000009-1",
+               "circuitId": "BBSM00000009-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM0000000a-1",
+               "cTag": 71,
+               "sTag": 88,
+               "nasPortId": "BBSM0000000a-1",
+               "circuitId": "BBSM0000000a-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "User_Bandwidth2",
+               "downstreamBandwidthProfile": "User_Bandwidth2"
+            },
+            {
+               "id": "BBSM0000000b-1",
+               "cTag": 72,
+               "sTag": 88,
+               "nasPortId": "BBSM0000000b-1",
+               "circuitId": "BBSM0000000b-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM0000000c-1",
+               "cTag": 73,
+               "sTag": 88,
+               "nasPortId": "BBSM0000000c-1",
+               "circuitId": "BBSM0000000c-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM0000000d-1",
+               "cTag": 80,
+               "sTag": 99,
+               "nasPortId": "BBSM0000000d-1",
+               "circuitId": "BBSM0000000d-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM0000000e-1",
+               "cTag": 81,
+               "sTag": 99,
+               "nasPortId": "BBSM0000000e-1",
+               "circuitId": "BBSM0000000e-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM0000000f-1",
+               "cTag": 82,
+               "sTag": 99,
+               "nasPortId": "BBSM0000000f-1",
+               "circuitId": "BBSM0000000f-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000010-1",
+               "cTag": 83,
+               "sTag": 99,
+               "nasPortId": "BBSM00000010-1",
+               "circuitId": "BBSM00000010-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            }
+         ]
+      },
+      "bandwidthprofile": {
+         "integration": {
+            "cache": {
+               "enabled": true,
+               "maxsize": 40,
+               "ttl": "PT1m"
+            }
+         },
+         "entries": [
+            {
+               "id": "User_Bandwidth1",
+               "air": 100000,
+               "cbs": 10000,
+               "cir": 30000,
+               "ebs": 1000,
+               "eir": 20000
+            },
+            {
+               "id": "User_Bandwidth2",
+               "air": 100000,
+               "cbs": 5000,
+               "cir": 100000,
+               "ebs": 5000,
+               "eir": 100000
+            },
+            {
+               "id": "User_Bandwidth3",
+               "air": 100000,
+               "cbs": 5000,
+               "cir": 1000000,
+               "ebs": 5000,
+               "eir": 1000000
+            },
+            {
+               "id": "Default",
+               "air": 100000,
+               "cbs": 30,
+               "cir": 600,
+               "ebs": 30,
+               "eir": 400
+            }
+         ]
+      }
+   }
+}
diff --git a/tests/data/sadis-with-tp-8x2.json b/tests/data/sadis-with-tp-8x2.json
new file mode 100755
index 0000000..b28b53e
--- /dev/null
+++ b/tests/data/sadis-with-tp-8x2.json
@@ -0,0 +1,241 @@
+{
+   "org.opencord.sadis": {
+      "sadis": {
+         "integration": {
+            "cache": {
+               "enabled": false,
+               "maxsize": 50,
+               "ttl": "PT0m"
+            }
+         },
+         "entries": [
+            {
+               "id": "BBSIM_OLT_0",
+               "hardwareIdentifier": "00:00:0a:62:ce:e2",
+               "ipAddress": "192.168.1.252",
+               "nasId": "BBSIM_OLT_0",
+               "uplinkPort": 65536
+            },
+            {
+               "id": "BBSM00000001-1",
+               "cTag": 55,
+               "sTag": 66,
+               "nasPortId": "BBSM00000001-1",
+               "circuitId": "BBSM00000001-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000002-1",
+               "cTag": 56,
+               "sTag": 66,
+               "nasPortId": "BBSM00000002-1",
+               "circuitId": "BBSM00000002-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000101-1",
+               "cTag": 57,
+               "sTag": 66,
+               "nasPortId": "BBSM00000101-1",
+               "circuitId": "BBSM00000101-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000102-1",
+               "cTag": 58,
+               "sTag": 66,
+               "nasPortId": "BBSM00000102-1",
+               "circuitId": "BBSM00000102-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000201-1",
+               "cTag": 60,
+               "sTag": 77,
+               "nasPortId": "BBSM00000201-1",
+               "circuitId": "BBSM00000201-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000202-1",
+               "cTag": 61,
+               "sTag": 77,
+               "nasPortId": "BBSM00000202-1",
+               "circuitId": "BBSM00000202-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000301-1",
+               "cTag": 62,
+               "sTag": 77,
+               "nasPortId": "BBSM00000301-1",
+               "circuitId": "BBSM00000301-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "User_Bandwidth1",
+               "downstreamBandwidthProfile": "User_Bandwidth1"
+            },
+            {
+               "id": "BBSM00000302-1",
+               "cTag": 63,
+               "sTag": 77,
+               "nasPortId": "BBSM00000302-1",
+               "circuitId": "BBSM00000302-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000401-1",
+               "cTag": 70,
+               "sTag": 88,
+               "nasPortId": "BBSM00000401-1",
+               "circuitId": "BBSM00000401-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000402-1",
+               "cTag": 71,
+               "sTag": 88,
+               "nasPortId": "BBSM00000402-1",
+               "circuitId": "BBSM00000402-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000501-1",
+               "cTag": 72,
+               "sTag": 88,
+               "nasPortId": "BBSM00000501-1",
+               "circuitId": "BBSM00000501-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000502-1",
+               "cTag": 73,
+               "sTag": 88,
+               "nasPortId": "BBSM00000502-1",
+               "circuitId": "BBSM00000502-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000601-1",
+               "cTag": 80,
+               "sTag": 99,
+               "nasPortId": "BBSM00000601-1",
+               "circuitId": "BBSM00000601-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "User_Bandwidth2",
+               "downstreamBandwidthProfile": "User_Bandwidth2"
+            },
+            {
+               "id": "BBSM00000602-1",
+               "cTag": 81,
+               "sTag": 99,
+               "nasPortId": "BBSM00000602-1",
+               "circuitId": "BBSM00000602-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000701-1",
+               "cTag": 82,
+               "sTag": 99,
+               "nasPortId": "BBSM00000701-1",
+               "circuitId": "BBSM00000701-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            },
+            {
+               "id": "BBSM00000702-1",
+               "cTag": 83,
+               "sTag": 99,
+               "nasPortId": "BBSM00000702-1",
+               "circuitId": "BBSM00000702-1",
+               "remoteId" : "BBSIM_OLT_0",
+               "technologyProfileId": 64,
+               "upstreamBandwidthProfile": "Default",
+               "downstreamBandwidthProfile": "Default"
+            }
+         ]
+      },
+      "bandwidthprofile": {
+         "integration": {
+            "cache": {
+               "enabled": true,
+               "maxsize": 40,
+               "ttl": "PT1m"
+            }
+         },
+         "entries": [
+            {
+               "id": "User_Bandwidth1",
+               "air": 100000,
+               "cbs": 10000,
+               "cir": 30000,
+               "ebs": 1000,
+               "eir": 20000
+            },
+            {
+               "id": "User_Bandwidth2",
+               "air": 100000,
+               "cbs": 5000,
+               "cir": 100000,
+               "ebs": 5000,
+               "eir": 100000
+            },
+            {
+               "id": "User_Bandwidth3",
+               "air": 100000,
+               "cbs": 5000,
+               "cir": 1000000,
+               "ebs": 5000,
+               "eir": 1000000
+            },
+            {
+               "id": "Default",
+               "air": 100000,
+               "cbs": 30,
+               "cir": 600,
+               "ebs": 30,
+               "eir": 400
+            }
+         ]
+      }
+   }
+}
diff --git a/tests/functional/Voltha_PODTests.robot b/tests/functional/Voltha_PODTests.robot
index 70c08c8..37d2690 100644
--- a/tests/functional/Voltha_PODTests.robot
+++ b/tests/functional/Voltha_PODTests.robot
@@ -60,9 +60,8 @@
         ${src}=    Set Variable    ${hosts.src[${I}]}
         ${dst}=    Set Variable    ${hosts.dst[${I}]}
 
-        ${onu_reasons}=    Create List     tech-profile-config-download-success    omci-flows-pushed
-        Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device    ${src['onu']}    ENABLED    ACTIVE
-        ...    REACHABLE    onu=True    onu_reasons=${onu_reasons}
+        Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device        ENABLED    ACTIVE    REACHABLE
+        ...    ${src['onu']}    onu=True    onu_reason=omci-flows-pushed
 
         ${onu_device_id}=    Get Device ID From SN    ${src['onu']}
         ${onu_port}=    Wait Until Keyword Succeeds    ${timeout}    2s    Get ONU Port in ONOS    ${src['onu']}
@@ -109,7 +108,6 @@
     ${onos_auth}=    Create List    karaf    karaf
     ${HEADERS}    Create Dictionary    Content-Type=application/json
     Create Session    ONOS    http://${k8s_node_ip}:${ONOS_REST_PORT}    auth=${ONOS_AUTH}
-    Set Global Variable    ${export_kubeconfig}    export KUBECONFIG=${KUBERNETES_CONF}
     ${olt_ip}=    Evaluate    ${olts}[0].get("ip")
     ${olt_user}=    Evaluate    ${olts}[0].get("user")
     ${olt_pass}=    Evaluate    ${olts}[0].get("pass")
@@ -130,15 +128,20 @@
     ${datetime}=    Get Current Date
     Set Suite Variable    ${datetime}
 
-
 Setup
     [Documentation]    Pre-test Setup
+    #test for empty device list
+    ${length}=    Test Empty Device List
+    Should Be Equal As Integers  ${length}     0
     #create/preprovision device
     ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
     Set Suite Variable    ${olt_device_id}
+    #validate olt states
+    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    PREPROVISIONED    UNKNOWN    UNKNOWN
+    ...    ${EMPTY}    ${olt_device_id}
     Enable Device    ${olt_device_id}
-    Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device    ${olt_serial_number}    ENABLED    ACTIVE
-    ...    REACHABLE
+    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    ENABLED    ACTIVE    REACHABLE
+    ...    ${olt_serial_number}
     ${logical_id}=    Get Logical Device ID From SN    ${olt_serial_number}
     Set Suite Variable    ${logical_id}
 
@@ -153,9 +156,12 @@
 Teardown Suite
     [Documentation]    Clean up device if desired
     Run Keyword If    ${teardown_device}    Delete Device and Verify
+    ${length}=    Run Keyword If    ${teardown_device}    Run Keyword And Return    Test Empty Device List
+    Run Keyword If    ${teardown_device}    Should Be Equal As Integers    ${length}    0
     Run Keyword If    ${teardown_device}    Execute ONOS CLI Command    ${k8s_node_ip}    ${ONOS_SSH_PORT}
     ...    device-remove ${of_id}
 
+
 Clean Up Linux
     [Documentation]    Kill processes and clean up interfaces on src+dst servers
     FOR    ${I}    IN RANGE    0    ${num_onus}
@@ -179,8 +185,8 @@
     [Documentation]    Disable -> Delete devices via voltctl and verify its removed
     ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
     Should Be Equal As Integers    ${rc}    0
-    Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device    ${olt_serial_number}    DISABLED    UNKNOWN
-    ...    REACHABLE
+    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    DISABLED    UNKNOWN    REACHABLE
+    ...    ${olt_serial_number}
     ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
     Should Be Equal As Integers    ${rc}    0
     Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device Removed    ${olt_device_id}
diff --git a/tests/functional/Voltha_ScaleFunctionalTests.robot b/tests/functional/Voltha_ScaleFunctionalTests.robot
new file mode 100644
index 0000000..40ff6bf
--- /dev/null
+++ b/tests/functional/Voltha_ScaleFunctionalTests.robot
@@ -0,0 +1,198 @@
+#Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation    Test suite that engages a larger number of ONU at the same which makes it a more realistic test
+...    It is addaptable to either BBSim or Real H/W using a configuration file
+Suite Setup       Setup Suite
+Suite Teardown    Teardown Suite
+Library           Collections
+Library           String
+Library           OperatingSystem
+Library           XML
+Library           RequestsLibrary
+Library           ../../libraries/DependencyLibrary.py
+Resource          ../../libraries/onos.robot
+Resource          ../../libraries/voltctl.robot
+Resource          ../../libraries/utils.robot
+Resource          ../../libraries/k8s.robot
+Resource          ../../variables/variables.robot
+
+*** Variables ***
+${timeout}         60s
+${long_timeout}    420
+${of_id}           0
+${logical_id}      0
+${has_dataplane}    True
+${external_libs}    True
+${teardown_device}    False
+
+*** Test Cases ***
+Activate Devices OLT/ONU
+    [Documentation]    Validate deployment -> Empty Device List
+    ...    create and enable device -> Preprovision and Enable
+    ...    re-validate deployment -> Active OLT
+    [Tags]    active
+    #test for empty device list
+    ${length}=    Test Empty Device List
+    Should Be Equal As Integers  ${length}    0
+    #create/preprovision device
+    ${olt_device_id}=    Create Device    ${olt_ip}    ${OLT_PORT}
+    Set Global Variable    ${olt_device_id}
+    #validate olt states
+    Wait Until Keyword Succeeds    60s    5s    Validate OLT Device   PREPROVISIONED    UNKNOWN    UNKNOWN  ${EMPTY}
+    ...    ${olt_device_id}
+    #enable device
+    Enable Device    ${olt_device_id}
+    #validate olt states
+    Wait Until Keyword Succeeds    60s    5s    Validate OLT Device   ENABLED    ACTIVE    REACHABLE    ${EMPTY}
+    ...    ${olt_device_id}
+
+ONU Discovery
+    [Documentation]    Discover lists of ONUS, their Serial Numbers and device id
+    [Tags]    active
+    #build onu sn list
+    ${List_ONU_Serial}    Create List
+    Set Suite Variable    ${List_ONU_Serial}
+    Build ONU SN List    ${List_ONU_Serial}
+    Log    ${List_ONU_Serial}
+    #validate onu states
+    Wait Until Keyword Succeeds    ${long_timeout}    20s    Validate ONU Devices    ENABLED    ACTIVE    REACHABLE
+    ...    ${List_ONU_Serial}
+
+Validate Device's Ports and Flows
+    [Documentation]    Verify Ports and Flows listed for OLT and ONUs
+    ...    For OLT we validate the port types and numbers and for flows we simply verify that their numbers > 0
+    ...    For each ONU, we validate the port types and numbers for each and for flows.
+    ...    For flows they should be == 0 at this stage
+    [Tags]    active
+    #validate olt port types
+    Validate OLT Port Types    PON_OLT    ETHERNET_NNI
+    #validate olt flows
+    Validate OLT Flows
+    #validate onu port types
+    Validate ONU Port Types    ${List_ONU_Serial}    PON_ONU    ETHERNET_UNI
+    #validate onu flows
+    Validate ONU Flows    ${List_ONU_Serial}    ${num_onu_flows}
+
+Validate Logical Device
+    [Documentation]    Verify that logical device exists and then verify its ports and flows
+    [Tags]    active
+    #Verify logical device exists
+    ${logical_device_id}=    Validate Logical Device
+    #Verify logical device ports
+    Validate Logical Device Ports    ${logical_device_id}
+    #Verify logical device flows
+    Validate Logical Device Flows    ${logical_device_id}
+
+Validate Peer Devices
+    [Documentation]    Verify that peer lists matches up between that of ${olt_device_id}
+    ...    and individual ONU device ids
+    [Tags]    active
+    #Retrieve peer list from OLT
+    ${olt_peer_list}=    Create List
+    Retrieve Peer List From OLT    ${olt_peer_list}
+    Log    ${olt_peer_list}
+    #Validate OLT peer id list
+    Validate OLT Peer Id List    ${olt_peer_list}
+    #Validate ONU peer ids
+    Validate ONU Peer Id    ${olt_device_id}    ${List_ONU_Serial}
+
+*** Keywords ***
+Setup Suite
+    [Documentation]    Setup the whole test suite
+    # BBSim sanity test doesn't need these imports from other repositories
+    Run Keyword If    ${external_libs}    Import Library
+    ...    ${CURDIR}/../../../voltha/tests/atests/common/testCaseUtils.py
+    Run Keyword If    ${external_libs}    Import Resource
+    ...    ${CURDIR}/../../../cord-tester/src/test/cord-api/Framework/Subscriber.robot
+    Run Keyword If    ${external_libs}    Import Resource
+    ...    ${CURDIR}/../../../cord-tester/src/test/cord-api/Framework/OLT.robot
+    Run Keyword If    ${external_libs}    Import Resource
+    ...    ${CURDIR}/../../../cord-tester/src/test/cord-api/Framework/DHCP.robot
+    Run Keyword If    ${external_libs}    Import Resource
+    ...    ${CURDIR}/../../../cord-tester/src/test/cord-api/Framework/Kubernetes.robot
+    Set Global Variable    ${KUBECTL_CONFIG}    export KUBECONFIG=%{KUBECONFIG}
+    Set Global Variable    ${VOLTCTL_CONFIG}    export VOLTCONFIG=%{VOLTCONFIG}
+    ${k8s_node_ip}=    Evaluate    ${nodes}[0].get("ip")
+    ${k8s_node_user}=    Evaluate    ${nodes}[0].get("user")
+    ${k8s_node_pass}=    Evaluate    ${nodes}[0].get("pass")
+    Check CLI Tools Configured
+    ${onos_auth}=    Create List    karaf    karaf
+    ${HEADERS}    Create Dictionary    Content-Type=application/json
+    Create Session    ONOS    http://${k8s_node_ip}:${ONOS_REST_PORT}    auth=${ONOS_AUTH}
+    ${olt_ip}=    Evaluate    ${olts}[0].get("ip")
+    ${olt_user}=    Evaluate    ${olts}[0].get("user")
+    ${olt_pass}=    Evaluate    ${olts}[0].get("pass")
+    ${olt_serial_number}=    Evaluate    ${olts}[0].get("serial")
+    ${num_onus}=    Get Length    ${hosts.src}
+    ${num_onus}=    Convert to String    ${num_onus}
+    #send sadis file to onos
+    ${sadis_file}=    Evaluate    ${sadis}.get("file")
+    Log To Console  \nSadis File:${sadis_file}
+    Run Keyword Unless    '${sadis_file}' is '${None}'    Send File To Onos    ${sadis_file}    apps/
+    Set Suite Variable    ${num_onus}
+    Set Suite Variable    ${olt_serial_number}
+    Set Suite Variable    ${olt_ip}
+    Set Suite Variable    ${olt_user}
+    Set Suite Variable    ${olt_pass}
+    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
+    ...    voltha-ro-core    voltha-rw-core-11    voltha-rw-core-12    voltha-ofagent
+    Set Suite Variable    ${container_list}
+    ${datetime}=    Get Current Date
+    Set Suite Variable    ${datetime}
+
+Teardown Suite
+    [Documentation]    Clean up devices if desired
+    ...    kills processes and cleans up interfaces on src+dst servers
+    Run Keyword If    ${external_libs}    Get ONOS Status    ${k8s_node_ip}
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    Run Keyword If    ${external_libs}    Log Kubernetes Containers Logs Since Time    ${datetime}    ${container_list}
+    Run Keyword If    ${teardown_device}    Delete Device and Verify
+    ${length}=    Run Keyword If    ${teardown_device}    Run Keyword And Return    Test Empty Device List
+    Run Keyword If    ${teardown_device}    Should Be Equal As Integers    ${length}    0
+    Run Keyword If    ${teardown_device}    Execute ONOS CLI Command    ${k8s_node_ip}    ${ONOS_SSH_PORT}
+    ...    device-remove ${of_id}
+
+Clean Up Linux
+    [Documentation]    Kill processes and clean up interfaces on src+dst servers
+    FOR    ${I}    IN RANGE    0    ${num_onus}
+        ${src}=    Set Variable    ${hosts.src[${I}]}
+        ${dst}=    Set Variable    ${hosts.dst[${I}]}
+        Run Keyword And Ignore Error    Kill Linux Process    [w]pa_supplicant    ${src['ip']}
+        ...    ${src['user']}    ${src['pass']}    ${src['container_type']}    ${src['container_name']}
+        Run Keyword And Ignore Error    Kill Linux Process    [d]hclient    ${src['ip']}
+        ...    ${src['user']}    ${src['pass']}    ${src['container_type']}    ${src['container_name']}
+        Run Keyword If    '${dst['ip']}' != '${None}'    Run Keyword And Ignore Error
+        ...    Kill Linux Process    [d]hcpd    ${dst['ip']}    ${dst['user']}
+        ...    ${dst['pass']}    ${dst['container_type']}    ${dst['container_name']}
+        Delete IP Addresses from Interface on Remote Host    ${src['dp_iface_name']}    ${src['ip']}
+        ...    ${src['user']}    ${src['pass']}    ${src['container_type']}    ${src['container_name']}
+        Run Keyword If    '${dst['ip']}' != '${None}'    Delete Interface on Remote Host
+        ...    ${dst['dp_iface_name']}.${src['s_tag']}    ${dst['ip']}    ${dst['user']}    ${dst['pass']}
+        ...    ${dst['container_type']}    ${dst['container_name']}
+    END
+
+Delete Device and Verify
+    [Documentation]    Disable -> Delete devices via voltctl and verify its removed
+    ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
+    Should Be Equal As Integers    ${rc}    0
+    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Device    DISABLED    UNKNOWN    REACHABLE
+    ...    ${olt_serial_number}
+    ${rc}    ${output}=    Run and Return Rc and Output    ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
+    Should Be Equal As Integers    ${rc}    0
+    Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device Removed    ${olt_device_id}
\ No newline at end of file