use single ssh connection to onos
It belongs to VOL-4041 and is the second part.
Keyword 'Execute ONOS CLI Command on open connection' is deprecated
and is replaced by keyword
'Execute ONOS CLI Command use single connection' for all test suites
and libraries.

Change-Id: Ib5078b50d22e812e927e437a0e6f0e249f95ee9a
diff --git a/libraries/onos.robot b/libraries/onos.robot
index 67b3589..20a366e 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -40,23 +40,6 @@
     Set Global Variable    ${connection_list}
     [Return]    ${conn_list_id}
 
-Execute ONOS CLI Command on open connection
-    [Documentation]    Execute ONOS CLI Command On an Open Connection
-    [Arguments]    ${connection_list_id}  ${cmd}
-    ${connection_entry}=    Get From List   ${connection_list}    ${connection_list_id}
-    SSHLibrary.Switch Connection   ${connection_entry.conn_id}
-    ${PassOrFail}    @{result_values}    Run Keyword And Ignore Error    SSHLibrary.Execute Command    ${cmd}
-    ...    return_rc=True    return_stderr=True    return_stdout=True
-    Run Keyword If    '${PassOrFail}'=='FAIL'    Reconnect ONOS SSH Connection    ${connection_list_id}
-    @{result_values}=    Run Keyword If    '${PassOrFail}'=='FAIL'
-    ...    SSHLibrary.Execute Command    ${cmd}    return_rc=True    return_stderr=True    return_stdout=True
-    ...    ELSE    Set Variable    @{result_values}
-    ${output}    Set Variable    @{result_values}[0]
-    Log    Command output: ${output}
-    Should Be Empty    @{result_values}[1]
-    Should Be Equal As Integers    @{result_values}[2]    0
-    [Return]    ${output}
-
 Execute ONOS CLI Command use single connection
     [Documentation]    Execute ONOS CLI Command use an Open Connection
     ...                In case no connection is open a connection will be opened
@@ -580,8 +563,8 @@
 
 Verify Empty Group in ONOS
     [Documentation]    Verifies zero group count on the device
-    [Arguments]    ${onos_ssh_connection}    ${deviceId}
-    ${groups}=    Execute ONOS CLI Command on open connection    ${onos_ssh_connection}    groups | grep ${deviceId}
+    [Arguments]    ${ip}    ${port}    ${deviceId}
+    ${groups}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}    groups | grep ${deviceId}
     @{groups_arr}=    Split String    ${groups}    ,
     @{group_count_arr}=    Split String    ${groups_arr[1]}    =
     ${group_count}=    Set Variable    ${group_count_arr[1]}
@@ -590,8 +573,8 @@
 Verify ONUs in Group Count in ONOS
     [Documentation]    Verifies there exists a group bucket list with certain entries/count
     ...    Note: Currently, this validates only if all ONUs of an OLT joined the same igmp group
-    [Arguments]    ${onos_ssh_connection}    ${count}    ${deviceId}
-    ${result}=    Execute ONOS CLI Command on open connection    ${onos_ssh_connection}
+    [Arguments]    ${ip}    ${port}    ${count}    ${deviceId}
+    ${result}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...   groups added ${deviceId} | grep bucket | wc -l
     Should Be Equal As Integers     ${result}   ${count}    Bucket list count for a group: Found=${result} Expected=${count}
 
@@ -639,17 +622,17 @@
     ...    Should Be True    '${matched}'=='False'    Match for ${deviceId} and ${onu_port} found in ONOS groups
 
 Assert Number of AAA-Users
-    [Arguments]    ${onos_ssh_connection}    ${expected_onus}   ${deviceId}
+    [Arguments]    ${ip}    ${port}    ${expected_onus}   ${deviceId}
     [Documentation]    Matches for number of aaa-users authorized based on number of onus
-    ${aaa_users}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${aaa_users}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...     aaa-users | grep ${deviceId} | grep AUTHORIZED | wc -l
     Log     Found ${aaa_users} of ${expected_onus} expected authenticated users on device ${deviceId}
     Should Be Equal As Integers    ${aaa_users}    ${expected_onus}
 
 Validate DHCP Allocations
-    [Arguments]    ${onos_ssh_connection}    ${count}   ${workflow}     ${deviceId}
+    [Arguments]    ${ip}    ${port}    ${count}   ${workflow}     ${deviceId}
     [Documentation]    Matches for number of dhcpacks based on number of onus
-    ${allocations}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${allocations}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...     dhcpl2relay-allocations | grep ${deviceId} | grep DHCPACK | wc -l
     # if the workflow is TT we'll have 2 allocations for each ONU
     ${ttAllocations}=     Evaluate   (${count} * 2)
@@ -690,89 +673,82 @@
     END
 
 Assert ONU Port Is Disabled
-    [Arguments]    ${onos_ssh_connection}    ${deviceId}    ${onu_port}
+    [Arguments]    ${ip}    ${port}    ${deviceId}    ${onu_port}
     [Documentation]    Verifies if the ONU port is disabled in ONOS
-    ${onu_port_disabled}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${onu_port_disabled}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...    ports -d ${deviceId} | grep port=${onu_port}
     Log    ${onu_port_disabled}
     Should Not Be Empty    ${onu_port_disabled}
 
 Assert Olts in ONOS
-    [Arguments]    ${onos_ssh_connection}     ${count}
+    [Arguments]    ${ip}    ${port}     ${count}
     [Documentation]    DEPRECATED use Assert Olt in ONOS
     ...     Check that a certain number of olts are known to ONOS
-    ${olts}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${olts}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...    volt-olts | wc -l
     Log     Found ${olts} of ${count} expected Olts
     Should Be Equal As Integers    ${olts}    ${count}
 
 Assert Olt in ONOS
-    [Arguments]    ${onos_ssh_connection}     ${deviceId}
+    [Arguments]    ${ip}    ${port}     ${deviceId}
     [Documentation]    Check that a particular olt is known to ONOS
-    ${olts}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${olts}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...    volt-olts | grep ${deviceId} | wc -l
     Should Be Equal As Integers    ${olts}    1   "Device ${deviceId} is not recognized as an OLT"
 
 Wait for Olts in ONOS
-    [Arguments]    ${onos_ssh_connection}    ${count}   ${max_wait_time}=10m
+    [Arguments]    ${ip}    ${port}    ${count}   ${max_wait_time}=10m
     [Documentation]    DEPRECATED use Wait for Olt in ONOS
     ...     Waits untill a certain number of ports are enabled in ONOS for a particular deviceId
     Wait Until Keyword Succeeds     ${max_wait_time}     5s      Assert Olts in ONOS
-    ...     ${onos_ssh_connection}     ${count}
+    ...     ${ip}    ${port}     ${count}
 
 Wait for Olt in ONOS
-    [Arguments]    ${onos_ssh_connection}    ${deviceId}   ${max_wait_time}=10m
+    [Arguments]    ${ip}    ${port}    ${deviceId}   ${max_wait_time}=10m
     [Documentation]    Waits until a particular deviceId is recognized by ONOS as an OLT
     Wait Until Keyword Succeeds     ${max_wait_time}     5s      Assert Olt in ONOS
-    ...     ${onos_ssh_connection}     ${deviceId}
+    ...     ${ip}    ${port}     ${deviceId}
 
 Assert Ports in ONOS
-    [Arguments]    ${onos_ssh_connection}     ${count}     ${deviceId}    ${filter}
+    [Arguments]    ${ip}    ${port}     ${count}     ${deviceId}    ${filter}
     [Documentation]    Check that a certain number of ports are enabled in ONOS
-    ${ports}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${ports}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
         ...    ports -e ${deviceId} | grep ${filter} | wc -l
     Log     Found ${ports} of ${count} expected ports on device ${deviceId}
     Should Be Equal As Integers    ${ports}    ${count}
 
 Wait for Ports in ONOS
-    [Arguments]    ${onos_ssh_connection}    ${count}    ${deviceId}    ${filter}    ${max_wait_time}=10m
+    [Arguments]    ${ip}    ${port}    ${count}    ${deviceId}    ${filter}    ${max_wait_time}=10m
     [Documentation]    Waits untill a certain number of ports are enabled in ONOS for a particular deviceId
     Wait Until Keyword Succeeds     ${max_wait_time}     5s      Assert Ports in ONOS
-    ...     ${onos_ssh_connection}     ${count}     ${deviceId}     ${filter}
+    ...     ${ip}    ${port}     ${count}     ${deviceId}     ${filter}
 
 Wait for AAA Authentication
-    [Arguments]    ${onos_ssh_connection}    ${count}    ${deviceId}    ${max_wait_time}=10m
+    [Arguments]    ${ip}    ${port}    ${count}    ${deviceId}    ${max_wait_time}=10m
     [Documentation]    Waits untill a certain number of subscribers are authenticated in ONOS
     Wait Until Keyword Succeeds     ${max_wait_time}     5s      Assert Number of AAA-Users
-    ...     ${onos_ssh_connection}     ${count}     ${deviceId}
+    ...     ${ip}    ${port}     ${count}     ${deviceId}
 
 Wait for DHCP Ack
-    [Arguments]    ${onos_ssh_connection}    ${count}    ${workflow}    ${deviceId}    ${max_wait_time}=10m
+    [Arguments]    ${ip}    ${port}    ${count}    ${workflow}    ${deviceId}    ${max_wait_time}=10m
     [Documentation]    Waits untill a certain number of subscribers have received a DHCP_ACK
     Wait Until Keyword Succeeds     ${max_wait_time}     5s      Validate DHCP Allocations
-        ...     ${onos_ssh_connection}     ${count}    ${workflow}    ${deviceId}
-
-Provision subscriber
-    [Documentation]  Calls volt-add-subscriber-access in ONOS
-    [Arguments]    ${onos_ip}    ${onos_port}   ${of_id}    ${onu_port}
-    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-            ...    volt-add-subscriber-access ${of_id} ${onu_port}
+        ...     ${ip}    ${port}     ${count}    ${workflow}    ${deviceId}
 
 Provision subscriber REST
     [Documentation]     Uses the rest APIs to provision a subscriber
-    [Arguments]     ${onos_ip}    ${onos_port}   ${of_id}    ${onu_port}
+    [Arguments]     ${of_id}    ${onu_port}
     ${resp}=    Post Request    ONOS
     ...    /onos/olt/oltapp/${of_id}/${onu_port}
     Should Be Equal As Strings    ${resp.status_code}    200
 
-
 List Enabled UNI Ports
     [Documentation]  List all the UNI Ports, the only way we have is to filter out the one called NNI
     ...     Creates a list of dictionaries
-    [Arguments]     ${onos_ssh_connection}   ${of_id}
+    [Arguments]     ${ip}    ${port}   ${of_id}
     [Return]  [{'port': '16', 'of_id': 'of:00000a0a0a0a0a00'}, {'port': '32', 'of_id': 'of:00000a0a0a0a0a00'}]
     ${result}=      Create List
-    ${out}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${out}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...    ports -e ${of_id} | grep -v SWITCH | grep -v nni
     @{unis}=    Split To Lines    ${out}
     FOR    ${uni}    IN    @{unis}
@@ -785,21 +761,21 @@
 
 Provision all subscribers on device
     [Documentation]  Provisions a subscriber in ONOS for all the enabled UNI ports on a particular device
-    [Arguments]     ${onos_ssh_connection}  ${onos_ip}  ${onos_rest_port}   ${of_id}
-    ${unis}=    List Enabled UNI Ports  ${onos_ssh_connection}   ${of_id}
+    [Arguments]     ${ip}    ${port}  ${onos_ip}  ${onos_rest_port}   ${of_id}
+    ${unis}=    List Enabled UNI Ports  ${ip}    ${port}   ${of_id}
     ${onos_auth}=    Create List    karaf    karaf
     Create Session    ONOS    http://${onos_ip}:${onos_rest_port}    auth=${onos_auth}
     FOR     ${uni}  IN      @{unis}
-        Provision Subscriber REST   ${onos_ip}  ${onos_rest_port}   ${uni['of_id']}   ${uni['port']}
+        Provision Subscriber REST   ${uni['of_id']}   ${uni['port']}
     END
 
 List OLTs
     # NOTE this method is not currently used but it can come useful in the future
     [Documentation]  Returns a list of all OLTs known to ONOS
-    [Arguments]  ${onos_ssh_connection}
+    [Arguments]  ${ip}    ${port}
     [Return]  ['of:00000a0a0a0a0a00', 'of:00000a0a0a0a0a01']
     ${result}=      Create List
-    ${out}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    ${out}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...     volt-olts
     @{olts}=    Split To Lines    ${out}
     FOR    ${olt}    IN    @{olts}
@@ -814,20 +790,20 @@
 
 Count ADDED flows
     [Documentation]  Count the flows in ADDED state in ONOS
-    [Arguments]  ${onos_ssh_connection}    ${targetFlows}   ${deviceId}
-    ${flows}=    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+    [Arguments]  ${ip}    ${port}    ${targetFlows}   ${deviceId}
+    ${flows}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
     ...     flows -s any ${deviceId} | grep ADDED | wc -l
     Log     Found ${flows} of ${targetFlows} expected flows on device ${deviceId}
     Should Be Equal As Integers    ${targetFlows}    ${flows}
 
 Wait for all flows to in ADDED state
     [Documentation]  Waits until the flows have been provisioned
-    [Arguments]  ${onos_ssh_connection}     ${deviceId}     ${workflow}    ${uni_count}    ${olt_count}
+    [Arguments]  ${ip}    ${port}     ${deviceId}     ${workflow}    ${uni_count}    ${olt_count}
     ...    ${provisioned}     ${withEapol}    ${withDhcp}     ${withIgmp}     ${withLldp}
     ${targetFlows}=     Calculate flows by workflow     ${workflow}    ${uni_count}    ${olt_count}     ${provisioned}
     ...     ${withEapol}    ${withDhcp}     ${withIgmp}     ${withLldp}
     Wait Until Keyword Succeeds     10m     5s      Count ADDED flows
-    ...     ${onos_ssh_connection}  ${targetFlows}  ${deviceId}
+    ...     ${ip}    ${port}  ${targetFlows}  ${deviceId}
 
 Get Limiting Bandwidth Details
     [Arguments]    ${bandwidth_profile_name}
diff --git a/libraries/onu_utilities.robot b/libraries/onu_utilities.robot
index 4c2900a..5a7fdfb 100755
--- a/libraries/onu_utilities.robot
+++ b/libraries/onu_utilities.robot
@@ -102,7 +102,7 @@
     [Documentation]    This keyword logs all port data available in ONOS of first port per ONU
     [Arguments]    ${onlyenabled}=False
     ${cmd}    Set Variable If    ${onlyenabled}    ports -e    ports
-    ${onu_ports}=    Execute ONOS CLI Command on open connection    ${onos_ssh_connection}   ${cmd}
+    ${onu_ports}=    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}   ${cmd}
     ${lines} =     Get Lines Matching Regexp    ${onu_ports}    .*portName=BBSM[0-9]{8}-1
     Log    ${lines}
 
@@ -388,7 +388,7 @@
 
 Wait for Ports in ONOS for all OLTs
     [Documentation]    Waits untill a certain number of ports are enabled in all OLTs
-    [Arguments]    ${onos_ssh_connection}    ${count}    ${filter}    ${max_wait_time}=10m   ${determine_number}=False
+    [Arguments]    ${host}    ${port}    ${count}    ${filter}    ${max_wait_time}=10m   ${determine_number}=False
     FOR    ${J}    IN RANGE    0    ${num_olts}
         ${olt_serial_number}=    Set Variable    ${list_olts}[${J}][sn]
         ${onu_count}=    Set Variable    ${list_olts}[${J}][onucount]
@@ -399,18 +399,18 @@
         # if flag determine_number is set to True, always determine the number of real ONUs (overwrite previous value)
         ${count2check}=    Run Keyword If    ${determine_number}    Determine Number Of ONU    ${olt_serial_number}
         ...                ELSE              Set Variable    ${count2check}
-        Wait for Ports in ONOS    ${onos_ssh_connection}    ${count2check}    ${of_id}    BBSM    ${max_wait_time}
+        Wait for Ports in ONOS    ${host}    ${port}    ${count2check}    ${of_id}    BBSM    ${max_wait_time}
     END
 
 Wait for all ONU Ports in ONOS Disabled
     [Documentation]    Waits untill a all ONU ports are disabled in all ONOS
-    [Arguments]    ${onos_ssh_connection}
+    [Arguments]    ${host}    ${port}
     FOR    ${I}    IN RANGE    0    ${num_all_onus}
         ${src}=    Set Variable    ${hosts.src[${I}]}
         ${of_id}=    Wait Until Keyword Succeeds    ${timeout}    15s    Validate OLT Device in ONOS
         ...    ${src['olt']}
        ${onu_port}=    Wait Until Keyword Succeeds    ${timeout}    2s    Get ONU Port in ONOS    ${src['onu']}    ${of_id}
-        Wait Until Keyword Succeeds    ${timeout}    2s    Assert ONU Port Is Disabled    ${onos_ssh_connection}    ${of_id}
+        Wait Until Keyword Succeeds    ${timeout}    2s    Assert ONU Port Is Disabled    ${host}    ${port}    ${of_id}
         ...    ${onu_port}
     END
 
diff --git a/tests/bbsim/Voltha_BBSimTests.robot b/tests/bbsim/Voltha_BBSimTests.robot
old mode 100644
new mode 100755
index b8083b8..a4a1d72
--- a/tests/bbsim/Voltha_BBSimTests.robot
+++ b/tests/bbsim/Voltha_BBSimTests.robot
@@ -127,7 +127,7 @@
         ...    Verify ONU in AAA-Users    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${onu_port}
         ...    AND    List ONUs    ${NAMESPACE}    ${bbsim_pod}
         # Restart Auth and Verify (valid only for ATT)
-        ...    AND    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+        ...    AND    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
         ...    aaa-reset-all-devices
         ...    AND    Restart Auth    ${NAMESPACE}    ${bbsim_pod}    ${src['onu']}
         ...    AND    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2
@@ -135,7 +135,7 @@
         ...    AND    List ONUs    ${NAMESPACE}    ${bbsim_pod}
         # Add Subscriber
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2
-        ...    Execute ONOS CLI Command on open connection    ${onos_ssh_connection}
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
         ...    volt-add-subscriber-access ${of_id} ${onu_port}
         # Verify that no pending flows exist for the ONU port
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
@@ -147,7 +147,7 @@
         ...    Validate Subscriber DHCP Allocation    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${onu_port}
         ...    AND    List ONUs    ${NAMESPACE}    ${bbsim_pod}
         # Restart Dhcp and Verify (valid only for ATT and TT)
-        ...    AND    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}
+        ...    AND    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
         ...    dhcpl2relay-remove-allocation ${of_id} ${onu_port}
         ...    AND    Restart DHCP    ${NAMESPACE}    ${bbsim_pod}    ${src['onu']}
         ...    AND    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
@@ -158,8 +158,8 @@
         ...    Perform ONU Igmp Join and Leave    ${bbsim_pod}    ${of_id}    ${src['onu']}    ${onu_port}
     END
     # Clean ONOS state before rebooting
-    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}  aaa-reset-all-devices
-    Execute ONOS CLI Command on open connection     ${onos_ssh_connection}  dhcpl2relay-clear-allocations
+    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}  aaa-reset-all-devices
+    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}  dhcpl2relay-clear-allocations
     # Perform OLT SoftReboot test
     ${olt_device_id}=    Get OLTDeviceID From OLT List    ${olt_serial_number}
     Reboot Device    ${olt_device_id}
@@ -187,8 +187,6 @@
     ${onos_netcfg_file}=    Get Variable Value    ${onos_netcfg.file}
     Run Keyword If    '${workflow}'=='TT' and '${has_dataplane}'=='False' and '${onos_netcfg_file}'!='${None}'
     ...    Send File To Onos    ${onos_netcfg_file}    apps/
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable    ${onos_ssh_connection}
 
 Teardown Suite
     [Documentation]    Replaces the Suite Teardown in utils.robot.
diff --git a/tests/functional/Voltha_ScaleFunctionalTests.robot b/tests/functional/Voltha_ScaleFunctionalTests.robot
index 3dd090a..58e6a8e 100755
--- a/tests/functional/Voltha_ScaleFunctionalTests.robot
+++ b/tests/functional/Voltha_ScaleFunctionalTests.robot
@@ -124,7 +124,7 @@
     FOR    ${I}    IN RANGE    0    ${num_olts}
         ${olt_serial_number}=    Set Variable    ${list_olts}[${I}][sn]
         ${of_id}=    Wait Until Keyword Succeeds    60s    5s    Validate OLT Device in ONOS    ${olt_serial_number}
-        Wait Until Keyword Succeeds  ${long_timeout}  20s  Validate DHCP Allocations  ${onos_ssh_connection}
+        Wait Until Keyword Succeeds  ${long_timeout}  20s  Validate DHCP Allocations  ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
         ...    16   ${of_id}    BBSM
     END
     #validate DHCP allocation for each port
@@ -185,7 +185,6 @@
 Setup Suite
     [Documentation]    Set up the test suite
     Common Test Suite Setup
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
 
 Teardown Suite
     [Documentation]    Clean up devices if desired
diff --git a/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot b/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot
index 9dc9793..1a2ebf7 100755
--- a/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUNegativeStateTests.robot
@@ -104,8 +104,6 @@
     ...    ELSE IF    "${techprofile}"=="1T4GEM"    Set Tech Profile    1T4GEM
     ...    ELSE IF    "${techprofile}"=="1T8GEM"    Set Tech Profile    1T8GEM
     ...    ELSE    Fail    The TechProfile (${techprofile}) is not valid!
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable  ${onos_ssh_connection}
     # delete etcd MIB Template Data
     Delete MIB Template Data
     # delete etcd onu data
@@ -120,6 +118,6 @@
     Run Keyword If    ${pausebeforecleanup}    Log    Teardown will be continued...    console=yes
     Run Keyword If    ${teardown_device}    Delete All Devices and Verify
     Wait Until Keyword Succeeds    ${timeout}    1s    Validate Onu Data In Etcd    0    ${kvstoreprefix}    without_pm_data=False
-    Wait for Ports in ONOS for all OLTs      ${onos_ssh_connection}  0   BBSM    ${timeout}
+    Wait for Ports in ONOS for all OLTs      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}  0   BBSM    ${timeout}
     Close All ONOS SSH Connections
     Remove Tech Profile
diff --git a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
index 3f0b451..eab6545 100755
--- a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
@@ -172,8 +172,6 @@
     ...    kvstoreprefix:${kvstoreprefix}
     Log    ${LogInfo}    console=yes
     Common Test Suite Setup
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable  ${onos_ssh_connection}
     # delete etcd MIB Template Data
     Delete MIB Template Data
     # delete etcd onu data
@@ -191,7 +189,7 @@
     Run Keyword If    ${usekill2restart}    Restart Pod    ${namespace}    open-onu
     Run Keyword Unless    ${etcdcheckintestteardown}    Wait Until Keyword Succeeds    ${timeout}    1s
     ...    Validate Onu Data In Etcd    0    ${kvstoreprefix}    without_pm_data=False
-    Wait for Ports in ONOS for all OLTs      ${onos_ssh_connection}  0   BBSM    ${timeout}
+    Wait for Ports in ONOS for all OLTs      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}  0   BBSM    ${timeout}
     Close All ONOS SSH Connections
 
 Setup Test
@@ -299,7 +297,7 @@
     Run Keyword If    "${workflow}"=="DT"    Current State Test All Onus    omci-admin-lock
     ...    ELSE IF    "${workflow}"=="TT"    Current State Test All Onus    omci-admin-lock
     ...    ELSE       Current State Test All Onus    omci-admin-lock    alternativeonustate=${alternativeonustates}
-    Wait for all ONU Ports in ONOS Disabled    ${onos_ssh_connection}
+    Wait for all ONU Ports in ONOS Disabled    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
     Enable Onu Device
     Run Keyword If    "${workflow}"=="DT"    Perform Sanity Test DT     ${suppressaddsubscriber}
     ...    ELSE IF    "${workflow}"=="TT"    Perform Sanity Tests TT    ${suppressaddsubscriber}
@@ -338,7 +336,7 @@
     Run Keyword If    "${workflow}"=="DT"    Current State Test All Onus    omci-admin-lock
     ...    ELSE IF    "${workflow}"=="TT"    Current State Test All Onus    omci-admin-lock
     ...    ELSE       Current State Test All Onus    omci-admin-lock    alternativeonustate=${alternativeonustates}
-    Wait for all ONU Ports in ONOS Disabled    ${onos_ssh_connection}
+    Wait for all ONU Ports in ONOS Disabled    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
     Enable Onu Device
     Run Keyword If    "${workflow}"=="DT"    Perform Sanity Test DT     ${suppressaddsubscriber}
     ...    ELSE IF    "${workflow}"=="TT"    Perform Sanity Tests TT    ${suppressaddsubscriber}
diff --git a/tests/openonu-go-adapter/Voltha_ONUStateTests.robot b/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
index b82be26..938f27d 100755
--- a/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUStateTests.robot
@@ -202,8 +202,6 @@
     ...    ELSE IF    "${techprofile}"=="1T4GEM"    Set Tech Profile    1T4GEM
     ...    ELSE IF    "${techprofile}"=="1T8GEM"    Set Tech Profile    1T8GEM
     ...    ELSE    Fail    The TechProfile (${techprofile}) is not valid!
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable  ${onos_ssh_connection}
     # map the passed onu state to reached and make it visible for test suite
     ${admin_state}    ${oper_status}    ${connect_status}    ${onu_state_nb}    ${onu_state}=
     ...    Map State    ${state2test}
@@ -226,7 +224,7 @@
     Run Keyword If    ${pausebeforecleanup}    Log    Teardown will be continued...    console=yes
     Run Keyword If    ${teardown_device}    Delete All Devices and Verify
     Wait Until Keyword Succeeds    ${timeout}    1s    Validate Onu Data In Etcd    0    ${kvstoreprefix}    without_pm_data=False
-    Wait for Ports in ONOS for all OLTs      ${onos_ssh_connection}  0   BBSM    ${timeout}
+    Wait for Ports in ONOS for all OLTs      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}  0   BBSM    ${timeout}
     Close All ONOS SSH Connections
     Remove Tech Profile
 
@@ -315,7 +313,7 @@
 
 Do Onu Port Check
     [Documentation]    Check that all the UNI ports show up in ONOS
-    Wait for Ports in ONOS for all OLTs    ${onos_ssh_connection}    ${num_all_onus}    BBSM    ${timeout}
+    Wait for Ports in ONOS for all OLTs    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${num_all_onus}    BBSM    ${timeout}
 
 Do Onu Etcd Data Check
     [Documentation]    Check Onu data stored in etcd
@@ -461,12 +459,12 @@
     Current State Test All Onus    ${state2checkafterdisable}    alternativeonustate=${alternativeonustates}
     Log Ports
     #check no port is enabled in ONOS
-    Wait for Ports in ONOS for all OLTs    ${onos_ssh_connection}    0    BBSM
+    Wait for Ports in ONOS for all OLTs    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    0    BBSM
     Enable Onu Device
     Current State Test All Onus    ${state2check}
     Log Ports    onlyenabled=True
     #check that all the UNI ports show up in ONOS again
-    Wait for Ports in ONOS for all OLTs    ${onos_ssh_connection}    ${num_all_onus}    BBSM
+    Wait for Ports in ONOS for all OLTs    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${num_all_onus}    BBSM
 
 Do Power Off Power On Onu Device
     [Documentation]    This keyword power off/on all onus and checks the states.
diff --git a/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot b/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
index 1c5b1ac..3b86bbc 100755
--- a/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
@@ -89,8 +89,6 @@
     ...    debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup},
     Log    ${LogInfo}    console=yes
     Common Test Suite Setup
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable  ${onos_ssh_connection}
     # delete etcd MIB Template Data
     Delete MIB Template Data
 
@@ -102,7 +100,7 @@
     Run Keyword If    ${pausebeforecleanup}    Pause Execution    Press OK to continue with clean up!
     Run Keyword If    ${pausebeforecleanup}    Log    Teardown will be continued...    console=yes
     Run Keyword If    ${teardown_device}    Delete All Devices and Verify
-    Wait for Ports in ONOS for all OLTs      ${onos_ssh_connection}  0   BBSM
+    Wait for Ports in ONOS for all OLTs      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}  0   BBSM
     # delete etcd MIB Template Data (for repeating test)
     Delete MIB Template Data
     Close All ONOS SSH Connections
diff --git a/tests/pm-data/Voltha_ONUPMTests.robot b/tests/pm-data/Voltha_ONUPMTests.robot
index 5012b83..9667745 100755
--- a/tests/pm-data/Voltha_ONUPMTests.robot
+++ b/tests/pm-data/Voltha_ONUPMTests.robot
@@ -154,7 +154,7 @@
     Current State Test All Onus    omci-admin-lock    alternativeonustate=${alternativeonustates}
     Log Ports
     #check no port is enabled in ONOS
-    Wait for Ports in ONOS for all OLTs    ${onos_ssh_connection}    0    BBSM
+    Wait for Ports in ONOS for all OLTs    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    0    BBSM
     Collect and Validate PM Data    ${collect_interval}    user=True
     Clean Metric Dictionary
     # enable (all) onu devices
@@ -163,7 +163,7 @@
     Current State Test All Onus    omci-flows-pushed    alternativeonustate=${alternativeonustates}
     Log Ports    onlyenabled=True
     #check that all the UNI ports show up in ONOS again
-    Wait for Ports in ONOS for all OLTs    ${onos_ssh_connection}    ${num_all_onus}    BBSM    determine_number=True
+    Wait for Ports in ONOS for all OLTs    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${num_all_onus}    BBSM    determine_number=True
     # validate enabled status (again)
     Set Validation Operation All Onu    ${group}    ${oper_state}    ${ValidationEnabled}
     Set Validation Operation All Onu    ${group}    ${admin_state}   ${ValidationEnabled}
@@ -183,8 +183,6 @@
 Setup Suite
     [Documentation]    Set up the test suite
     Common Test Suite Setup
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable  ${onos_ssh_connection}
     ${switch_type}=    Get Variable Value    ${web_power_switch.type}
     Run Keyword If  "${switch_type}"!=""    Set Global Variable    ${powerswitch_type}    ${switch_type}
     # set ${kafka} depending on environment in case of port-forward is needed
diff --git a/tests/scale/Voltha_Scale_Tests.robot b/tests/scale/Voltha_Scale_Tests.robot
index 1eb15f2..7107218 100755
--- a/tests/scale/Voltha_Scale_Tests.robot
+++ b/tests/scale/Voltha_Scale_Tests.robot
@@ -105,7 +105,7 @@
     [Tags]  activation  plot-onos-olts
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
-        Wait for Olt in ONOS   ${onos_ssh_connection}  ${deviceId}
+        Wait for Olt in ONOS   ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}  ${deviceId}
     END
 
 Onu Activation in VOLTHA
@@ -118,7 +118,7 @@
     [Tags]      activation    plot-onos-ports
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
-        Wait for Ports in ONOS      ${onos_ssh_connection}  ${total_onus_per_olt}   ${deviceId}     BBSM
+        Wait for Ports in ONOS      ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}  ${total_onus_per_olt}   ${deviceId}     BBSM
     END
 
 Flows validation in VOLTHA before subscriber provisioning
@@ -144,7 +144,7 @@
 
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
-        Wait for all flows to in ADDED state    ${onos_ssh_connection}
+        Wait for all flows to in ADDED state    ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}
         ...     ${deviceId}     ${workflow}    ${total_onus_per_olt}    1    false
         ...     ${withEapol}    ${withDhcp}     ${withIgmp}   ${withLLDP}
     END
@@ -155,7 +155,7 @@
 
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
-        Wait for AAA Authentication     ${onos_ssh_connection}  ${total_onus_per_olt}   ${deviceId}
+        Wait for AAA Authentication     ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}  ${total_onus_per_olt}   ${deviceId}
     END
 
 Provision subscribers
@@ -164,7 +164,7 @@
     Should Be Equal   ${enableSubscriberProvisioning}     true
     ${onos_devices}=    Compute Device IDs
     FOR     ${olt}  IN  @{onos_devices}
-        Provision all subscribers on device  ${onos_ssh_connection}     ${ONOS_SSH_IP}     ${ONOS_REST_PORT}  ${olt}
+        Provision all subscribers on device  ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}    ${ONOS_SSH_IP}    ${ONOS_REST_PORT}  ${olt}
     END
 
 Flows validation in VOLTHA after subscriber provisioning
@@ -191,7 +191,7 @@
 
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
-        Wait for all flows to in ADDED state    ${onos_ssh_connection}
+        Wait for all flows to in ADDED state    ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}
         ...     ${deviceId}     ${workflow}    ${total_onus_per_olt}    1    true
         ...     ${withEapol}    ${withDhcp}     ${withIgmp}   ${withLLDP}
     END
@@ -201,7 +201,7 @@
     [Tags]      dhcp  plot-onos-dhcp
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
-        Wait for DHCP Ack     ${onos_ssh_connection}  ${total_onus_per_olt}     ${workflow}     ${deviceId}
+        Wait for DHCP Ack     ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}  ${total_onus_per_olt}     ${workflow}     ${deviceId}
     END
 
 Perform Igmp Join
@@ -224,7 +224,7 @@
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
-        ...    Verify ONUs in Group Count in ONOS    ${onos_ssh_connection}    ${total_onus_per_olt}    ${deviceId}
+        ...    Verify ONUs in Group Count in ONOS    ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}    ${total_onus_per_olt}    ${deviceId}
     END
 
 Perform Igmp Leave
@@ -247,7 +247,7 @@
     ${onos_devices}=    Compute Device IDs
     FOR     ${deviceId}     IN  @{onos_devices}
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
-        ...    Verify Empty Group in ONOS    ${onos_ssh_connection}    ${deviceId}
+        ...    Verify Empty Group in ONOS    ${${ONOS_SSH_IP}    ${ONOS_SSH_PORT}}    ${deviceId}
     END
 
 Disable and Delete devices
@@ -278,9 +278,6 @@
     Run Keyword If    '${workflow}'=='tt'
     ...    Send File To Onos    ${CURDIR}/../../tests/data/onos-igmp.json    apps/
 
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable  ${onos_ssh_connection}
-
 Teardown Suite
    [Documentation]    Close the SSH connection to ONOS
     Close All ONOS SSH Connections
diff --git a/tests/software-upgrades/ONOS_AppsUpgrade.robot b/tests/software-upgrades/ONOS_AppsUpgrade.robot
old mode 100644
new mode 100755
index 222ef7e..fbd04db
--- a/tests/software-upgrades/ONOS_AppsUpgrade.robot
+++ b/tests/software-upgrades/ONOS_AppsUpgrade.robot
@@ -83,7 +83,7 @@
     FOR    ${J}    IN RANGE    0    ${num_apps_under_test}
         ${app_ut}=    Set Variable    ${list_onos_apps_under_test}[${J}][app]
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
-        ...    Execute ONOS CLI Command on open connection    ${onos_ssh_connection}
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
         ...    log:set DEBUG ${app_ut}
     END
     FOR    ${I}    IN RANGE    0    ${num_apps_under_test}
@@ -116,8 +116,6 @@
     [Documentation]    Set up the test suite
     Common Test Suite Setup
     Create ONOS Apps Under Test List
-    ${onos_ssh_connection}    Open ONOS SSH Connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-    Set Suite Variable    ${onos_ssh_connection}
 
 Teardown Suite
     [Documentation]    Replaces the Suite Teardown in utils.robot.