VOL-2642 Use cord-tester library

Change-Id: If2cbf2987eb8ff152e5aabdc179ba98d8fc37398
diff --git a/libraries/onos.robot b/libraries/onos.robot
index f3f5e9f..4fe9c57 100644
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -24,20 +24,6 @@
 Library           OperatingSystem
 
 *** Keywords ***
-Execute ONOS CLI Command
-    [Arguments]    ${host}    ${port}    ${cmd}
-    [Documentation]    Establishes an ssh connection to the onos contoller and executes a command
-    ${conn_id}=    SSHLibrary.Open Connection    ${host}    port=${port}    timeout=300s
-    SSHLibrary.Login    karaf    karaf
-    @{result_values}    SSHLibrary.Execute Command    ${cmd}    return_rc=True
-    ...    return_stderr=True    return_stdout=True
-    ${output}    Set Variable    @{result_values}[0]
-    Log    ${output}
-    Should Be Empty    @{result_values}[1]
-    Should Be Equal As Integers    @{result_values}[2]    0
-    SSHLibrary.Close Connection
-    [Return]    ${output}
-
 Validate OLT Device in ONOS
     #    FIXME use volt-olts to check that the OLT is ONOS
     [Arguments]    ${serial_number}
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 9ef022e..cd27aa4 100644
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -22,6 +22,8 @@
 Library           Collections
 Library           RequestsLibrary
 Library           OperatingSystem
+Library           CORDRobot
+Library           ImportResource    resources=CORDRobot
 
 *** Keywords ***
 Check CLI Tools Configured
@@ -46,15 +48,6 @@
 
 Common Test Suite Setup
     [Documentation]    Setup the test suite
-    # BBSim sanity test doesn't need these imports from other repositories
-    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")
@@ -266,9 +259,6 @@
 Teardown
     [Documentation]    kills processes and cleans up interfaces on src+dst servers
     Run Keyword If    ${has_dataplane}    Clean Up Linux
-    Run Keyword If    ${external_libs}        Run Keyword and Ignore Error
-    ...    Log Kubernetes Containers Logs Since Time
-    ...    ${datetime}    ${container_list}
 
 Teardown Suite
     [Documentation]    Clean up device if desired
@@ -339,7 +329,7 @@
     Run Keyword and Ignore Error    Get Device List from Voltha
     Run Keyword and Ignore Error    Get Device Output from Voltha    ${olt_device_id}
     Run Keyword and Ignore Error    Get Logical Device Output from Voltha    ${logical_id}
-    Run Keyword If    ${external_libs}    Get ONOS Status    ${k8s_node_ip}
+    Get ONOS Status    ${k8s_node_ip}    ${ONOS_SSH_PORT}
 
 Verify ping is succesful except for given device
     [Arguments]    ${num_onus}    ${exceptional_onu_id}
diff --git a/requirements.txt b/requirements.txt
index 52e1d59..b37d7c4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
+--extra-index-url https://test.pypi.org/simple/
 flake8
 pexpect
 pylint
@@ -8,3 +9,7 @@
 robotframework-requests
 robotframework-sshlibrary
 yamllint
+# replace when we can use upstream (needs python 3.6)
+git+https://github.com/zdw/robotframework-importresource@b81b87aabaee0594e966687b41e3674b866f28ee
+# Temporary, get from test.pypi.org until we publish for real
+cord-robot==2.1.0.dev2
diff --git a/tests/data/bbsim-kind-16.yaml b/tests/data/bbsim-kind-16.yaml
index c2ec132..bde8265 100644
--- a/tests/data/bbsim-kind-16.yaml
+++ b/tests/data/bbsim-kind-16.yaml
@@ -18,7 +18,6 @@
 
 # Change default values in tests
 has_dataplane: false
-external_libs: false
 teardown_device: true
 ONOS_REST_PORT: 8181
 ONOS_SSH_PORT: 8101
diff --git a/tests/data/bbsim-kind-2x2.yaml b/tests/data/bbsim-kind-2x2.yaml
index 2ab5b8c..e3b294f 100644
--- a/tests/data/bbsim-kind-2x2.yaml
+++ b/tests/data/bbsim-kind-2x2.yaml
@@ -18,7 +18,6 @@
 
 # Change default values in tests
 has_dataplane: false
-external_libs: false
 teardown_device: true
 ONOS_REST_PORT: 8181
 ONOS_SSH_PORT: 8101
diff --git a/tests/data/bbsim-kind-8x2.yaml b/tests/data/bbsim-kind-8x2.yaml
index a4ce0ef..500f95d 100644
--- a/tests/data/bbsim-kind-8x2.yaml
+++ b/tests/data/bbsim-kind-8x2.yaml
@@ -18,7 +18,6 @@
 
 # Change default values in tests
 has_dataplane: false
-external_libs: false
 teardown_device: true
 ONOS_REST_PORT: 8181
 ONOS_SSH_PORT: 8101
diff --git a/tests/data/bbsim-kind-dt.yaml b/tests/data/bbsim-kind-dt.yaml
index a5abc4d..71affaf 100644
--- a/tests/data/bbsim-kind-dt.yaml
+++ b/tests/data/bbsim-kind-dt.yaml
@@ -18,7 +18,6 @@
 
 # Change default values in tests
 has_dataplane: false
-external_libs: false
 teardown_device: true
 ONOS_REST_PORT: 8181
 ONOS_SSH_PORT: 8101
diff --git a/tests/data/bbsim-kind.yaml b/tests/data/bbsim-kind.yaml
index 021f313..d0060a9 100644
--- a/tests/data/bbsim-kind.yaml
+++ b/tests/data/bbsim-kind.yaml
@@ -18,7 +18,6 @@
 
 # Change default values in tests
 has_dataplane: false
-external_libs: false
 teardown_device: true
 ONOS_REST_PORT: 8181
 ONOS_SSH_PORT: 8101
diff --git a/tests/dt-workflow/Voltha_DT_PODTests.robot b/tests/dt-workflow/Voltha_DT_PODTests.robot
index 9210034..9a2eb78 100644
--- a/tests/dt-workflow/Voltha_DT_PODTests.robot
+++ b/tests/dt-workflow/Voltha_DT_PODTests.robot
@@ -48,7 +48,6 @@
 ${of_id}          0
 ${logical_id}     0
 ${has_dataplane}    True
-${external_libs}    True
 ${teardown_device}    False
 ${scripts}        ../../scripts
 
diff --git a/tests/functional/Voltha_AlarmTests.robot b/tests/functional/Voltha_AlarmTests.robot
index 5a6cc94..0528329 100755
--- a/tests/functional/Voltha_AlarmTests.robot
+++ b/tests/functional/Voltha_AlarmTests.robot
@@ -34,7 +34,6 @@
 ${of_id}          0
 ${logical_id}     0
 ${has_dataplane}    True
-${external_libs}    True
 ${setup_device}    True
 ${teardown_device}    True
 ${VOLTCTL_NAMESPACE}      default
@@ -385,10 +384,8 @@
 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}
+    Get ONOS Status    ${k8s_node_ip}    ${ONOS_SSH_PORT}
     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
     Run Keyword If    ${teardown_device}    Test Empty Device List
     Run Keyword If    ${teardown_device}    Execute ONOS CLI Command    ${k8s_node_ip}    ${ONOS_SSH_PORT}
diff --git a/tests/functional/Voltha_ErrorScenarios.robot b/tests/functional/Voltha_ErrorScenarios.robot
index 4802144..ab53a7b 100644
--- a/tests/functional/Voltha_ErrorScenarios.robot
+++ b/tests/functional/Voltha_ErrorScenarios.robot
@@ -48,7 +48,6 @@
 ${of_id}          0
 ${logical_id}     0
 ${has_dataplane}    True
-${external_libs}    True
 ${teardown_device}    False
 ${scripts}        ../../scripts
 
diff --git a/tests/functional/Voltha_FailureScenarios.robot b/tests/functional/Voltha_FailureScenarios.robot
index 50d294d..7ebe566 100644
--- a/tests/functional/Voltha_FailureScenarios.robot
+++ b/tests/functional/Voltha_FailureScenarios.robot
@@ -48,7 +48,6 @@
 ${of_id}          0
 ${logical_id}     0
 ${has_dataplane}    True
-${external_libs}    True
 ${teardown_device}    False
 ${scripts}        ../../scripts
 
diff --git a/tests/functional/Voltha_PODTests.robot b/tests/functional/Voltha_PODTests.robot
index 35d5910..631d275 100644
--- a/tests/functional/Voltha_PODTests.robot
+++ b/tests/functional/Voltha_PODTests.robot
@@ -48,7 +48,6 @@
 ${of_id}          0
 ${logical_id}     0
 ${has_dataplane}    True
-${external_libs}    True
 ${teardown_device}    False
 ${scripts}        ../../scripts
 
diff --git a/tests/functional/Voltha_ScaleFunctionalTests.robot b/tests/functional/Voltha_ScaleFunctionalTests.robot
index e428cb7..3ab37eb 100644
--- a/tests/functional/Voltha_ScaleFunctionalTests.robot
+++ b/tests/functional/Voltha_ScaleFunctionalTests.robot
@@ -35,7 +35,6 @@
 ${of_id}           0
 ${logical_id}      0
 ${has_dataplane}    True
-${external_libs}    True
 ${teardown_device}    False
 
 *** Test Cases ***
@@ -163,9 +162,8 @@
 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}
+    Get ONOS Status    ${k8s_node_ip}    ${ONOS_SSH_PORT}
     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
     Run Keyword If    ${teardown_device}    Test Empty Device List
     Run Keyword If    ${teardown_device}    Execute ONOS CLI Command    ${k8s_node_ip}    ${ONOS_SSH_PORT}