VOL-2642 Add a Makefile, tests, and virtualenv
Convert common python and robot into a CORDRobot python module that can
be installed via standard python tools (pip) and from PyPI
Uses a fork of https://github.com/rasjani/robotframework-importresource,
which has been backported to Python 3.5 (used in Ubuntu 16.04
executors).
Reformatted and moved keywords so resource files are scoped to a
specific topic.
Added tox tests for library consistency
- flake8
- pylint
- robotframework-lint
- Ran robot against installed library to verify it can be loaded and
used
Added basic lint and tests to whole repo
Removed old tests:
- CORD <6.x era: SanityPhyPOD.robot, and onosUtils.py
Change-Id: I61265a9fb04034a086e20be1f7236a8793a218aa
diff --git a/src/test/cord-api/Framework/ATTWorkFlowDriver.robot b/src/test/cord-api/Framework/ATTWorkFlowDriver.robot
deleted file mode 100644
index a53197f..0000000
--- a/src/test/cord-api/Framework/ATTWorkFlowDriver.robot
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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 Library to retrieve status fields from ATT WorkFlow Driver Service Instance List
-Library Collections
-Library String
-Library OperatingSystem
-Library XML
-Library RequestsLibrary
-Library utils/utils.py
-Library restApi.py
-
-*** Variable ***
-${ONU_STATE_VAR} admin_onu_state
-
-*** Keywords ***
-Service Instance Status Check
- [Arguments] ${onu_device}
- [Documentation] Returns Status and authentication_state field values from att work flow driver for a particular ONU device
- ${json_result}= restApi.ApiGet ATT_SERVICEINSTANCES
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${onu_device}
- ${onu_state}= Get From Dictionary ${getJsonDict} ${ONU_STATE_VAR}
- ${authentication_state}= Get From Dictionary ${getJsonDict} authentication_state
- ${status_message}= Get From Dictionary ${getJsonDict} status_message
- [Return] ${onu_state} ${authentication_state} ${status_message}
-
-Service Instance DHCP State Check
- [Arguments] ${onu_device}
- [Documentation] Returns dhcp state value from att work flow driver for a particular ONU device
- ${json_result}= restApi.ApiGet ATT_SERVICEINSTANCES
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${onu_device}
- ${state}= Get From Dictionary ${getJsonDict} dhcp_state
- [Return] ${state}
-
-Create Whitelist Entry
- [Arguments] ${entry_list} ${list_index}
- [Documentation] Sends a POST to create an att whitelist in XOS
- ${elist} = Get Variable Value ${entry_list}
- ${entry_dictionary}= utils.listToDict ${elist} ${list_index}
- ${api_result}= restApi.ApiPost ATT_WHITELIST ${entry_dictionary}
- Should Be True ${api_result}
- ${AttWhiteList_Id}= Get From Dictionary ${api_result} id
- Set Global Variable ${AttWhiteList_Id}
- [Return] ${AttWhiteList_Id}
-
-Retrieve Whitelist Entry
- [Arguments] ${serial_number}
- [Documentation] Returns the whitelist entry per the onu's serial number
- ${json_result}= restApi.ApiGet ATT_WHITELIST
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${serial_number}
- ${id}= Get From Dictionary ${getJsonDict} id
- [Return] ${id}
-
-Retrieve ATT Service Instance ID
- [Arguments] ${serial_number}
- [Documentation] Returns the whitelist entry per the onu's serial number
- ${json_result}= restApi.ApiGet ATT_SERVICEINSTANCES
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${serial_number}
- ${id}= Get From Dictionary ${getJsonDict} id
- [Return] ${id}
-
-Delete Whitelist Entry
- [Arguments] ${id}
- [Documentation] Sends a DELETE to delete an att whitelist in XOS
- ${api_result}= restApi.ApiChameleonDelete ATT_WHITELIST ${id}
- Should Be True ${api_result}
-
-Validate ATT Workflow Driver SI
- [Arguments] ${expected_status} ${expected_auth_status} ${onu_device} ${expected_status_message}=${EMPTY}
- ${onu_state} ${authentication_status} ${status_message} Service Instance Status Check ${onu_device}
- Should Be Equal ${onu_state} ${expected_status}
- Should Be Equal ${authentication_status} ${expected_auth_status}
- Run Keyword If '${expected_status_message}' != '${EMPTY}' Should Be Equal ${status_message} ${expected_status_message}
-
-Validate ATT Workflow Driver SI DHCP State
- [Arguments] ${expected_status} ${onu_device}
- ${dhcp_state}= Service Instance DHCP State Check ${onu_device}
- Should Be Equal ${dhcp_state} ${expected_status}
diff --git a/src/test/cord-api/Framework/DHCP.robot b/src/test/cord-api/Framework/DHCP.robot
deleted file mode 100644
index eb91e51..0000000
--- a/src/test/cord-api/Framework/DHCP.robot
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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 Library to DHCP Requests from an RG (source host)
-Library OperatingSystem
-Library SSHLibrary
-Resource utils/utils.robot
-
-*** Keywords ***
-Send Dhclient Request
- [Arguments] ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Executes a dhclient against a particular interface on the RG (src)
- ${result}= Login And Run Command On Remote System dhclient -nw ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name}
- [Return] ${result}
-
-Add Default Route to Dst Gateway
- [Arguments] ${src_gateway} ${dst_subnet} ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Adds an entry to the routing table on the RG (src)
- ${result}= Login And Run Command On Remote System ip route add ${dst_subnet} via ${src_gateway} dev ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name}
- [Return] ${result}
-
-Check IPv4 Address on DHCP Client
- [Arguments] ${ip_should_exist} ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Check if the sepcified interface has an IPv4 address assigned
- ${output}= Login And Run Command On Remote System ip address show ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name}
- ${ipv4_regex}= Set Variable If '${container_type}' != 'K8S' \\b([0-9]{1,3}\\.){3}[0-9]{1,3}\\b \\b(172)\\.(18)(\\.([0-9]{1,3})){2}\\b
- Run Keyword If '${ip_should_exist}' == 'True' Should Match Regexp ${output} ${ipv4_regex}
- Run Keyword If '${ip_should_exist}' == 'False' Should Not Match Regexp ${output} ${ipv4_regex}
diff --git a/src/test/cord-api/Framework/Kubernetes.robot b/src/test/cord-api/Framework/Kubernetes.robot
deleted file mode 100644
index 35b05cf..0000000
--- a/src/test/cord-api/Framework/Kubernetes.robot
+++ /dev/null
@@ -1,79 +0,0 @@
-# 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 Library of functions related to kubectl and helm
-Library SSHLibrary
-Library Collections
-Library String
-Library OperatingSystem
-Library RequestsLibrary
-Library utils/utils.py
-Library restApi.py
-Resource utils/utils.robot
-
-*** Keywords ***
-Helm Chart is Removed
- [Arguments] ${helm_chart}
- [Documentation] Verify the specified helm chart has been removed
- ${rc}= Run And Return Rc ${export_kubeconfig}; helm ls -q | grep ${helm_chart}
- Should Be Equal As Integers ${rc} 1
-
-Kubernetes PODs in Namespace are Removed
- [Arguments] ${namespace}
- [Documentation] Verify all Kubernetes pods in specified namespace have been removed
- ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods --no-headers -n ${namespace}
- Should Contain ${output} No resources found
-
-Kubernetes PODs in Namespace are Running
- [Arguments] ${namespace} ${pod_num}
- [Documentation] Verify the number of Kubernetes pods that are running in specified namespace is as expected
- ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods -n ${namespace} | grep -i running | grep 1/1 | wc -l
- Should Be Equal As Integers ${output} ${pod_num}
-
-Reinstall Voltha
- Run ${export_kubeconfig}; helm delete --purge voltha
- Wait Until Keyword Succeeds 60s 10s Helm Chart is Removed voltha
- Wait Until Keyword Succeeds 120s 10s Kubernetes PODs in Namespace are Removed voltha
- Sleep 10s
- Run ${export_kubeconfig}; cd ${HELM_CHARTS_DIR}; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
- Run ${export_kubeconfig}; cd ${HELM_CHARTS_DIR}; helm dep up voltha
- Run ${export_kubeconfig}; helm install -n voltha -f ${KUBERNETES_YAML} ${HELM_CHARTS_DIR}/voltha
- Wait Until Keyword Succeeds 60s 10s Kubernetes PODs in Namespace are Running voltha ${VOLTHA_POD_NUM}
- Sleep 10s
-
-Get Current Datetime On Kubernetes Node
- [Arguments] ${ip} ${user} ${pass}
- ${result}= Login And Run Command On Remote System date +"%Y-%m-%dT%H:%M:%S.%NZ" ${ip} ${user} ${pass}
- ${result}= Get Line ${result} 0
- [Return] ${result}
-
-Log Kubernetes Container Log Since Time
- [Arguments] ${datetime} ${pod_prefix}
- ${rc} ${namespace}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods --all-namespaces | grep ' ${pod_prefix}' | head -1 | awk '{print $1}'
- ${rc} ${pod_name}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods --all-namespaces | grep ' ${pod_prefix}' | head -1 | awk '{print $2}'
- ${rc} ${output}= Run Keyword If '${pod_prefix}' == 'onos' Run And Return Rc And Output ${export_kubeconfig}; kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${pod_name} -c onos
- ... ELSE Run And Return Rc And Output ${export_kubeconfig}; kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${pod_name}
- Log ${output}
-
-Log Kubernetes Containers Logs Since Time
- [Arguments] ${datetime} ${pod_list}
- : FOR ${pod_prefix} IN @{pod_list}
- \ Log Kubernetes Container Log Since Time ${datetime} ${pod_prefix}
-
-Get Kubernetes POD Name By Prefix
- [Arguments] ${prefix}
- [Documentation] Return the first POD name that starts with the specified prefix
- ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; kubectl get pods --all-namespaces | grep '${prefix}' | head -1 | awk '{print $2}'
- [Return] ${output}
diff --git a/src/test/cord-api/Framework/OLT.robot b/src/test/cord-api/Framework/OLT.robot
deleted file mode 100644
index 2301b98..0000000
--- a/src/test/cord-api/Framework/OLT.robot
+++ /dev/null
@@ -1,117 +0,0 @@
-# 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 Library of functions related to OLT
-Library SSHLibrary
-Library Collections
-Library String
-Library OperatingSystem
-Library RequestsLibrary
-Library utils/utils.py
-Library utils/testCaseUtils.py
-Library restApi.py
-
-*** Keywords ***
-Openolt is Up
- [Arguments] ${ip} ${user} ${pass} ${prompt}=~#
- [Documentation] Verify that openolt process is started and ready to connect to voltha
- Check Remote File Contents True /var/log/openolt.log oper_state: up ${ip} ${user} ${pass} prompt=${prompt}
-
-OLT Status Check
- [Arguments] ${olt_device}
- [Documentation] Returns "operational_status" and "admin_status" of a particular OLT device from "olt device list"
- ${json_result}= restApi.ApiGet VOLT_DEVICE
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} host ${olt_device}
- ${operational_status}= Get From Dictionary ${getJsonDict} oper_status
- ${admin_status}= Get From Dictionary ${getJsonDict} admin_state
- [Return] ${operational_status} ${admin_status}
-
-Validate OLT States
- [Arguments] ${expected_op_status} ${expected_admin_status} ${olt_device}
- ${operational_status} ${admin_status} OLT Status Check ${olt_device}
- Should Be Equal ${operational_status} ${expected_op_status}
- Should Be Equal ${admin_status} ${expected_admin_status}
-
-Get VOLTHA Status
- ${resp}= CORD Get ${VOLT_DEVICE}
- ${jsondata}= To Json ${resp.content}
- Log ${jsondata}
- ${length}= Get Length ${jsondata['items']}
- : FOR ${INDEX} IN RANGE 0 ${length}
- \ ${value}= Get From List ${jsondata['items']} ${INDEX}
- \ ${olt_device_id}= Get From Dictionary ${value} device_id
- \ ${logical_device_id}= Get From Dictionary ${value} of_id
- Set Suite Variable ${olt_device_id}
- Set Suite Variable ${logical_device_id}
- testCaseUtils.send_command_to_voltha_cli /tmp voltha_devices.log devices host=${server_ip}
- testCaseUtils.send_command_to_voltha_cli /tmp logical_devices.log logical_device ${logical_device_id} voltha_logical_ports.log ports voltha_logical_flows.log flow host=${server_ip}
- testCaseUtils.send_command_to_voltha_cli /tmp devices.log device ${olt_device_id} voltha_olt_ports.log ports voltha_olt_flows.log flows host=${server_ip}
- ${voltha_devices_log}= Get Binary File /tmp/voltha_devices.log
- ${devices_flows}= Get Binary File /tmp/voltha_olt_flows.log
- ${device_ports}= Get Binary File /tmp/voltha_olt_ports.log
- ${logical_devices}= Get Binary File /tmp/voltha_logical_flows.log
- ${l_device_ports}= Get Binary File /tmp/voltha_logical_ports.log
- Log ${voltha_devices_log}
- Log ${devices_flows}
- Log ${device_ports}
- Log ${logical_devices}
- Log ${l_device_ports}
-
-Get ONOS Status
- [Arguments] ${server_ip}=${None}
- testCaseUtils.send_command_to_onos_cli /tmp onos_apps.log apps -a -s host=${server_ip}
- ${onos_apps} Get Binary File /tmp/onos_apps.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_devices.log devices host=${server_ip}
- ${onos_devices} Get Binary File /tmp/onos_devices.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_ports.log ports host=${server_ip}
- ${onos_ports} Get Binary File /tmp/onos_ports.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_flows.log flows -s host=${server_ip}
- ${onos_flows} Get Binary File /tmp/onos_flows.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_meters.log meters host=${server_ip}
- ${onos_meters} Get Binary File /tmp/onos_meters.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_volt_prog_subscribers.log volt-programmed-subscribers host=${server_ip}
- ${onos_volt_prog_subscribers} Get Binary File /tmp/onos_volt_prog_subscribers.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_volt_prog_meters.log volt-programmed-meters host=${server_ip}
- ${onos_volt_prog_meters} Get Binary File /tmp/onos_volt_prog_meters.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_volt_bp_meters.log volt-bpmeter-mappings host=${server_ip}
- ${onos_volt_bp_meters} Get Binary File /tmp/onos_volt_bp_meters.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_dhcpl2.log dhcpl2relay-allocations host=${server_ip}
- ${onos_dhcpl2} Get Binary File /tmp/onos_dhcpl2.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_aaa_users.log aaa-users host=${server_ip}
- ${onos_aaa_users} Get Binary File /tmp/onos_aaa_users.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_netcfg.log netcfg host=${server_ip}
- ${onos_netcfg} Get Binary File /tmp/onos_netcfg.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_groups.log groups host=${server_ip}
- ${onos_groups} Get Binary File /tmp/onos_groups.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_hosts.log hosts host=${server_ip}
- ${onos_hosts} Get Binary File /tmp/onos_hosts.log
- testCaseUtils.send_command_to_onos_cli /tmp onos_links.log links host=${server_ip}
- ${onos_links} Get Binary File /tmp/onos_links.log
- Log ${onos_apps}
- Log ${onos_devices}
- Log ${onos_ports}
- Log ${onos_flows}
- Log ${onos_meters}
- Log ${onos_aaa_users}
- Log ${onos_volt_prog_subscribers}
- Log ${onos_volt_prog_meters}
- Log ${onos_volt_bp_meters}
- Log ${onos_hosts}
- Log ${onos_dhcpl2}
- Log ${onos_netcfg}
- Log ${onos_groups}
- Log ${onos_links}
diff --git a/src/test/cord-api/Framework/ONU.robot b/src/test/cord-api/Framework/ONU.robot
deleted file mode 100644
index 6633273..0000000
--- a/src/test/cord-api/Framework/ONU.robot
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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 Library to check the status in ONU List
-Library Collections
-Library String
-Library OperatingSystem
-Library XML
-Library RequestsLibrary
-Library utils/utils.py
-Library restApi.py
-
-*** Keywords ***
-ONU Status Check
- [Arguments] ${onu_device}
- [Documentation] Returns "operational_status" and "admin_status" of a particular ONU device from "onu device list"
- ${json_result}= restApi.ApiGet ONU_DEVICE
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${onu_device}
- ${operational_status}= Get From Dictionary ${getJsonDict} oper_status
- ${admin_status}= Get From Dictionary ${getJsonDict} admin_state
- [Return] ${operational_status} ${admin_status}
-
-Create ONU Device
- [Arguments] ${device_list} ${list_index}
- [Documentation] Sends a POST to create an att whitelist in XOS
- ${dlist} = Get Variable Value ${device_list}
- ${onu_dictionary}= utils.listToDict ${dlist} ${list_index}
- ${api_result}= restApi.ApiPost ONU_DEVICE ${onu_dictionary}
- Should Be True ${api_result}
-
-Retrieve ONU Device
- [Arguments] ${serial_number}
- [Documentation] Returns the onu device id based on the onu's serial number
- ${json_result}= restApi.ApiGet ONU_DEVICE
- Log ${json_result}
- Log To Console ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${serial_number}
- ${id}= Get From Dictionary ${getJsonDict} id
- [Return] ${id}
-
-Delete ONU Device
- [Arguments] ${id}
- [Documentation] Sends a DELETE to delete an onu device in XOS
- ${api_result}= restApi.ApiChameleonDelete ONU_DEVICE ${id}
- Should Be True ${api_result}
-
-Validate ONU States
- [Arguments] ${expected_op_status} ${expected_admin_status} ${onu_device}
- ${operational_status} ${admin_status} ONU Status Check ${onu_device}
- Should Be Equal ${operational_status} ${expected_op_status}
- Should Be Equal ${admin_status} ${expected_admin_status}
diff --git a/src/test/cord-api/Framework/Subscriber.robot b/src/test/cord-api/Framework/Subscriber.robot
deleted file mode 100644
index e1e9044..0000000
--- a/src/test/cord-api/Framework/Subscriber.robot
+++ /dev/null
@@ -1,202 +0,0 @@
-# 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 Library of functions related to RG (source host)
-Library OperatingSystem
-Library SSHLibrary
-Library restApi.py
-Resource utils/utils.robot
-Resource DHCP.robot
-
-*** Keywords ***
-Subscriber Status Check
- [Arguments] ${onu_device}
- [Documentation] Returns Status from Subscribers List for a particular ONU device
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} onu_device ${onu_device}
- ${status}= Get From Dictionary ${getJsonDict} status
- [Return] ${status}
-
-Create Subscriber
- [Arguments] ${subscriber_list} ${list_index}
- [Documentation] Sends a POST to create a subscriber in XOS
- ${slist} = Get Variable Value ${subscriber_list}
- ${subscriber_dictionary}= utils.listToDict ${slist} ${list_index}
- ${api_result}= restApi.ApiPost VOLT_SUBSCRIBER ${subscriber_dictionary}
- Should Be True ${api_result}
- ${Subscriber_id}= Get From Dictionary ${api_result} id
- Set Global Variable ${Subscriber_id}
- [Return] ${Subscriber_id}
-
-Retrieve Subscriber
- [Arguments] ${ctag}
- [Documentation] Returns the subscriber id based on the subscriber's C-Tag
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
- Log ${json_result}
- ${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} c_tag ${ctag}
- ${id}= Get From Dictionary ${getJsonDict} id
- [Return] ${id}
-
-Delete Subscriber
- [Arguments] ${ctag}
- [Documentation] Deletes a given subscriber based on its c_tag
- ${id}= Retrieve Subscriber ${ctag}
- ${api_result}= restApi.ApiChameleonDelete VOLT_SUBSCRIBER ${id}
- Should Be True ${api_result}
-
-Validate Subscriber Status
- [Arguments] ${expected_status} ${onu_device} ${accepted_status}=${EMPTY}
- ${status} Subscriber Status Check ${onu_device}
- Run Keyword If '${accepted_status}' == '${EMPTY}' Should Be Equal ${status} ${expected_status} ELSE Should Contain Any ${status} ${expected_status} ${accepted_status}
-
-Send EAPOL Message
- [Arguments] ${iface} ${conf_file} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Executes a particular auth request on the RG via wpa_supplicant client. Requested packet should exist on src.
- Login And Run Command On Remote System rm -f /tmp/wpa.log; wpa_supplicant -B -i ${iface} -Dwired -c /etc/wpa_supplicant/${conf_file} -f /tmp/wpa.log ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Validate Authentication
- [Arguments] ${auth_pass} ${iface} ${conf_file} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Executes a particular auth request on the RG and verifies if it succeeds. auth_pass determines if authentication should pass
- Send EAPOL Message ${iface} ${conf_file} ${ip} ${user} ${pass} ${container_type} ${container_name}
- Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds 120s 2s Check Remote File Contents True /tmp/wpa.log authentication completed successfully ${ip} ${user} ${pass} ${container_type} ${container_name}
- Run Keyword If '${auth_pass}' == 'False' Sleep 20s
- Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents False /tmp/wpa.log authentication completed successfully ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Run Multicast Client
- [Arguments] ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Executes mcjoin (a simple multicast client) on the RG.
- Login And Run Command On Remote System rm -f /tmp/mcjoin.log; timeout 10 mcjoin -c 5 -i eth0 > /tmp/mcjoin.log || true ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Validate Multicast
- [Arguments] ${auth_pass} ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Executes a particular auth request on the RG and verifies if it succeeds. auth_pass determines if authentication should pass
- Run Multicast Client ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name}
- Run Keyword If '${auth_pass}' == 'True' Check Remote File Contents True /tmp/mcjoin.log Received total: 5 packets ${ip} ${user} ${pass} ${container_type} ${container_name}
- Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents True /tmp/mcjoin.log Received total: 0 packets ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Start DHCP Server on Remote Host
- [Arguments] ${interface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- ${result}= Login And Run Command On Remote System dhcpd -cf /etc/dhcp/dhcpd.conf ${interface} ${ip} ${user} ${pass} ${container_type} ${container_name}
- ## many tests running now, we should not assume the dhcp server is not already started. so ignore if this it's already started
- #Should Contain ${result} Listening on LPF/${interface}
-
-Delete IP Addresses from Interface on Remote Host
- [Arguments] ${interface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- Login And Run Command On Remote System ip addr flush dev ${interface} ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Add Double Vlan Interface on Host
- [Arguments] ${interface} ${stag} ${ctag} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- Login And Run Command On Remote System ip link add link ${interface} name ${interface}.${stag} type vlan id ${stag} ${ip} ${user} ${pass} ${container_type} ${container_name}
- Login And Run Command On Remote System ip link set ${interface}.${stag} up ${ip} ${user} ${pass} ${container_type} ${container_name}
- Login And Run Command On Remote System ip link add link ${interface}.${stag} name ${interface}.${stag}.${ctag} type vlan id ${ctag} ${ip} ${user} ${pass} ${container_type} ${container_name}
- Login And Run Command On Remote System ip link set ${interface}.${stag}.${ctag} up ${ip} ${user} ${pass} ${container_type} ${container_name}
- Login And Run Command On Remote System ifconfig ${interface}.${stag}.${ctag} ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Delete Interface on Remote Host
- [Arguments] ${interface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- Login And Run Command On Remote System ip link del ${interface} ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Add Ip Address on Interface on Host
- [Arguments] ${ip_address} ${interface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- Login And Run Command On Remote System ip addr add ${ip_address} dev ${interface} ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Add Route to Remote Host
- [Arguments] ${subnet} ${gateway} ${interface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- Login And Run Command On Remote System ip route add ${subnet} via ${gateway} dev ${interface} ${ip} ${user} ${pass} ${container_type} ${container_name}
-
-Validate DHCP and Ping
- [Arguments] ${dhcp_should_pass} ${ping_should_pass} ${src_iface} ${s_tag} ${c_tag} ${dst_dp_ip} ${src_ip} ${src_user} ${src_pass}=${None} ${src_container_type}=${None} ${src_container_name}=${None} ${dst_dp_iface}=${None} ${dst_ip}=${None} ${dst_user}=${None} ${dst_pass}=${None} ${dst_container_type}=${None} ${dst_container_name}=${None}
- Run Keyword If '${dst_ip}' != '${None}' Run Keywords
- ... Add Double Vlan Interface on Host ${dst_dp_iface} ${s_tag} ${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name} AND
- ... Add IP Address on Interface on Host ${dst_dp_ip}/24 ${dst_dp_iface}.${s_tag}.${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name} AND
- ... Start DHCP Server on Remote Host ${dst_dp_iface}.${s_tag}.${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name}
- Run Keyword If '${src_container_type}' != 'K8S' Send Dhclient Request ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
- ... ELSE Send Dhclient Request K8S
- Run Keyword If '${dhcp_should_pass}' == 'True' Wait Until Keyword Succeeds 90s 5s Check IPv4 Address on DHCP Client True ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
- Run Keyword If '${dhcp_should_pass}' == 'False' Sleep 15s
- Run Keyword If '${dhcp_should_pass}' == 'False' Check IPv4 Address on DHCP Client False ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
- Run Keyword If '${ping_should_pass}' == 'True' Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst_dp_ip} ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
- ... ELSE Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst_dp_ip} ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name}
-
-Send Dhclient Request K8S
- ${RG_CONTAINER}= Wait Until Keyword Succeeds 60s 1s Run kubectl -n voltha get pod|grep "^rg[0-]"|cut -d' ' -f1
- Run kubectl -n voltha exec ${RG_CONTAINER} -- sed -i 's/timeout 300;/timeout 30;/' /etc/dhcp/dhclient.conf
- Run kubectl -n voltha exec ${RG_CONTAINER} -- ifconfig eth0 0.0.0.0
- Run kubectl -n voltha exec ${RG_CONTAINER} -- dhclient
-
-Validate Subscriber Service Chain
- [Arguments] ${serial_no} ${expected}=True
- ${resp}= CORD Get ${VOLT_SUBSCRIBER}
- ${jsondata}= To Json ${resp.content}
- Log ${jsondata}
- ${length}= Get Length ${jsondata['items']}
- : FOR ${INDEX} IN RANGE 0 ${length}
- \ ${value}= Get From List ${jsondata['items']} ${INDEX}
- \ ${sl}= Get From Dictionary ${value} subscribed_links_ids
- \ ${result} ${slinks}= Run Keyword And Ignore Error Get From List ${sl} 0
- \ ${sn}= Get From Dictionary ${value} onu_device
- \ Run Keyword If '${sn}' == '${serial_no}' Exit For Loop
- #Run Keyword If '${expected}' == 'True' Should Be Equal As Integers ${slinks} 1 ELSE Should Be Empty ${sl}
-
-Validate Fabric CrossConnect SI
- [Arguments] ${stag} ${expected}=True
- ${resp}= CORD Get ${FABRIC_CROSSCONNECT_SERVICEINSTANCES}
- ${jsondata}= To Json ${resp.content}
- Log ${jsondata}
- ${length}= Get Length ${jsondata['items']}
- @{tags}= Create List
- : FOR ${INDEX} IN RANGE 0 ${length}
- \ ${value}= Get From List ${jsondata['items']} ${INDEX}
- \ ${tag}= Get From Dictionary ${value} s_tag
- \ Append To List ${tags} ${tag}
- #Run Keyword If '${expected}' == 'True' List Should Contain Value ${tags} ${stag} ELSE List Should Not Contain Value ${tags} ${stag}
-
-Validate Subscriber Count
- [Arguments] ${expected_no}
- ${resp}= CORD Get ${VOLT_SUBSCRIBER}
- ${jsondata}= To Json ${resp.content}
- Log ${jsondata}
- ${length}= Get Length ${jsondata['items']}
- Should Be Equal As Integers ${length} ${expected_no}
-
-Subscriber Ready to Authenticate
- [Arguments] ${onu_device}
- Wait Until Keyword Succeeds 60s 15s Validate ONU States ACTIVE ENABLED ${onu_device}
- Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING ${onu_device} ONU has been validated - Awaiting Authentication
- Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth ${onu_device}
-
-Subscriber Provisioned
- [Arguments] ${server_ip} ${onu_device} ${stag}
- Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device} ONU has been validated - Authentication succeeded
- Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
- Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
- Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS ${server_ip} ${stag} True
-
-Subscriber Service Chain Created
- [Arguments] ${onu_device} ${stag}
- Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu_device} ONU has been validated - Authentication succeeded
- Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled ${onu_device}
- Wait Until Keyword Succeeds 60s 2s Validate Subscriber Service Chain ${onu_device} True
- Wait Until Keyword Succeeds 60s 2s Validate Fabric CrossConnect SI ${stag} True
- Wait Until Keyword Succeeds 60s 2s Validate XConnect in ONOS ${server_ip} ${stag} True
-
-Validate XConnect in ONOS
- [Arguments] ${server_ip} ${stag} ${exists}=True
- ${rc}= Run And Return RC http -a karaf:karaf GET http://${server_ip}:30120/onos/segmentrouting/xconnect|jq -r '.xconnects[].vlanId'|grep ${stag}
- Run Keyword If '${exists}' == 'True' Should Be Equal As Integers ${rc} 0
- ... ELSE Should Be Equal As Integers ${rc} 1
diff --git a/src/test/cord-api/Framework/restApi.py b/src/test/cord-api/Framework/restApi.py
deleted file mode 100644
index 8e7007d..0000000
--- a/src/test/cord-api/Framework/restApi.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# 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.
-
-from __future__ import absolute_import, print_function
-
-import requests
-import json
-import os
-
-from utils.readProperties import readProperties
-
-
-class restApi(object):
- """
- Functions for testing CORD API with POST, GET, PUT, DELETE method
- """
-
- def __init__(self, propertyFile="RestApiProperties.py"):
- self.rp = readProperties(
- os.path.abspath(os.path.join(
- os.path.dirname(__file__),
- "../Properties/",
- propertyFile,
- ))
- )
- self.controllerIP = self.getValueFromProperties("SERVER_IP")
- self.controllerPort = self.getValueFromProperties("SERVER_PORT")
- self.user = self.getValueFromProperties("XOS_USER")
- self.password = self.getValueFromProperties("XOS_PASSWD")
- self.jsonHeader = {"Content-Type": "application/json"}
-
- def getValueFromProperties(self, key):
- """
- Get and return values from properties file
- """
- try:
- rawValue = self.rp.getValueProperties(key)
- value = rawValue.replace("'", "")
- except BaseException:
- value = None
-
- # Allow override from environment
- if key in os.environ:
- value = os.environ[key]
-
- return value
-
- def getURL(self, key):
- """
- Get REST API suffix from key and return the full URL
- """
- urlSuffix = self.getValueFromProperties(key)
- url = "http://" + self.controllerIP + ":" + self.controllerPort + urlSuffix
- return url
-
- def checkResult(self, resp, expectedStatus):
- """
- Check if the status code in resp equals to the expected number.
- Return True or False based on the check result.
- """
- if resp.status_code == expectedStatus:
- print("Test passed: " + str(resp.status_code) + ": " + resp.text)
- return True
- else:
- print("Test failed: " + str(resp.status_code) + ": " + resp.text)
- return False
-
- def ApiPost(self, key, jsonData):
- url = self.getURL(key)
- data = json.dumps(jsonData)
- print("url, data..", url, data)
- resp = requests.post(
- url, data=data, headers=self.jsonHeader, auth=(self.user, self.password)
- )
- print("requests.codes.....", requests.codes.created)
- passed = self.checkResult(resp, requests.codes.created) or self.checkResult(
- resp, requests.codes.ok
- )
- return passed
-
- def ApiPostReturnJson(self, key, jsonData):
- url = self.getURL(key)
- data = json.dumps(jsonData)
- print("url, data..", url, data)
- resp = requests.post(
- url, data=data, headers=self.jsonHeader, auth=(self.user, self.password)
- )
- print("requests.codes.....", requests.codes.created)
- print("posted data...", resp.json())
- passed = self.checkResult(resp, requests.codes.created) or self.checkResult(
- resp, requests.codes.ok
- )
- return passed, resp.json()
-
- def ApiGet(self, key, urlSuffix=""):
- url = self.getURL(key) + str(urlSuffix)
- print("get url...", url)
- resp = requests.get(url, auth=(self.user, self.password))
- passed = self.checkResult(resp, requests.codes.ok)
- if not passed:
- return None
- else:
- return resp.json()
-
- def ApiChameleonGet(self, key, urlSuffix=""):
- url = self.getURL(key) + "/" + str(urlSuffix)
- print("get url...", url)
- resp = requests.get(url, auth=(self.user, self.password))
- passed = self.checkResult(resp, requests.codes.ok)
- if not passed:
- return None
- else:
- return resp.json()
-
- def ApiPut(self, key, jsonData, urlSuffix=""):
- print("urlSuffix....", type(urlSuffix))
- url = self.getURL(key) + str(urlSuffix) + "/"
- data = json.dumps(jsonData)
- resp = requests.put(
- url, data=data, headers=self.jsonHeader, auth=(self.user, self.password)
- )
- passed = self.checkResult(resp, requests.codes.ok)
- return passed
-
- def ApiChameleonPut(self, key, jsonData, urlSuffix=""):
- print("urlSuffix....", type(urlSuffix))
- url = self.getURL(key) + "/" + str(urlSuffix)
- print("url", url)
- data = json.dumps(jsonData)
- resp = requests.put(
- url, data=data, headers=self.jsonHeader, auth=(self.user, self.password)
- )
- passed = self.checkResult(resp, requests.codes.ok)
- return passed
-
- def ApiDelete(self, key, urlSuffix=""):
- url = self.getURL(key) + str(urlSuffix)
- print("url", url)
- resp = requests.delete(url, auth=(self.user, self.password))
- passed = self.checkResult(resp, requests.codes.no_content)
- return passed
-
- def ApiChameleonDelete(self, key, urlSuffix=""):
- url = self.getURL(key) + "/" + str(urlSuffix)
- print("url", url)
- resp = requests.delete(url, auth=(self.user, self.password))
- passed = self.checkResult(resp, requests.codes.created) or self.checkResult(
- resp, requests.codes.ok
- )
- return passed
diff --git a/src/test/cord-api/Framework/utils/onosUtils.py b/src/test/cord-api/Framework/utils/onosUtils.py
deleted file mode 100644
index ac07dc2..0000000
--- a/src/test/cord-api/Framework/utils/onosUtils.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# 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.
-
-from __future__ import absolute_import
-
-import paramiko
-
-
-def onos_command_execute(host, portNum, cmd, user="karaf", passwd="karaf"):
- """
- :param host: onos-cord or onos-fabric
- :param portNum: 8102 or 8101
- :param cmd: command to execute
- :param user: onos/karaf
- :param passwd: onos/karaf
- :return: output of command executed inside onos karaf (shell)
- """
- try:
- client = paramiko.SSHClient()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(host, port=int(portNum), username=user, password=passwd)
- stdin, stdout, stderr = client.exec_command(cmd)
- while not stdout.channel.exit_status_ready():
- if stdout.channel.recv_ready():
- return stdout.read()
- finally:
- client.close()
-
-
-def get_compute_node_ip(compute_node):
- """
- :param compute_node: one compute node information from output of 'cordvtn-nodes'
- :return: data_ip of that compute node
- """
- for line in compute_node.splitlines():
- columns = line.split()
- if len(columns) >= 2:
- return columns[2].split("/")[0]
diff --git a/src/test/cord-api/Framework/utils/openstackUtils.py b/src/test/cord-api/Framework/utils/openstackUtils.py
deleted file mode 100644
index 3af4063..0000000
--- a/src/test/cord-api/Framework/utils/openstackUtils.py
+++ /dev/null
@@ -1,76 +0,0 @@
-
-# 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.
-
-from __future__ import absolute_import
-
-import re
-
-
-def get_neutron_lists(netlist):
- pairs = re.split(r"\+-*\+-*\+\n?", netlist)[2:-1]
- ids, names, subnets = [], [], []
- for p in pairs:
- for l in p.split('\n'):
- pair = l.split('|')
- if len(pair) > 1:
- ids.append(pair[1].strip())
- names.append(pair[2].strip())
- subnets.append(pair[3].strip())
- nets = dict(zip(names, subnets))
- return nets
-
-
-def get_nova_lists(novalist, nameWildCard=None):
- pairs = re.split(r"\+-*\+-*\+\n?", novalist)[2:-1]
- ids, names, status, taskState, powerState, networks = [], [], [], [], [], []
- for p in pairs:
- for l in p.split('\n'):
- pair = l.split('|')
- if len(pair) > 1:
- ids.append(pair[1].strip())
- names.append(pair[2].strip())
- status.append(pair[3].strip())
- taskState.append(pair[4].strip())
- powerState.append(pair[5].strip())
- networks.append(pair[6].strip())
- instances = dict(zip(names, networks))
- if nameWildCard is not None:
- for key in instances.keys():
- if re.match(nameWildCard, key):
- return instances[key]
- else:
- return instances
-
-
-def get_instance_status(novalist, nameWildCard=None):
- pairs = re.split(r"\+-*\+-*\+\n?", novalist)[2:-1]
- ids, names, status, taskState, powerState, networks = [], [], [], [], [], []
- for p in pairs:
- for l in p.split('\n'):
- pair = l.split('|')
- if len(pair) > 1:
- ids.append(pair[1].strip())
- names.append(pair[2].strip())
- status.append(pair[3].strip())
- taskState.append(pair[4].strip())
- powerState.append(pair[5].strip())
- networks.append(pair[6].strip())
- instances = dict(zip(names, status))
- if nameWildCard is not None:
- for key in instances.keys():
- if re.match(nameWildCard, key):
- return instances[key]
- else:
- return instances
diff --git a/src/test/cord-api/Framework/utils/readProperties.py b/src/test/cord-api/Framework/utils/readProperties.py
deleted file mode 100644
index b778dbb..0000000
--- a/src/test/cord-api/Framework/utils/readProperties.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# 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.
-
-from __future__ import absolute_import
-
-import sys
-
-
-class readProperties(object):
- def __init__(self, strPropertiesFile):
- self.strPropertiesFile = strPropertiesFile
-
- @staticmethod
- def parse_line(input):
- key, value = input.split("=", 1)
- key = key.strip()
- value = value.strip()
- return key, value
-
- @staticmethod
- def getProperties(self):
- data = {}
-
- with open(self.strPropertiesFile) as fp:
- for line in fp:
- line = line.strip()
- if not line or line.startswith("#") or line.startswith("import"):
- continue
-
- key, value = readProperties.parse_line(line)
- data[key] = value
-
- return data
-
- def getValueProperties(self, key):
- datas = readProperties.getProperties(self)
- value = datas[key]
- return value
-
-
-# test
-# test = readProperties("testProperties.py")
-# test.getValueProperties("CORE_INSTANCES")
diff --git a/src/test/cord-api/Framework/utils/testCaseUtils.py b/src/test/cord-api/Framework/utils/testCaseUtils.py
deleted file mode 100755
index 1d2d021..0000000
--- a/src/test/cord-api/Framework/utils/testCaseUtils.py
+++ /dev/null
@@ -1,246 +0,0 @@
-#
-# Copyright 2018 the original author or authors.
-#
-# 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.
-#
-
-"""
-Test Case Utils module
-"""
-
-from __future__ import absolute_import
-
-import time
-import subprocess
-import pexpect
-import sys
-
-
-def config_dirs(self, log_dir, root_dir=None, voltha_dir=None):
- self.dirs["log"] = log_dir
- self.dirs["root"] = root_dir
- self.dirs["voltha"] = voltha_dir
-
-
-def get_dir(self, directory):
- return self.dirs.get(directory)
-
-
-def remove_leading_line(log_dir, log_file):
- with open(log_dir + "/" + log_file, "r+") as FILE:
- lines = FILE.readlines()
- FILE.seek(0)
- lines = lines[1:]
- for line in lines:
- FILE.write(line)
- FILE.truncate()
- FILE.close()
-
-
-def send_command_to_voltha_cli(
- log_dir,
- log_file1,
- cmd1,
- log_file2=None,
- cmd2=None,
- log_file3=None,
- cmd3=None,
- host="localhost",
-):
- output = open(log_dir + "/" + log_file1, "wb")
- child = pexpect.spawn(
- "ssh -p 30110 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no voltha@%s"
- % host
- )
- child.expect(r"[pP]assword:")
- child.sendline("admin")
- child.expect(r"\((\x1b\[\d*;?\d+m){1,2}voltha(\x1b\[\d*;?\d+m){1,2}\)")
- time.sleep(10)
- child.sendline(cmd1)
- i = child.expect(
- [
- r"\((\x1b\[\d*;?\d+m){1,2}voltha(\x1b\[\d*;?\d+m){1,2}\)",
- r"\((\x1b\[\d*;?\d+m){1,2}.*device [0-9a-f]{16}(\x1b\[\d*;?\d+m){1,2}\)",
- ]
- )
- if i == 0:
- output.write(child.before)
- output.close()
- remove_leading_line(log_dir, log_file1)
- elif i == 1:
- if log_file2 is not None and cmd2 is not None:
- output = open(log_dir + "/" + log_file2, "wb")
- child.sendline(cmd2)
- child.expect(
- r"\((\x1b\[\d*;?\d+m){1,2}.*device [0-9a-f]{16}(\x1b\[\d*;?\d+m){1,2}\)"
- )
- output.write(child.before)
- output.close()
- remove_leading_line(log_dir, log_file2)
- if log_file3 is not None and cmd3 is not None:
- output = open(log_dir + "/" + log_file3, "wb")
- child.sendline(cmd3)
- child.expect(
- r"\((\x1b\[\d*;?\d+m){1,2}.*device [0-9a-f]{16}(\x1b\[\d*;?\d+m){1,2}\)"
- )
- output.write(child.before)
- output.close()
- remove_leading_line(log_dir, log_file3)
- child.close()
-
-
-def send_command_to_onos_cli(log_dir, log_file, cmd, host="localhost"):
- output = open(log_dir + "/" + log_file, "wb")
- child = pexpect.spawn(
- "ssh -p 30115 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no karaf@%s"
- % host
- )
- child.expect(r"[pP]assword:")
- child.sendline("karaf")
- # Expected prompt:
- # onos> (ONOS 1.x)
- # karaf@root > (ONOS 2.x)
- child.expect([r'(\x1b\[\d*;?\d+m){1,2}onos> (\x1b\[\d*;?\d+m){1,2}', r'karaf@root >'])
- child.sendline(cmd)
- child.expect([r'(\x1b\[\d*;?\d+m){1,2}onos> (\x1b\[\d*;?\d+m){1,2}', r'karaf@root >'])
-
- output.write(child.before)
-
- output.close()
- child.close()
-
-
-def get_fields_from_grep_command(self, search_word, log_file):
- grepCommand = "grep %s %s/%s" % (search_word, get_dir(self, "log"), log_file)
- statusLines = subprocess.getstatusoutput(grepCommand)[1]
- return statusLines
-
-
-def parse_fields(status_line, delimiter):
- statusList = status_line.split(delimiter)
- return statusList
-
-
-def print_log_file(self, log_file):
- with open(get_dir(self, "log") + "/" + log_file, "r+") as FILE:
- lines = FILE.readlines()
- print
- for line in lines:
- sys.stdout.write(line)
-
-
-def extract_pod_ip_addr(pod_name):
- proc1 = subprocess.Popen(
- ["/usr/bin/kubectl", "get", "svc", "--all-namespaces"],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- proc2 = subprocess.Popen(
- ["grep", "-e", pod_name],
- stdin=proc1.stdout,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- proc3 = subprocess.Popen(
- ["awk", "{print $4}"],
- stdin=proc2.stdout,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
-
- proc1.stdout.close()
- proc2.stdout.close()
- out, err = proc3.communicate()
- return out
-
-
-def extract_radius_ip_addr(pod_name):
- proc1 = subprocess.Popen(
- ["/usr/bin/kubectl", "describe", "pod", "-n", "voltha", pod_name],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- proc2 = subprocess.Popen(
- ["grep", "^IP:"],
- stdin=proc1.stdout,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- proc3 = subprocess.Popen(
- ["awk", "{print $2}"],
- stdin=proc2.stdout,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
-
- proc1.stdout.close()
- proc2.stdout.close()
- out, err = proc3.communicate()
- return out
-
-
-def extract_pod_name(short_pod_name):
- proc1 = subprocess.Popen(
- ["/usr/bin/kubectl", "get", "pods", "--all-namespaces"],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- proc2 = subprocess.Popen(
- ["grep", "-e", short_pod_name],
- stdin=proc1.stdout,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- proc3 = subprocess.Popen(
- ["awk", "{print $2}"],
- stdin=proc2.stdout,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
-
- proc1.stdout.close()
- proc2.stdout.close()
- out, err = proc3.communicate()
- return out
-
-
-def modify_radius_ip_in_json_using_sed(self, new_ip_addr):
- sedCommand = (
- "sed -i '/radiusIp/c\\ \"radiusIp\":\"'%s'\",' %s/tests/atests/build/aaa_json"
- % (new_ip_addr, get_dir(self, "voltha"))
- )
- status = subprocess.getstatusoutput(sedCommand)[0]
- return status
-
-
-def discover_rg_pod_name():
- return extract_pod_name("rg0").strip()
-
-
-def retrieve_authorized_users_device_id_and_port_number(status_line):
- fields = parse_fields(status_line, ",")
- deviceField = fields[2].strip()
- deviceStr, equal, deviceId = deviceField.partition("=")
- device_Id = deviceId
- portField = fields[4].strip()
- portNumStr, equal, portNum = portField.partition("=")
- portNumber = portNum
- return device_Id, portNumber
-
-
-def add_subscriber_access(self, device_id, port_number):
- send_command_to_onos_cli(
- get_dir(self, "log"),
- "voltha_add_subscriber_access.log",
- "volt-add-subscriber-access %s %s" % (device_id, port_number),
- )
diff --git a/src/test/cord-api/Framework/utils/utils.py b/src/test/cord-api/Framework/utils/utils.py
deleted file mode 100644
index b475c06..0000000
--- a/src/test/cord-api/Framework/utils/utils.py
+++ /dev/null
@@ -1,329 +0,0 @@
-# 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.
-
-from __future__ import absolute_import, print_function
-
-import json
-import uuid
-import random
-import yaml
-import glob
-import string
-
-
-class utils(object):
- @staticmethod
- def listToDict(alist, intListIndex):
- dictInfo = alist[int(intListIndex)]
- return dictInfo
-
- @staticmethod
- def jsonToList(strFile, strListName):
- data = json.loads(open(strFile).read())
- # print "data...",data
- dataList = data[strListName]
- return dataList
-
- def readFile(self, path, single=True):
- dataDict = {}
- for fileName in glob.glob(path):
- print("Reading ", fileName)
- data = open(fileName).read()
- dataDict[fileName] = data
- if bool(single):
- return data
- if not dataDict:
- print("Failed to find the file!")
- return None
- return dataDict
-
- def readFiles(self, path):
- return self.readFile(path, single=False)
-
- """
- @method compare_dict
- @Description: validates if contents of dict1 exists in dict2
- @params: dict1 = input_data entered through api
- dict2 = retrieved data from GET method
- returns True if contents of dict1 exists in dict2
- """
-
- def compare_dict(self, dict1, dict2):
- print("input data", dict1)
- print("get data", dict2)
- if dict1 is None or dict2 is None:
- return False
- if not isinstance(dict1, dict) or not isinstance(dict2, dict):
- return False
- if dict1 == {}:
- return True
- return self.compare_dict_recursive(dict1, dict2)
-
- """
- @method compare_dict_recursive
- @Description: recursive function to validate if dict1 is a subset of dict2
- returns True if contents of dict1 exists in dict2
- """
-
- def compare_dict_recursive(self, dict1, dict2):
- for key1, value1 in dict1.items():
- if key1 not in dict2.keys():
- print("Missing key", key1, "in dict2")
- return False
- value2 = dict2[key1]
- if isinstance(value1, dict) and isinstance(value2, dict):
- if not self.compare_dict_recursive(value1, value2):
- return False
- else:
- if value2 != value1:
- print("Values of key", key1, "in two dicts are not equal")
- return False
- return True
-
- """
- @method compare_list_of_dicts
- @Description: validates if contents of dicts in list1 exists in dicts of list2
- returns True if for each dict in list1, there's a dict in list2 that contains its content
- """
-
- def compare_list_of_dicts(self, list1, list2):
- for dict1 in list1:
- if dict1 == {}:
- continue
- key = dict1.keys()[0]
- value = dict1[key]
- dict2 = self.getDictFromListOfDict(list2, key, value)
- if dict2 == {}:
- print(
- "Comparison failed: no dictionaries found in list2 with key",
- key,
- "and value",
- value,
- )
- return False
- if not self.compare_dict(dict1, dict2):
- print(
- "Comparison failed: dictionary",
- dict1,
- "is not a subset of dictionary",
- dict2,
- )
- return False
- return True
-
- """
- @method search_dictionary
- @Description: Searches for a key in the provided nested dictionary
- @params: input_dict = dictionary to be searched
- search_key = name of the key to be searched for
- returns two values: search_key value and status of the search.
- True if found (False when not found)
-
- """
-
- def search_dictionary(self, input_dict, search_key):
- input_keys = input_dict.keys()
- key_value = ""
- found = False
- for key in input_keys:
- if key == search_key:
- key_value = input_dict[key]
- found = True
- break
- elif isinstance(input_dict[key], dict):
- key_value, found = self.search_dictionary(
- input_dict[key], search_key)
- if found:
- break
- elif isinstance(input_dict[key], list):
- if not input_dict[key]:
- found = False
- break
- for item in input_dict[key]:
- if isinstance(item, dict):
- key_value, found = self.search_dictionary(
- item, search_key)
- if found:
- break
- return key_value, found
-
- """
- @method getDictFromListOfDict
- return key_value,found
- @Description: Searches for the dictionary in the provided list of dictionaries
- that matches the value of the key provided
- @params : List of dictionaries(getResponse Data from the URL),
- SearchKey - Key that needs to be searched for (ex: account_num)
- searchKeyValue - Value of the searchKey (ex: 21)
- @Returns: Dictionary returned when match found for searchKey with the corresponding
- searchKeyValue provided
- """
-
- def getDictFromListOfDict(self, getJsonDataList,
- searchKey, searchKeyValue):
- return_dict = {}
- result = ""
- for data in getJsonDataList:
- print("data", data)
- return_dict = {}
- found = False
- input_keys = data.keys()
- for key in input_keys:
- if key == searchKey and str(data[key]) == str(searchKeyValue):
- found = True
- return_dict = data
- print("return_dict", return_dict)
- break
- elif isinstance(data[key], dict):
- result, found = self.search_dictionary(
- data[key], searchKey)
- if found and str(result) == str(searchKeyValue):
- return_dict = data
- break
- elif isinstance(data[key], list):
- for item in data[key]:
- if isinstance(item, dict):
- result, found = self.search_dictionary(
- data[key], searchKey)
- if found and str(
- result) == str(searchKeyValue):
- return_dict = data
- break
- if return_dict:
- break
- return return_dict
-
- """
- @method getFieldValueFromDict
- @params : search_dict - Dictionary to be searched
- field - Key to be searched for (ex: account_num)
- @Returns: Returns the value of the Key that was provided
- """
-
- def getFieldValueFromDict(self, search_dict, field):
- results = ""
- found = False
- input_keys = search_dict.keys()
- for key in input_keys:
- print("key...", key)
- if key == field:
- results = search_dict[key]
- if not results:
- found = True
- break
- elif isinstance(search_dict[key], dict):
- results, found = self.search_dictionary(
- search_dict[key], field)
- if found:
- break
- elif isinstance(search_dict[key], list):
- if not search_dict[key]:
- found = False
- continue
- for item in search_dict[key]:
- if isinstance(item, dict):
- results, found = self.search_dictionary(item, field)
- if found:
- break
- if results:
- break
-
- return results
-
- def setFieldValueInDict(self, input_dict, field, field_value):
- input_dict[field] = field_value
- return input_dict
-
- """
- @method getAllFieldValues
- @params : getJsonDataDictList - List of dictionaries to be searched
- fieldName - Key to be searched for (ex: instance_id)
- @Returns: Returns the unique value of the Key that was provided
- """
-
- def getAllFieldValues(self, getJsonDataDictList, fieldName):
- value_list = []
- uniqValue = ""
- uniq_list = []
- for data in getJsonDataDictList:
- fieldValue = ""
- fieldValue = self.getFieldValueFromDict(data, fieldName)
- value_list.append(fieldValue)
- uniq_list = sorted(set(value_list))
- if len(uniq_list) == 1:
- uniqValue = uniq_list[0]
- else:
- print("list of values found for ", fieldName, ";", uniq_list)
- return fieldValue
-
- def generate_uuid(self):
- return uuid.uuid4()
-
- def generate_random_number_from_blacklist(
- self, blacklist, min=100, max=500, typeTag=False
- ):
- num = None
- while num in blacklist or num is None:
- num = random.randrange(int(min), int(max))
- if typeTag:
- return num
- else:
- return str(num)
-
- def get_dynamic_resources(self, inputfile, resource):
- resourceNames = []
- names = {}
- dnames = []
- with open(inputfile, "r") as f:
- contents = yaml.load(f)
- resources = contents[resource]
- for i in resources:
- resourceNames.append(i["name"])
- for i in resourceNames:
- names["name"] = i
- dnames.append(names.copy())
- return dnames
-
- def generate_random_value(
- self, value, max_length=10, min_int=1, max_int=10000):
- if value == "string":
- return "".join(
- random.choice(string.ascii_lowercase + string.digits)
- for _ in range(max_length)
- )
- if value == "bool":
- return random.choice([True, False])
- if value == "int32" or value == "uint32":
- return random.randint(min_int, max_int)
- if value == "float":
- return random.uniform(1, 10)
- if value == "role":
- return "admin"
- if value == "direction":
- return random.choice(["in", "out"])
- if value == "flavor":
- return random.choice(["m1.large", "m1.medium", "m1.small"])
- if value == "vlan_tag":
- return random.choice(["555", "1-4096", "ANY"])
- if value == "ip_address":
- return ".".join(str(random.randint(0, 255)) for _ in range(4))
- else:
- return None
-
- def generate_random_slice_name(self):
- random_name = "".join(
- random.choice(
- string.ascii_lowercase +
- string.digits) for _ in range(10))
- return "testloginbase" + random_name
diff --git a/src/test/cord-api/Framework/utils/utils.robot b/src/test/cord-api/Framework/utils/utils.robot
deleted file mode 100644
index 4a2b58b..0000000
--- a/src/test/cord-api/Framework/utils/utils.robot
+++ /dev/null
@@ -1,274 +0,0 @@
-# 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 Library for various utilities
-Library SSHLibrary
-Library String
-Library DateTime
-Library Process
-Library Collections
-Library RequestsLibrary
-
-*** Keywords ***
-Login And Run Command On Remote System
- [Arguments] ${cmd} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None} ${prompt}=~$ ${prompt_timeout}=50s ${container_prompt}=#
- [Documentation] SSH's into a remote host (and logs into the container if container_type and container_name are specified), tries to switch to root user and executes a command and returns output
- ${conn_id} Login To Remote System ${ip} ${user} ${pass} ${container_type} ${container_name} ${prompt} ${prompt_timeout} ${container_prompt}
- ${output}= Run Command On Remote System ${cmd} ${conn_id} ${user} ${pass}
- Log ${output}
- Logout From Remote System ${conn_id}
- [Return] ${output}
-
-Login To Remote System
- [Arguments] ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None} ${prompt}=~$ ${prompt_timeout}=15s ${container_prompt}=#
- [Documentation] SSH's into a remote host (and logs into the container if container_type and container_name are specified) and returns connection ID
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- Run Keyword If '${pass}' != '${None}' SSHLibrary.Login ${user} ${pass}
- ... ELSE SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa
- # Login to the lxc container
- Run Keyword If '${container_type}' == 'LXC' Run Keywords
- ... SSHLibrary.Write lxc exec ${container_name} /bin/bash AND
- ... SSHLibrary.Read Until ${container_prompt} AND
- ... SSHLibrary.Set Client Configuration prompt=${container_prompt}
- # Login to the k8s container
- Run Keyword If '${container_type}' == 'K8S' Run Keywords
- ... SSHLibrary.Write kubectl -n $(kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}') exec ${container_name} -it /bin/bash AND
- ... SSHLibrary.Read Until ${container_prompt} AND
- ... SSHLibrary.Set Client Configuration prompt=${container_prompt}
- # Try to switch to root user
- ${conn}= SSHLibrary.Get Connection ${conn_id}
- Run Keyword And Ignore Error SSHLibrary.Write sudo -s
- ${output}= SSHLibrary.Read Until Regexp \#|${conn.prompt}|password for ${user}:
- Run Keyword If 'password for ${user}:' not in '''${output}''' Return From Keyword ${conn_id}
- SSHLibrary.Set Client Configuration prompt=\#
- SSHLibrary.Write ${pass}
- SSHLibrary.Read Until Prompt
- [Return] ${conn_id}
-
-Logout From Remote System
- [Arguments] ${conn_id}
- [Documentation] Exit from the SSH session to a remote host
- SSHLibrary.Switch Connection ${conn_id}
- SSHLibrary.Close Connection
-
-Run Command On Remote System
- [Arguments] ${cmd} ${conn_id} ${user} ${pass}=${None}
- [Documentation] Executes a command on remote host and returns output
- ${conn}= SSHLibrary.Get Connection ${conn_id}
- SSHLibrary.Switch Connection ${conn_id}
- SSHLibrary.Write ${cmd}
- ${output}= SSHLibrary.Read Until Regexp ${conn.prompt}|password for ${user}:
- Run Keyword If 'password for ${user}:' not in '''${output}''' Return From Keyword ${output}
- SSHLibrary.Write ${pass}
- ${output}= SSHlibrary.Read Until Prompt
- [Return] ${output}
-
-Execute Command on CIAB Server in Specific VM
- [Arguments] ${system} ${vm} ${cmd} ${user}=${VM_USER} ${password}=${VM_PASS} ${prompt}=$ ${use_key}=True ${strip_line}=True
- [Documentation] SSHs into ${HOST} where CIAB is running and executes a command in the Prod Vagrant VM where all the containers are running
- ${conn_id}= SSHLibrary.Open Connection ${system} prompt=${prompt} timeout=300s
- Run Keyword If '${use_key}' == 'False' SSHLibrary.Login ${user} ${pass} ELSE SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/${SSH_KEY} any
- SSHLibrary.Write ssh ${vm}
- SSHLibrary.Read Until Prompt
- SSHLibrary.Write ${cmd}
- ${output}= SSHLibrary.Read Until Prompt
- SSHLibrary.Close Connection
- ${output_1}= Run Keyword If '${strip_line}' == 'True' Get Line ${output} 0
- ${output}= Set Variable If '${strip_line}' == 'True' ${output_1} ${output}
- [Return] ${output}
-
-Execute Command on Compute Node in CIAB
- [Arguments] ${system} ${node} ${hostname} ${cmd} ${user}=${VM_USER} ${password}=${VM_PASS} ${prompt}=$ ${use_key}=True
- [Documentation] SSHs into ${HOST} where CIAB is running and executes a command in the Prod Vagrant VM where all the containers are running
- ${conn_id}= SSHLibrary.Open Connection ${system} prompt=${prompt} timeout=300s
- Run Keyword If '${use_key}' == 'False' SSHLibrary.Login ${user} ${pass} ELSE SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/${SSH_KEY} any
- SSHLibrary.Write ssh ${node}
- SSHLibrary.Read Until Prompt
- SSHLibrary.Write ssh root@${hostname}
- SSHLibrary.Read Until \#
- SSHLibrary.Write ${cmd}
- ${output}= SSHLibrary.Read Until \#
- SSHLibrary.Close Connection
- [Return] ${output}
-
-Execute Command Locally
- [Arguments] ${cmd}
- ${output}= Run ${cmd}
- [Return] ${output}
-
-Execute ONOS Command
- [Arguments] ${onos} ${port} ${cmd} ${user}=karaf ${pass}=karaf
- ${conn_id}= SSHLibrary.Open Connection ${onos} port=${port} prompt=onos> timeout=300s
- SSHLibrary.Login ${user} ${pass}
- ${output}= SSHLibrary.Execute Command ${cmd}
- SSHLibrary.Close Connection
- [Return] ${output}
-
-Get Docker Container ID
- [Arguments] ${container_name}
- [Documentation] Retrieves the id of the requested docker container running inside headnode
- ${container_id}= Run docker ps | grep ${container_name} | awk '{print $1}'
- Log ${container_id}
- [Return] ${container_id}
-
-Get Docker Logs
- [Arguments] ${system} ${container_id} ${user}=${USER} ${password}=${PASSWD} ${prompt}=prod:~$
- [Documentation] Retrieves the id of the requested docker container running inside given ${HOST}
- ##In Ciab, all containers are run in the prod vm so we must log into that
- ${conn_id}= SSHLibrary.Open Connection ${system} prompt=$ timeout=300s
- SSHLibrary.Login With Public Key ${USER} %{HOME}/.ssh/${SSH_KEY} any
- #SSHLibrary.Login ${HOST_USER} ${HOST_PASSWORD}
- SSHLibrary.Write ssh head1
- SSHLibrary.Read Until ${prompt}
- SSHLibrary.Write docker logs -t ${container_id}
- ${container_logs}= SSHLibrary.Read Until ${prompt}
- SSHLibrary.Close Connection
- Log ${container_logs}
- [Return] ${container_logs}
-
-Remove Value From List
- [Arguments] ${list} ${val}
- ${length}= Get Length ${list}
- : FOR ${INDEX} IN RANGE 0 ${length}
- \ Log ${list[${INDEX}]}
- \ ${value}= Get Dictionary Values ${list[${INDEX}]}
- \ Log ${value[0]}
- \ Run Keyword If '${value[0]}' == '${val}' Remove From List ${list} ${INDEX}
- \ Run Keyword If '${value[0]}' == '${val}' Exit For Loop
-
-Test Ping
- [Arguments] ${status} ${src} ${user} ${pass} ${dest} ${interface} ${prompt}=$ ${prompt_timeout}=60s
- [Documentation] SSH's into src and attempts to ping dest. Status determines if ping should pass | fail
- ${conn_id}= SSHLibrary.Open Connection ${src} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- ${result}= SSHLibrary.Execute Command ping -I ${interface} -c 5 ${dest}
- SSHLibrary.Close Connection
- Log ${result}
- Run Keyword If '${status}' == 'PASS' Should Contain ${result} 64 bytes
- Run Keyword If '${status}' == 'PASS' Should Contain ${result} 0% packet loss
- Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} 100% packet loss
- Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} 80% packet loss
- Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} 60% packet loss
- Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} 40% packet loss
- Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} 20% packet loss
- Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} Destination Host Unreachable
- Run Keyword If '${status}' == 'FAIL' Should Not Contain ${result} 64 bytes
- Run Keyword If '${status}' == 'FAIL' Should Contain ${result} 100% packet loss
- Log To Console \n ${result}
-
-Clean Up Objects
- [Arguments] ${model_api}
- @{ids}= Create List
- ${resp}= CORD Get ${model_api}
- ${jsondata}= To Json ${resp.content}
- Log ${jsondata}
- ${length}= Get Length ${jsondata['items']}
- : FOR ${INDEX} IN RANGE 0 ${length}
- \ ${value}= Get From List ${jsondata['items']} ${INDEX}
- \ ${id}= Get From Dictionary ${value} id
- \ Append To List ${ids} ${id}
- : FOR ${i} IN @{ids}
- \ CORD Delete ${model_api} ${i}
-
-CORD Get
- [Documentation] Make a GET call to XOS
- [Arguments] ${service}
- ${resp}= Get Request ${server_ip} ${service}
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
- [Return] ${resp}
-
-CORD Post
- [Documentation] Make a POST call to XOS
- [Arguments] ${service} ${data}
- ${data}= Evaluate json.dumps(${data}) json
- ${resp}= Post Request ${SERVER_IP} uri=${service} data=${data}
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
- [Return] ${resp}
-
-CORD Put
- [Documentation] Make a PUT call to XOS
- [Arguments] ${service} ${data} ${data_id}
- ${data}= Evaluate json.dumps(${data}) json
- ${resp}= Put Request ${SERVER_IP} uri=${service}/${data_id} data=${data}
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
- Set Suite Variable ${id}
- [Return] ${resp}
-
-CORD Delete
- [Documentation] Make a DELETE call to XOS
- [Arguments] ${service} ${data_id}
- ${resp}= Delete Request ${SERVER_IP} uri=${service}/${data_id}
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
- [Return] ${resp}
-
-Get Service Owner Id
- [Arguments] ${service}
- ${resp}= CORD Get ${service}
- ${jsondata}= To Json ${resp.content}
- log ${jsondata}
- ${length}= Get Length ${jsondata['items']}
- : for ${INDEX} IN RANGE 0 ${length}
- \ ${value}= Get From List ${jsondata['items']} ${INDEX}
- \ ${id}= Get From Dictionary ${value} id
- [Return] ${id}
-
-Kill Linux Process
- [Arguments] ${process} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- ${rc}= Login And Run Command On Remote System kill $(ps aux | grep '${process}' | awk '{print $2}'); echo $? ${ip} ${user} ${pass} ${container_type} ${container_name}
- Should Be Equal As Integers ${rc} 0
-
-Check Remote File Contents
- [Arguments] ${file_should_exist} ${file} ${pattern} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None} ${prompt}=~$
- ${output}= Login And Run Command On Remote System cat ${file} | grep '${pattern}' ${ip} ${user} ${pass} ${container_type} ${container_name} ${prompt}
- Run Keyword If '${file_should_exist}' == 'True' Should Contain ${output} ${pattern}
- ... ELSE Should Not Contain ${output} ${pattern}
-
-Check Ping
- [Arguments] ${ping_should_pass} ${dst_ip} ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- ${result}= Login And Run Command On Remote System ping -I ${iface} -c 3 ${dst_ip} ${ip} ${user} ${pass} ${container_type} ${container_name}
- Check Ping Result ${ping_should_pass} ${result}
-
-Check Remote System Reachability
- [Arguments] ${reachable} ${ip}
- [Documentation] Check if the specified IP address is reachable or not
- ${result}= Run ping -c 3 ${ip}
- Check Ping Result ${reachable} ${result}
-
-Check Ping Result
- [Arguments] ${reachable} ${result}
- Run Keyword If '${reachable}' == 'True' Should Contain ${result} 64 bytes
- Run Keyword If '${reachable}' == 'True' Should Contain Any ${result} 0% packet loss 0.0% packet loss
- Run Keyword If '${reachable}' == 'True' Should Not Contain Any ${result} 100% packet loss 100.0% packet loss
- Run Keyword If '${reachable}' == 'False' Should Not Contain ${result} 64 bytes
- Run Keyword If '${reachable}' == 'False' Should Contain Any ${result} 100% packet loss 100.0% packet loss
-
-Set Deployment Config Variables
- [Documentation] Parses through the given deployment config and sets all the "src" and "dst" variables
- ${source}= Evaluate ${hosts}.get("src")
- ${length_src}= Get Length ${source}
- ${src}= Set Variable src
- : FOR ${INDEX} IN RANGE 0 ${length_src}
- \ Set Suite Variable ${${src}${INDEX}} ${source[${INDEX}]}
- ${destination}= Evaluate ${hosts}.get("dst")
- ${length_dst}= Get Length ${destination}
- ${dst}= Set Variable dst
- : FOR ${INDEX} IN RANGE 0 ${length_dst}
- \ Set Suite Variable ${${dst}${INDEX}} ${destination[${INDEX}]}
-
diff --git a/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt b/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt
index d9a33ae..d875fc2 100644
--- a/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt
+++ b/src/test/cord-api/MCORD-Tests/EPCInstanceTest.txt
@@ -7,8 +7,9 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py MCORD_RestApiProperties.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
+Library MCORD_RestApiProperties.py
*** Variables ***
${USER} admin
@@ -23,7 +24,7 @@
*** Keywords ***
Read InputFile
- ${EPCList} = utils.jsonToList ${PATHFILE} EPCInfo
+ ${EPCList} = CORDRobot.jsonToList ${PATHFILE} EPCInfo
Set Suite Variable ${elist} ${EPCList}
@{vepc_instanceList}= Create List mysite_venb mysite_vspgwc mysite_vspgwu
@{instanceList}= Create List
@@ -38,20 +39,20 @@
Test Post EPC Create
[Arguments] ${listIndex}
${EPCList} = Get Variable Value ${elist}
- ${InputDict}= utils.listToDict ${EPCList} ${listIndex}
- ${api_result}= restApi.ApiPost EPC_INSTANCES ${InputDict}
- ${site_id}= utils.getFieldValueFromDict ${InputDict} site_id
- ${json_result}= restApi.ApiGet EPC_INSTANCES
+ ${InputDict}= CORDRobot.listToDict ${EPCList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost EPC_INSTANCES ${InputDict}
+ ${site_id}= CORDRobot.getFieldValueFromDict ${InputDict} site_id
+ ${json_result}= CORDRobot.ApiGet EPC_INSTANCES
Log ${json_result}
${json_result_list}= Get From Dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} site_id ${site_id}
- ${result}= utils.compare_dict ${InputDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} site_id ${site_id}
+ ${result}= CORDRobot.compare_dict ${InputDict} ${getJsonDict}
Should Be True ${result}
Sleep 30s
Test Instance Validation
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CORE_INSTANCES
+ ${get_result}= CORDRobot.ApiGet CORE_INSTANCES
Should Be True ${get_result}
${get_result_List}= Get From Dictionary ${get_result} items
: FOR ${Item} IN @{get_result_List}
diff --git a/src/test/cord-api/Properties/ECORD_RestApiProperties.py b/src/test/cord-api/Properties/ECORD_RestApiProperties.py
index b165b5d..e56f369 100644
--- a/src/test/cord-api/Properties/ECORD_RestApiProperties.py
+++ b/src/test/cord-api/Properties/ECORD_RestApiProperties.py
@@ -1,4 +1,3 @@
-
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,8 +14,6 @@
# REST APIs for testing control plane functionalities of ECORD (global and local)
-#!/usr/bin/env python
-
SERVER_IP = 'c220g2-011013.wisc.cloudlab.us'
SERVER_PORT = '8080'
USER = 'xosadmin@opencord.org'
diff --git a/src/test/cord-api/Properties/MCORD_RestApiProperties.py b/src/test/cord-api/Properties/MCORD_RestApiProperties.py
index e25db98..674403f 100644
--- a/src/test/cord-api/Properties/MCORD_RestApiProperties.py
+++ b/src/test/cord-api/Properties/MCORD_RestApiProperties.py
@@ -1,4 +1,3 @@
-
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,8 +14,6 @@
# REST APIs for testing control plane functionalities in MCORD
-#!/usr/bin/env python
-
SERVER_IP = 'clnode103.clemson.cloudlab.us'
SERVER_PORT = '8080'
USER = 'xosadmin@opencord.org'
diff --git a/src/test/cord-api/Properties/RestApiProperties.py b/src/test/cord-api/Properties/RestApiProperties.py
index 0767de7..cb562c1 100644
--- a/src/test/cord-api/Properties/RestApiProperties.py
+++ b/src/test/cord-api/Properties/RestApiProperties.py
@@ -68,4 +68,4 @@
ATT_SERVICE = '/xosapi/v1/att-workflow-driver/attworkflowdriverservices'
ATT_WHITELIST = '/xosapi/v1/att-workflow-driver/attworkflowdriverwhitelistentries'
ATT_SERVICEINSTANCES = '/xosapi/v1/att-workflow-driver/attworkflowdriverserviceinstances'
-FABRIC_CROSSCONNECT_SERVICEINSTANCES='/xosapi/v1/fabric-crossconnect/fabriccrossconnectserviceinstances'
+FABRIC_CROSSCONNECT_SERVICEINSTANCES = '/xosapi/v1/fabric-crossconnect/fabriccrossconnectserviceinstances'
diff --git a/src/test/cord-api/Tests/BBSim/BBSIMScale.robot b/src/test/cord-api/Tests/BBSim/BBSIMScale.robot
index 3c3b03f..4d5f8a3 100644
--- a/src/test/cord-api/Tests/BBSim/BBSIMScale.robot
+++ b/src/test/cord-api/Tests/BBSim/BBSIMScale.robot
@@ -22,14 +22,10 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
+Library CORDRobot
Library bbsim_utils.py
-Library ../../Framework/utils/utils.py
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
diff --git a/src/test/cord-api/Tests/Ch_DefaultServiceCheck.txt b/src/test/cord-api/Tests/Ch_DefaultServiceCheck.txt
index 3f58cc2..b27315a 100644
--- a/src/test/cord-api/Tests/Ch_DefaultServiceCheck.txt
+++ b/src/test/cord-api/Tests/Ch_DefaultServiceCheck.txt
@@ -7,9 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
-Resource ../Framework/utils/utils.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PROFILE} mock-rcord
@@ -21,13 +20,13 @@
*** Keywords ***
Read InputFile
- ${status} ${dynamicServiceList}= Run Keyword And Ignore Error utils.get_dynamic_resources ${PROFILE_FILE} xos_services
+ ${status} ${dynamicServiceList}= Run Keyword And Ignore Error CORDRobot.get_dynamic_resources ${PROFILE_FILE} xos_services
Run Keyword If '${status}' == 'FAIL' Fail No Services in given profile manifest
Set Suite Variable ${dynamicServiceList}
##need to remove openstack and onos from xos_services list in each manifest as these services arent treated as typical xos synchronizers
- utils.Remove Value From List ${dynamicServiceList} openstack
- utils.Remove Value From List ${dynamicServiceList} onos
- utils.Remove Value From List ${dynamicServiceList} exampleservice
+ CORDRobot.Remove Value From List ${dynamicServiceList} openstack
+ CORDRobot.Remove Value From List ${dynamicServiceList} onos
+ CORDRobot.Remove Value From List ${dynamicServiceList} exampleservice
Log ${dynamicServiceList}
Verify Service Sanity
@@ -35,9 +34,9 @@
Run Keyword If "${type}" == "SANITY" Test Service Sanity
Test Service Sanity
- ${json_result}= restApi.ApiGet CH_CORE_SERVICES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SERVICES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${dList}= Get Variable Value ${dynamicServiceList}
- ${test_result}= utils.compare_list_of_dicts ${dList} ${json_result_list}
+ ${test_result}= CORDRobot.compare_list_of_dicts ${dList} ${json_result_list}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_DeploymentTest.txt b/src/test/cord-api/Tests/Ch_DeploymentTest.txt
index 5c38bd7..b334c80 100644
--- a/src/test/cord-api/Tests/Ch_DeploymentTest.txt
+++ b/src/test/cord-api/Tests/Ch_DeploymentTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Deployment.json
@@ -37,9 +37,9 @@
*** Keywords ***
Read InputFile
- ${deploymentList}= utils.jsonToList ${PATHFILE} DeploymentInfo
+ ${deploymentList}= CORDRobot.jsonToList ${PATHFILE} DeploymentInfo
Set Suite Variable ${dlist} ${deploymentList}
- ${putDeploymentList}= utils.jsonToList ${PATHFILE2} DeploymentInfo
+ ${putDeploymentList}= CORDRobot.jsonToList ${PATHFILE2} DeploymentInfo
Set Suite Variable ${putList} ${putDeploymentList}
Verify Deployment functionality
@@ -52,47 +52,47 @@
Test Post Deployment API
[Arguments] ${listIndex}
${deploymentList} = Get Variable Value ${dlist}
- ${deploymentDict}= utils.listToDict ${deploymentList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_DEPLOYMENTS ${deploymentDict}
+ ${deploymentDict}= CORDRobot.listToDict ${deploymentList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_DEPLOYMENTS ${deploymentDict}
Should Be True ${api_result}
Test Get Deployment API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_DEPLOYMENTS
+ ${json_result}= CORDRobot.ApiGet CH_CORE_DEPLOYMENTS
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${deploymentList}= Get Variable Value ${dlist}
- ${deploymentDict}= utils.listToDict ${deploymentList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${deploymentDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${name}
- ${test_result}= utils.compare_dict ${deploymentDict} ${getJsonDict}
+ ${deploymentDict}= CORDRobot.listToDict ${deploymentList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${deploymentDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${deploymentDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Deployment API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CH_CORE_DEPLOYMENTS
+ ${get_result}= CORDRobot.ApiGet CH_CORE_DEPLOYMENTS
${putDeploymentList}= Get Variable Value ${putList}
- ${putDeploymentDict}= utils.listToDict ${putDeploymentList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${putDeploymentDict} name
- ${deploymentDict}= utils.getDictFromListofDict ${get_result} name ${name}
- ${deploymentID}= utils.getFieldValueFromDict ${deploymentDict} id
- ${api_result}= restApi.ApiPut CH_CORE_DEPLOYMENTS ${putDeploymentDict} ${deploymentID}
+ ${putDeploymentDict}= CORDRobot.listToDict ${putDeploymentList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${putDeploymentDict} name
+ ${deploymentDict}= CORDRobot.getDictFromListofDict ${get_result} name ${name}
+ ${deploymentID}= CORDRobot.getFieldValueFromDict ${deploymentDict} id
+ ${api_result}= CORDRobot.ApiPut CH_CORE_DEPLOYMENTS ${putDeploymentDict} ${deploymentID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiGet CH_CORE_DEPLOYMENTS ${deploymentID}
- ${test_result}= utils.compare_dict ${putDeploymentDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiGet CH_CORE_DEPLOYMENTS ${deploymentID}
+ ${test_result}= CORDRobot.compare_dict ${putDeploymentDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Deployment API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_DEPLOYMENTS
+ ${json_result}= CORDRobot.ApiGet CH_CORE_DEPLOYMENTS
${json_result_list}= Get From Dictionary ${json_result} items
${deploymentList}= Get Variable Value ${dlist}
- ${deploymentDict}= utils.listToDict ${deploymentList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${deploymentDict} name
+ ${deploymentDict}= CORDRobot.listToDict ${deploymentList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${deploymentDict} name
Log ${name}
- ${deploymentDict}= utils.getDictFromListofDict ${json_result_list} name ${name}
+ ${deploymentDict}= CORDRobot.getDictFromListofDict ${json_result_list} name ${name}
Log ${deploymentDict}
- ${deploymentId}= utils.getFieldValueFromDict ${deploymentDict} id
+ ${deploymentId}= CORDRobot.getFieldValueFromDict ${deploymentDict} id
Log ${deploymentId}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_DEPLOYMENTS ${deploymentId}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_DEPLOYMENTS ${deploymentId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_MultiInstanceTest.txt b/src/test/cord-api/Tests/Ch_MultiInstanceTest.txt
index c0e32d7..15c8544 100644
--- a/src/test/cord-api/Tests/Ch_MultiInstanceTest.txt
+++ b/src/test/cord-api/Tests/Ch_MultiInstanceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Subscriber_MultiInstance.json
@@ -28,7 +28,7 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
@{instanceList}= Create List
${Subscriber_Id}= Set Variable
@@ -45,50 +45,50 @@
[Documentation] Test posts subscribers and validates the end-end functionality until instance creations
# Read input from data files and post subscriber
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
Sleep 30
- ${service_specific_id}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${service_specific_id}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
# Verifying GET operation after POST and validating the contents posted match the input data
${json_result_list}= Get From Dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
- ${result}= utils.compare_dict ${subscriberDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
+ ${result}= CORDRobot.compare_dict ${subscriberDict} ${getJsonDict}
Should Be True ${result}
- ${Subscriber_Id}= utils.getFieldValueFromDict ${getJsonDict} id
+ ${Subscriber_Id}= CORDRobot.getFieldValueFromDict ${getJsonDict} id
Log ${Subscriber_Id}
# Retrieve subscribed_links_id from GET result of the posted Subscriber
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
Log ${subscribed_links_ids_list}
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
Log ${subscribed_links_ids}
# Retrieve provided_links_ids from core/serviceinstancelink
- ${getServiceLink}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id
# Verify created volt using the above provider_service_instance_id
# Verifying GET operation for the Autocreated Volt
- ${get_result}= restApi.ApiChameleonGet VOLT_TENANT ${provider_service_instance_id}
+ ${get_result}= CORDRobot.ApiChameleonGet VOLT_TENANT ${provider_service_instance_id}
Should Be True ${get_result}
# Get "subscriber_links_ids" from the GET result of /volt/volttenants
${subscribed_links_ids_list}= Get From Dictionary ${get_result} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# Validation of Instances
Log ${instanceList}
- ${serviceLinkDict}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${serviceLinkDict}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
Log ${serviceLinkDict}
${VSGTenant}= Get From Dictionary ${serviceLinkDict} provider_service_instance_id
# Retrieve VSGTenant to retrieve instance_id
- ${getVSG_result}= restApi.ApiChameleonGet VSG_TENANT ${VSGTenant}
+ ${getVSG_result}= CORDRobot.ApiChameleonGet VSG_TENANT ${VSGTenant}
${instance_id}= Get From Dictionary ${getVSG_result} instance_id
Append To List ${instanceList} ${instance_id}
Log ${instanceList}
- ${get_CoreInstanceresult}= restApi.ApiChameleonGet CH_CORE_INSTANCES ${instance_id}
+ ${get_CoreInstanceresult}= CORDRobot.ApiChameleonGet CH_CORE_INSTANCES ${instance_id}
Should Be True ${get_CoreInstanceresult}
Test Instance Validation
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet VSG_TENANT
+ ${get_result}= CORDRobot.ApiGet VSG_TENANT
Should Be True ${get_result}
${instanceFinalList}= Remove Duplicates ${instanceList}
Log ${instanceFinalList}
diff --git a/src/test/cord-api/Tests/Ch_NodeTest.txt b/src/test/cord-api/Tests/Ch_NodeTest.txt
index 108e6c9..09e4829 100644
--- a/src/test/cord-api/Tests/Ch_NodeTest.txt
+++ b/src/test/cord-api/Tests/Ch_NodeTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../Properties/RestApiProperties.py
*** Variables ***
@@ -31,7 +31,7 @@
*** Keywords ***
Read InputFile
- ${nodeList}= utils.jsonToList ${PATHFILE} NodeInfo
+ ${nodeList}= CORDRobot.jsonToList ${PATHFILE} NodeInfo
Set Suite Variable ${nlist} ${nodeList}
${siteDeployment}= Catenate SEPARATOR= http:// ${IP} : ${PORT}
... /api/core/sitedeployments/1/
@@ -46,34 +46,34 @@
Test Post Node API
[Arguments] ${listIndex}
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_NODES ${nodeDict}
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_NODES ${nodeDict}
Should Be True ${api_result}
Test Get Node API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_NODES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_NODES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${nodeDict} name
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${nodeDict} name
Log ${name}
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${name}
- ${test_result}= utils.compare_dict ${nodeDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${nodeDict} ${getJsonDict}
Should Be True ${test_result}
Test Delete Node API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_NODES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_NODES
${json_result_list}= Get From Dictionary ${json_result} items
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${nodeDict} name
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${nodeDict} name
Log ${name}
- ${nodeDict}= utils.getDictFromListofDict ${json_result_list} name ${name}
+ ${nodeDict}= CORDRobot.getDictFromListofDict ${json_result_list} name ${name}
Log ${nodeDict}
- ${nodeId}= utils.getFieldValueFromDict ${nodeDict} id
+ ${nodeId}= CORDRobot.getFieldValueFromDict ${nodeDict} id
Log ${nodeId}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_NODES ${nodeId}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_NODES ${nodeId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_SanityFlavors.txt b/src/test/cord-api/Tests/Ch_SanityFlavors.txt
index 8629c62..38dd31c 100644
--- a/src/test/cord-api/Tests/Ch_SanityFlavors.txt
+++ b/src/test/cord-api/Tests/Ch_SanityFlavors.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Flavors.json
@@ -30,7 +30,7 @@
*** Keywords ***
Read InputFile
- ${flavorList} = utils.jsonToList ${PATHFILE} flavorsInfo
+ ${flavorList} = CORDRobot.jsonToList ${PATHFILE} flavorsInfo
Set Suite Variable ${vList} ${flavorList}
Verify Flavor API functionality
@@ -42,33 +42,33 @@
Test Post Flavors
[Arguments] ${listIndex}
${flavorList} = Get Variable Value ${vList}
- ${flavorDict}= utils.listToDict ${flavorList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_FLAVORS ${flavorDict}
+ ${flavorDict}= CORDRobot.listToDict ${flavorList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_FLAVORS ${flavorDict}
Should Be True ${api_result}
Test Get Flavors
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_FLAVORS
+ ${json_result}= CORDRobot.ApiGet CH_CORE_FLAVORS
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${flavorList}= Get Variable Value ${vList}
- ${inputDict}= utils.listToDict ${flavorList} ${listIndex}
- ${flavorName}= utils.getFieldValueFromDict ${inputDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${flavorName}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${flavorList} ${listIndex}
+ ${flavorName}= CORDRobot.getFieldValueFromDict ${inputDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${flavorName}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Flavors
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CH_CORE_FLAVORS
+ ${json_getresult}= CORDRobot.ApiGet CH_CORE_FLAVORS
${json_getresult_list}= Get From Dictionary ${json_getresult} items
${flavorList}= Get Variable Value ${vList}
- ${flavorDict}= utils.listToDict ${vList} ${listIndex}
- ${flavorName}= utils.getFieldValueFromDict ${flavorDict} name
+ ${flavorDict}= CORDRobot.listToDict ${vList} ${listIndex}
+ ${flavorName}= CORDRobot.getFieldValueFromDict ${flavorDict} name
Log ${flavorName}
- ${getFlavorDict}= utils.getDictFromListofDict ${json_getresult_list} name ${flavorName}
+ ${getFlavorDict}= CORDRobot.getDictFromListofDict ${json_getresult_list} name ${flavorName}
Log ${getFlavorDict}
- ${flavorID}= utils.getFieldValueFromDict ${getFlavorDict} id
+ ${flavorID}= CORDRobot.getFieldValueFromDict ${getFlavorDict} id
Log ${flavorID}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_FLAVORS ${flavorID}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_FLAVORS ${flavorID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_SanityInstance.txt b/src/test/cord-api/Tests/Ch_SanityInstance.txt
index 2efcd98..70b2d0d 100644
--- a/src/test/cord-api/Tests/Ch_SanityInstance.txt
+++ b/src/test/cord-api/Tests/Ch_SanityInstance.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_SanityInstance.json
@@ -34,7 +34,7 @@
*** Keywords ***
Read InputFile
- ${instanceList} = utils.jsonToList ${PATHFILE} InstanceInfo
+ ${instanceList} = CORDRobot.jsonToList ${PATHFILE} InstanceInfo
Set Suite Variable ${iList} ${instanceList}
Verify Instance API functionality
@@ -46,34 +46,34 @@
Test Post Instances
[Arguments] ${listIndex}
${instanceList} = Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${instanceList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_INSTANCES ${instanceDict}
+ ${instanceDict}= CORDRobot.listToDict ${instanceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_INSTANCES ${instanceDict}
Should Be True ${api_result}
Test Get Instances
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_INSTANCES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_INSTANCES
Log ${json_result}
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${instanceList}= Get Variable Value ${iList}
- ${inputDict}= utils.listToDict ${instanceList} ${listIndex}
- ${instanceName}= utils.getFieldValueFromDict ${inputDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${instanceName}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${instanceList} ${listIndex}
+ ${instanceName}= CORDRobot.getFieldValueFromDict ${inputDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${instanceName}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Instances
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CH_CORE_INSTANCES
+ ${json_getresult}= CORDRobot.ApiGet CH_CORE_INSTANCES
${json_getresult_list}= Get From Dictionary ${json_getresult} items
${instanceList}= Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${iList} ${listIndex}
- ${instanceName}= utils.getFieldValueFromDict ${instanceDict} name
+ ${instanceDict}= CORDRobot.listToDict ${iList} ${listIndex}
+ ${instanceName}= CORDRobot.getFieldValueFromDict ${instanceDict} name
Log ${instanceName}
- ${getInstanceDict}= utils.getDictFromListofDict ${json_getresult_list} name ${instanceName}
+ ${getInstanceDict}= CORDRobot.getDictFromListofDict ${json_getresult_list} name ${instanceName}
Log ${getInstanceDict}
- ${instanceID}= utils.getFieldValueFromDict ${getInstanceDict} id
+ ${instanceID}= CORDRobot.getFieldValueFromDict ${getInstanceDict} id
Log ${instanceID}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_INSTANCES ${instanceID}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_INSTANCES ${instanceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_ServiceTest.txt b/src/test/cord-api/Tests/Ch_ServiceTest.txt
index 6dbb0f0..203dd9a 100644
--- a/src/test/cord-api/Tests/Ch_ServiceTest.txt
+++ b/src/test/cord-api/Tests/Ch_ServiceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Service.json
@@ -39,9 +39,9 @@
*** Keywords ***
Read InputFile
- ${serviceList}= utils.jsonToList ${PATHFILE} ServiceInfo
+ ${serviceList}= CORDRobot.jsonToList ${PATHFILE} ServiceInfo
Set Suite Variable ${slist} ${serviceList}
- ${putServiceList}= utils.jsonToList ${PATHFILE2} ServiceInfo
+ ${putServiceList}= CORDRobot.jsonToList ${PATHFILE2} ServiceInfo
Set Suite Variable ${putList} ${putServiceList}
Verify Service functionality
@@ -54,49 +54,49 @@
Test Post Service API
[Arguments] ${listIndex}
${serviceList} = Get Variable Value ${slist}
- ${serviceDict}= utils.listToDict ${serviceList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_SERVICES ${serviceDict}
+ ${serviceDict}= CORDRobot.listToDict ${serviceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_SERVICES ${serviceDict}
Should Be True ${api_result}
Test Get Service API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_SERVICES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SERVICES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
Log ${json_result}
${serviceList}= Get Variable Value ${slist}
- ${serviceDict}= utils.listToDict ${serviceList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${serviceDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${name}
- ${test_result}= utils.compare_dict ${serviceDict} ${getJsonDict}
+ ${serviceDict}= CORDRobot.listToDict ${serviceList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${serviceDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${serviceDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Service API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CH_CORE_SERVICES
+ ${get_result}= CORDRobot.ApiGet CH_CORE_SERVICES
${get_result_list}= Get From Dictionary ${get_result} items
${putServiceList}= Get Variable Value ${putList}
- ${putServiceDict}= utils.listToDict ${putServiceList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${putServiceDict} name
- ${serviceDict}= utils.getDictFromListofDict ${get_result_list} name ${name}
- ${serviceID}= utils.getFieldValueFromDict ${serviceDict} id
- ${api_result}= restApi.ApiChameleonPut CH_CORE_SERVICES ${putServiceDict} ${serviceID}
+ ${putServiceDict}= CORDRobot.listToDict ${putServiceList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${putServiceDict} name
+ ${serviceDict}= CORDRobot.getDictFromListofDict ${get_result_list} name ${name}
+ ${serviceID}= CORDRobot.getFieldValueFromDict ${serviceDict} id
+ ${api_result}= CORDRobot.ApiChameleonPut CH_CORE_SERVICES ${putServiceDict} ${serviceID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiChameleonGet CH_CORE_SERVICES ${serviceID}
- ${test_result}= utils.compare_dict ${putServiceDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiChameleonGet CH_CORE_SERVICES ${serviceID}
+ ${test_result}= CORDRobot.compare_dict ${putServiceDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Service API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_SERVICES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SERVICES
${json_result_list}= Get From Dictionary ${json_result} items
${serviceList}= Get Variable Value ${slist}
- ${serviceDict}= utils.listToDict ${serviceList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${serviceDict} name
+ ${serviceDict}= CORDRobot.listToDict ${serviceList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${serviceDict} name
Log ${name}
- ${serviceDict}= utils.getDictFromListofDict ${json_result_list} name ${name}
+ ${serviceDict}= CORDRobot.getDictFromListofDict ${json_result_list} name ${name}
Log ${serviceDict}
- ${serviceId}= utils.getFieldValueFromDict ${serviceDict} id
+ ${serviceId}= CORDRobot.getFieldValueFromDict ${serviceDict} id
Log ${serviceId}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_SERVICES ${serviceId}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_SERVICES ${serviceId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_SingleInstanceTest.txt b/src/test/cord-api/Tests/Ch_SingleInstanceTest.txt
index c229698..2c9aa6f 100644
--- a/src/test/cord-api/Tests/Ch_SingleInstanceTest.txt
+++ b/src/test/cord-api/Tests/Ch_SingleInstanceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Subscriber.json
@@ -38,9 +38,9 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
- ${voltList}= utils.jsonToList ${PATHFILE2} voltSubscriberInfo
+ ${voltList}= CORDRobot.jsonToList ${PATHFILE2} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
@{instanceList}= Create List
Set Suite Variable @{instanceList}
@@ -54,71 +54,71 @@
Test Post Subscriber Create
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
- ${service_specific_id}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
+ ${service_specific_id}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
${json_result_list}= Get From Dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
- ${result}= utils.compare_dict ${subscriberDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
+ ${result}= CORDRobot.compare_dict ${subscriberDict} ${getJsonDict}
Should Be True ${result}
${instanceList} Create List
Test Post volt Tenant Create
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${service_specific_id}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${service_specific_id}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
${json_result_list}= Get From Dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
- ${Subscriber_Id}= utils.getFieldValueFromDict ${getJsonDict} id
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
+ ${Subscriber_Id}= CORDRobot.getFieldValueFromDict ${getJsonDict} id
Log ${Subscriber_Id}
${voltTenantList} = Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${c_tag}= Get From Dictionary ${voltDict} c_tag
- ${postResult}= restApi.ApiPost VOLT_TENANT ${voltDict}
+ ${postResult}= CORDRobot.ApiPost VOLT_TENANT ${voltDict}
Sleep 30
# Verifying GET operation after POST
- ${get_result}= restApi.ApiGet VOLT_TENANT
+ ${get_result}= CORDRobot.ApiGet VOLT_TENANT
${get_result_list}= Get From Dictionary ${get_result} items
- ${getJsonDict}= utils.getDictFromListofDict ${get_result_list} c_tag ${c_tag}
+ ${getJsonDict}= CORDRobot.getDictFromListofDict ${get_result_list} c_tag ${c_tag}
Log ${getJsonDict}
- ${test_result}= utils.compare_dict ${voltDict} ${getJsonDict}
+ ${test_result}= CORDRobot.compare_dict ${voltDict} ${getJsonDict}
Should Be True ${test_result}
${Volt_Id}= Get From Dictionary ${getJsonDict} id
- ${provided_links_ids_list}= utils.getFieldValueFromDict ${getJsonDict} provided_links_ids
+ ${provided_links_ids_list}= CORDRobot.getFieldValueFromDict ${getJsonDict} provided_links_ids
Log ${provided_links_ids_list}
${provided_links_ids}= Get From List ${provided_links_ids_list} 0
Log ${provided_links_ids}
# Get subscribed_links_ids from volttenant
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# Retrieve service links using provided links ID
- ${getServiceLink}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${provided_links_ids}
+ ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${provided_links_ids}
${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id
# Update the subscriber_service_instance_id to the required subscriber_id to establish desired link
${serviceDict}= Create Dictionary subscriber_service_instance_id=${Subscriber_Id}
- ${result}= restApi.ApiChameleonPut CH_CORE_SERVICELINK ${serviceDict} ${provided_links_ids}
+ ${result}= CORDRobot.ApiChameleonPut CH_CORE_SERVICELINK ${serviceDict} ${provided_links_ids}
Sleep 30
Should Be True ${result}
# Validation of Instances
Log ${instanceList}
- ${serviceLinkDict}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${serviceLinkDict}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
Log ${serviceLinkDict}
${VSGTenant}= Get From Dictionary ${serviceLinkDict} provider_service_instance_id
# Retrieve VSGTenant to retrieve instance_id
- ${getVSG_result}= restApi.ApiChameleonGet VSG_TENANT ${VSGTenant}
+ ${getVSG_result}= CORDRobot.ApiChameleonGet VSG_TENANT ${VSGTenant}
${instance_id}= Get From Dictionary ${getVSG_result} instance_id
Append To List ${instanceList} ${instance_id}
Log ${instanceList}
Test Instance Validation
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet VSG_TENANT
+ ${get_result}= CORDRobot.ApiGet VSG_TENANT
Should Be True ${get_result}
${instanceFinalList}= Remove Duplicates ${instanceList}
Log ${instanceFinalList}
@@ -126,5 +126,5 @@
Log ${instanceCount}
Should Be True ${instanceCount} == 1
${instance_id}= Get From List ${instanceFinalList} 0
- ${get_CoreInstanceresult}= restApi.ApiChameleonGet CH_CORE_INSTANCES ${instance_id}
+ ${get_CoreInstanceresult}= CORDRobot.ApiChameleonGet CH_CORE_INSTANCES ${instance_id}
Should Be True ${get_CoreInstanceresult}
diff --git a/src/test/cord-api/Tests/Ch_SiteTest.txt b/src/test/cord-api/Tests/Ch_SiteTest.txt
index 7e48e58..b23ec31 100644
--- a/src/test/cord-api/Tests/Ch_SiteTest.txt
+++ b/src/test/cord-api/Tests/Ch_SiteTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Site.json
@@ -33,9 +33,9 @@
*** Keywords ***
Read InputFile
- ${siteList}= utils.jsonToList ${PATHFILE} SiteInfo
+ ${siteList}= CORDRobot.jsonToList ${PATHFILE} SiteInfo
Set Suite Variable ${slist} ${siteList}
- ${putSiteList}= utils.jsonToList ${PATHFILE2} SiteInfo
+ ${putSiteList}= CORDRobot.jsonToList ${PATHFILE2} SiteInfo
Set Suite Variable ${putList} ${putSiteList}
Verify Site functionality
@@ -48,48 +48,48 @@
Test Post Site API
[Arguments] ${listIndex}
${siteList} = Get Variable Value ${slist}
- ${siteDict}= utils.listToDict ${siteList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_SITES ${siteDict}
+ ${siteDict}= CORDRobot.listToDict ${siteList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_SITES ${siteDict}
Should Be True ${api_result}
Test Get Site API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_SITES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SITES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${siteList}= Get Variable Value ${slist}
- ${siteDict}= utils.listToDict ${siteList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${siteDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${name}
- ${test_result}= utils.compare_dict ${siteDict} ${getJsonDict}
+ ${siteDict}= CORDRobot.listToDict ${siteList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${siteDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${siteDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Site API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CH_CORE_SITES
+ ${get_result}= CORDRobot.ApiGet CH_CORE_SITES
${get_result_list}= Get From Dictionary ${get_result} items
${putSiteList}= Get Variable Value ${putList}
- ${putSiteDict}= utils.listToDict ${putSiteList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${putSiteDict} name
- ${siteDict}= utils.getDictFromListofDict ${get_result_list} name ${name}
- ${siteID}= utils.getFieldValueFromDict ${siteDict} id
- ${api_result}= restApi.ApiChameleonPut CH_CORE_SITES ${putSiteDict} ${siteID}
+ ${putSiteDict}= CORDRobot.listToDict ${putSiteList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${putSiteDict} name
+ ${siteDict}= CORDRobot.getDictFromListofDict ${get_result_list} name ${name}
+ ${siteID}= CORDRobot.getFieldValueFromDict ${siteDict} id
+ ${api_result}= CORDRobot.ApiChameleonPut CH_CORE_SITES ${putSiteDict} ${siteID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiChameleonGet CH_CORE_SITES ${siteID}
- ${test_result}= utils.compare_dict ${putSiteDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiChameleonGet CH_CORE_SITES ${siteID}
+ ${test_result}= CORDRobot.compare_dict ${putSiteDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Site API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_SITES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SITES
${json_result_list}= Get From Dictionary ${json_result} items
${siteList}= Get Variable Value ${slist}
- ${siteDict}= utils.listToDict ${siteList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${siteDict} name
+ ${siteDict}= CORDRobot.listToDict ${siteList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${siteDict} name
Log ${name}
- ${siteDict}= utils.getDictFromListofDict ${json_result_list} name ${name}
+ ${siteDict}= CORDRobot.getDictFromListofDict ${json_result_list} name ${name}
Log ${siteDict}
- ${siteId}= utils.getFieldValueFromDict ${siteDict} id
+ ${siteId}= CORDRobot.getFieldValueFromDict ${siteDict} id
Log ${siteId}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_SITES ${siteId}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_SITES ${siteId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_SliceTest.txt b/src/test/cord-api/Tests/Ch_SliceTest.txt
index 4299da1..f8218ac 100644
--- a/src/test/cord-api/Tests/Ch_SliceTest.txt
+++ b/src/test/cord-api/Tests/Ch_SliceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../Properties/RestApiProperties.py
*** Variables ***
@@ -26,7 +26,7 @@
*** Keywords ***
Read InputFile
- ${sliceList} = utils.jsonToList ${PATHFILE} SliceInfo
+ ${sliceList} = CORDRobot.jsonToList ${PATHFILE} SliceInfo
Set Suite Variable ${sList} ${sliceList}
Verify Slice API functionality
@@ -38,33 +38,33 @@
Test Post Slice API
[Arguments] ${listIndex}
${sliceList} = Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_SLICES ${sliceDict}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_SLICES ${sliceDict}
Should Be True ${api_result}
Test Get Slice API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_SLICES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SLICES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
${sliceName}= Get From Dictionary ${sliceDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${sliceName}
- ${test_result}= utils.compare_dict ${sliceDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${sliceName}
+ ${test_result}= CORDRobot.compare_dict ${sliceDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Slice API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CH_CORE_SLICES
+ ${json_getresult}= CORDRobot.ApiGet CH_CORE_SLICES
${json_getresult_list}= Get From Dictionary ${json_getresult} items
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sList} ${listIndex}
- ${sliceName}= utils.getFieldValueFromDict ${sliceDict} name
+ ${sliceDict}= CORDRobot.listToDict ${sList} ${listIndex}
+ ${sliceName}= CORDRobot.getFieldValueFromDict ${sliceDict} name
Log ${sliceName}
- ${getSliceDict}= utils.getDictFromListofDict ${json_getresult_list} name ${sliceName}
+ ${getSliceDict}= CORDRobot.getDictFromListofDict ${json_getresult_list} name ${sliceName}
Log ${getSliceDict}
- ${sliceID}= utils.getFieldValueFromDict ${getSliceDict} id
+ ${sliceID}= CORDRobot.getFieldValueFromDict ${getSliceDict} id
Log ${sliceID}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_SLICES ${sliceID}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_SLICES ${sliceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_SubscriberTest.txt b/src/test/cord-api/Tests/Ch_SubscriberTest.txt
index 705a0ba..3933c6e 100644
--- a/src/test/cord-api/Tests/Ch_SubscriberTest.txt
+++ b/src/test/cord-api/Tests/Ch_SubscriberTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Subscriber.json
@@ -44,9 +44,9 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
- ${putSubscriberList}= utils.jsonToList ${PATHFILE2} SubscriberInfo
+ ${putSubscriberList}= CORDRobot.jsonToList ${PATHFILE2} SubscriberInfo
Set Suite Variable ${putList} ${putSubscriberList}
Verify Subscriber functionality
@@ -59,53 +59,53 @@
Test Post Subscriber API
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
Should Be True ${api_result}
Test Get Subscriber API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
${subscriberList}= Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${AccountNum}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${AccountNum}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
Log ${AccountNum}
${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} service_specific_id ${AccountNum}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} service_specific_id ${AccountNum}
Log ${getJsonDict}
Log ${subscriberDict}
- ${test_result}= utils.compare_dict ${subscriberDict} ${getJsonDict}
+ ${test_result}= CORDRobot.compare_dict ${subscriberDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Subscriber API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${get_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
${get_result_list}= Get From Dictionary ${get_result} items
${putSubscriberList}= Get Variable Value ${putList}
- ${putSubscriberDict}= utils.listToDict ${putSubscriberList} ${listIndex}
- ${AcctNum}= utils.getFieldValueFromDict ${putSubscriberDict} service_specific_id
+ ${putSubscriberDict}= CORDRobot.listToDict ${putSubscriberList} ${listIndex}
+ ${AcctNum}= CORDRobot.getFieldValueFromDict ${putSubscriberDict} service_specific_id
Log ${AcctNum}
- ${subscriberDict}= utils.getDictFromListofDict ${get_result_list} service_specific_id ${AcctNum}
- ${subscriberID}= utils.getFieldValueFromDict ${subscriberDict} id
- ${api_result}= restApi.ApiChameleonPut VOLT_SUBSCRIBER ${putSubscriberDict} ${subscriberID}
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${get_result_list} service_specific_id ${AcctNum}
+ ${subscriberID}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
+ ${api_result}= CORDRobot.ApiChameleonPut VOLT_SUBSCRIBER ${putSubscriberDict} ${subscriberID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${getResultAfterPut}= CORDRobot.ApiGet VOLT_SUBSCRIBER
${getResultList_AfterPut}= Get From Dictionary ${getResultAfterPut} items
- ${getResultDict}= utils.getDictFromListOfDict ${getResultList_AfterPut} service_specific_id ${AcctNum}
- ${test_result}= utils.compare_dict ${putSubscriberDict} ${getResultDict}
+ ${getResultDict}= CORDRobot.getDictFromListOfDict ${getResultList_AfterPut} service_specific_id ${AcctNum}
+ ${test_result}= CORDRobot.compare_dict ${putSubscriberDict} ${getResultDict}
Should Be True ${test_result}
Test Delete Subscriber API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
${subscriberList}= Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${AcctNum}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${AcctNum}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
Log ${AcctNum}
- ${subscriberDict}= utils.getDictFromListofDict ${json_result} service_specific_id ${AcctNum}
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${json_result} service_specific_id ${AcctNum}
Log ${subscriberDict}
- ${subscriberId}= utils.getFieldValueFromDict ${subscriberDict} id
+ ${subscriberId}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
Log ${subscriberId}
- ${test_result}= restApi.ApiDelete VOLT_SUBSCRIBER ${subscriberId}
+ ${test_result}= CORDRobot.ApiDelete VOLT_SUBSCRIBER ${subscriberId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_SubscriberVolt_Delete.txt b/src/test/cord-api/Tests/Ch_SubscriberVolt_Delete.txt
index 9f47112..cd6383e 100644
--- a/src/test/cord-api/Tests/Ch_SubscriberVolt_Delete.txt
+++ b/src/test/cord-api/Tests/Ch_SubscriberVolt_Delete.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_VoltTenant.json
@@ -25,7 +25,7 @@
*** Keywords ***
Read InputFile
- ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo
+ ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
Verify Deletion of Subscriber and volt Tenant functionality
@@ -34,26 +34,26 @@
Test Delete Subscriber and voltTenant
[Arguments] ${listIndex}
- ${getSubscriber_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${getSubscriber_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
${getSubscriber_result_list}= Get From Dictionary ${getSubscriber_result} items
- ${getVoltTenant_result}= restApi.ApiGet VOLT_TENANT
+ ${getVoltTenant_result}= CORDRobot.ApiGet VOLT_TENANT
${getVoltTenant_result_list}= Get From Dictionary ${getVoltTenant_result} items
${voltList}= Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${servicespecific_id}= Get From Dictionary ${voltTenantDict} service_specific_id
- ${subscriberDict}= utils.getDictFromListofDict ${getSubscriber_result_list} service_specific_id ${servicespecific_id}
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${getSubscriber_result_list} service_specific_id ${servicespecific_id}
Log ${subscriberDict}
- ${subscriberId}= utils.getFieldValueFromDict ${subscriberDict} id
+ ${subscriberId}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
Log ${subscriberId}
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${subscriberDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${subscriberDict} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# Retrieve service links using service links ID
- ${getServiceLink}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id
# Deletion of volt Tenants
- ${volt_delete_result}= restApi.ApiChameleonDelete VOLT_TENANT ${provider_service_instance_id}
+ ${volt_delete_result}= CORDRobot.ApiChameleonDelete VOLT_TENANT ${provider_service_instance_id}
Should Be True ${volt_delete_result}
#Deletion of Subscribers
- ${subscriber_delete_result}= restApi.ApiChameleonDelete VOLT_SUBSCRIBER ${subscriberId}
+ ${subscriber_delete_result}= CORDRobot.ApiChameleonDelete VOLT_SUBSCRIBER ${subscriberId}
Should Be True ${subscriber_delete_result}
diff --git a/src/test/cord-api/Tests/Ch_UsersTest.txt b/src/test/cord-api/Tests/Ch_UsersTest.txt
index 6640a4b..83c6dd3 100644
--- a/src/test/cord-api/Tests/Ch_UsersTest.txt
+++ b/src/test/cord-api/Tests/Ch_UsersTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Users.json
@@ -34,7 +34,7 @@
*** Keywords ***
Read InputFile
- ${userList} = utils.jsonToList ${PATHFILE} UserInfo
+ ${userList} = CORDRobot.jsonToList ${PATHFILE} UserInfo
Set Suite Variable ${uList} ${userList}
Verify User functionality
@@ -46,33 +46,33 @@
Test Post Users API
[Arguments] ${listIndex}
${userList} = Get Variable Value ${uList}
- ${userDict}= utils.listToDict ${userList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_USERS ${userDict}
+ ${userDict}= CORDRobot.listToDict ${userList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_USERS ${userDict}
Should Be True ${api_result}
Test Get Users API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_USERS
+ ${json_result}= CORDRobot.ApiGet CH_CORE_USERS
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${userList}= Get Variable Value ${uList}
- ${inputDict}= utils.listToDict ${userList} ${listIndex}
- ${email}= utils.getFieldValueFromDict ${inputDict} email
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} email ${email}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${userList} ${listIndex}
+ ${email}= CORDRobot.getFieldValueFromDict ${inputDict} email
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} email ${email}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Users API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CH_CORE_USERS
+ ${json_getresult}= CORDRobot.ApiGet CH_CORE_USERS
${json_getresult_list}= Get From Dictionary ${json_getresult} items
${userList}= Get Variable Value ${uList}
- ${userDict}= utils.listToDict ${uList} ${listIndex}
- ${email}= utils.getFieldValueFromDict ${userDict} email
+ ${userDict}= CORDRobot.listToDict ${uList} ${listIndex}
+ ${email}= CORDRobot.getFieldValueFromDict ${userDict} email
Log ${email}
- ${getUserDict}= utils.getDictFromListofDict ${json_getresult_list} email ${email}
+ ${getUserDict}= CORDRobot.getDictFromListofDict ${json_getresult_list} email ${email}
Log ${getUserDict}
- ${userID}= utils.getFieldValueFromDict ${getUserDict} id
+ ${userID}= CORDRobot.getFieldValueFromDict ${getUserDict} id
Log ${userID}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_USERS ${userID}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_USERS ${userID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_VoltTenant-sanity.txt b/src/test/cord-api/Tests/Ch_VoltTenant-sanity.txt
index 9a86f8c..93f3152 100644
--- a/src/test/cord-api/Tests/Ch_VoltTenant-sanity.txt
+++ b/src/test/cord-api/Tests/Ch_VoltTenant-sanity.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_VoltTenant.json
@@ -23,9 +23,9 @@
*** Keywords ***
Read InputFile
- ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo
+ ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
- ${putvoltList}= utils.jsonToList ${PATHFILE2} voltSubscriberInfo
+ ${putvoltList}= CORDRobot.jsonToList ${PATHFILE2} voltSubscriberInfo
Set Suite Variable ${putList} ${putvoltList}
Verify volt Tenant Functionality
@@ -35,13 +35,13 @@
Test Post volt Tenant API
[Arguments] ${listIndex}
${voltTenantList} = Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
- ${name}= Get From Dictionary ${voltDict} name
- ${postResult}= restApi.ApiPost VOLT_TENANT ${voltDict}
+ ${name}= Get From Dictionary ${voltDict} name
+ ${postResult}= CORDRobot.ApiPost VOLT_TENANT ${voltDict}
# Verifying Get Operation after POST
- ${getVolt_result}= restApi.ApiGet VOLT_TENANT
+ ${getVolt_result}= CORDRobot.ApiGet VOLT_TENANT
${getVolt_result_list}= Get From Dictionary ${getVolt_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${getVolt_result_list} name ${name}
- ${test_result}= utils.compare_dict ${voltDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${getVolt_result_list} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${voltDict} ${getJsonDict}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/Ch_VoltTenant.txt b/src/test/cord-api/Tests/Ch_VoltTenant.txt
index f4b7e02..f11a222 100644
--- a/src/test/cord-api/Tests/Ch_VoltTenant.txt
+++ b/src/test/cord-api/Tests/Ch_VoltTenant.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_VoltTenant.json
@@ -24,11 +24,11 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE3} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE3} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
- ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo
+ ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
- ${putvoltList}= utils.jsonToList ${PATHFILE2} voltSubscriberInfo
+ ${putvoltList}= CORDRobot.jsonToList ${PATHFILE2} voltSubscriberInfo
Set Suite Variable ${putList} ${putvoltList}
Verify volt Tenant Functionality
@@ -38,40 +38,40 @@
Test Post volt Tenant API
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${service_specific_id}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${service_specific_id}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
${json_result_list}= Get From Dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
- ${Subscriber_Id}= utils.getFieldValueFromDict ${getJsonDict} id
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
+ ${Subscriber_Id}= CORDRobot.getFieldValueFromDict ${getJsonDict} id
Log ${Subscriber_Id}
${voltTenantList} = Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${c_tag}= Get From Dictionary ${voltDict} c_tag
- ${postResult}= restApi.ApiPost VOLT_TENANT ${voltDict}
+ ${postResult}= CORDRobot.ApiPost VOLT_TENANT ${voltDict}
Sleep 30
# Verifying GET operation after POST
- ${get_result}= restApi.ApiGet VOLT_TENANT
+ ${get_result}= CORDRobot.ApiGet VOLT_TENANT
${get_result_list}= Get From Dictionary ${get_result} items
- ${getJsonDict}= utils.getDictFromListofDict ${get_result_list} c_tag ${c_tag}
+ ${getJsonDict}= CORDRobot.getDictFromListofDict ${get_result_list} c_tag ${c_tag}
Log ${getJsonDict}
- ${test_result}= utils.compare_dict ${voltDict} ${getJsonDict}
+ ${test_result}= CORDRobot.compare_dict ${voltDict} ${getJsonDict}
Should Be True ${test_result}
${Volt_Id}= Get From Dictionary ${getJsonDict} id
- ${provided_links_ids_list}= utils.getFieldValueFromDict ${getJsonDict} provided_links_ids
+ ${provided_links_ids_list}= CORDRobot.getFieldValueFromDict ${getJsonDict} provided_links_ids
Log ${provided_links_ids_list}
${provided_links_ids}= Get From List ${provided_links_ids_list} 0
Log ${provided_links_ids}
# Get subscribed_links_ids from volttenant
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# Retrieve service links using provided links ID
- ${getServiceLink}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${provided_links_ids}
+ ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${provided_links_ids}
${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id
# Update the subscriber_service_instance_id to the required subscriber_id to establish desired link
${serviceDict}= Create Dictionary subscriber_service_instance_id=${Subscriber_Id}
- ${result}= restApi.ApiChameleonPut CH_CORE_SERVICELINK ${serviceDict} ${provided_links_ids}
+ ${result}= CORDRobot.ApiChameleonPut CH_CORE_SERVICELINK ${serviceDict} ${provided_links_ids}
Sleep 30
Should Be True ${result}
diff --git a/src/test/cord-api/Tests/Ch_defaultImagesCheck.txt b/src/test/cord-api/Tests/Ch_defaultImagesCheck.txt
index 6a3f3ff..2f0b2b9 100644
--- a/src/test/cord-api/Tests/Ch_defaultImagesCheck.txt
+++ b/src/test/cord-api/Tests/Ch_defaultImagesCheck.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PROFILE} mock-rcord
@@ -21,8 +21,8 @@
*** Keywords ***
Read InputFile
- ${defaultImageList}= utils.jsonToList ${PATHFILE} imagesInfo
- ${status} ${dynamicImageList}= Run Keyword And Ignore Error utils.get_dynamic_resources ${PROFILE_FILE} xos_images
+ ${defaultImageList}= CORDRobot.jsonToList ${PATHFILE} imagesInfo
+ ${status} ${dynamicImageList}= Run Keyword And Ignore Error CORDRobot.get_dynamic_resources ${PROFILE_FILE} xos_images
${imageList}= Set Variable If '${status}' == 'FAIL' ${defaultImageList} ${dynamicImageList}
Set Suite Variable ${imageList}
@@ -31,10 +31,10 @@
Run Keyword If "${type}" == "IMAGE" Test Image Check
Test Image Check
- ${json_result}= restApi.ApiGet CH_CORE_IMAGES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_IMAGES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${image_list}= Get Variable Value ${imageList}
- ${test_result}= utils.compare_list_of_dicts ${image_list} ${json_result_list}
+ ${test_result}= CORDRobot.compare_list_of_dicts ${image_list} ${json_result_list}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/CordVTN.txt b/src/test/cord-api/Tests/CordVTN.txt
index 08fb772..118032e 100644
--- a/src/test/cord-api/Tests/CordVTN.txt
+++ b/src/test/cord-api/Tests/CordVTN.txt
@@ -2,17 +2,13 @@
Documentation Test suite for VTN Functionality
Suite Setup Suite Setup
Suite Teardown Suite Teardown
-Variables ../Framework/restApi.py
Library Collections
Library String
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
-Library ../Framework/utils/openstackUtils.py
-Variables ../Properties/RestApiProperties.py
-Resource ../Framework/utils/utils.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${VM_USER} admin
@@ -61,8 +57,8 @@
Create New Test Service
[Documentation] Creates a generic service that will be used for the new VTN Network
[Tags] vtn pod
- ${updatedcservList}= utils.setFieldValueInDict ${cservlist[0]} name CordVTN-Test-Service
- ${updatedcservList}= utils.setFieldValueInDict ${updatedcservList} description Test Service for CordVTN Test Suite
+ ${updatedcservList}= CORDRobot.setFieldValueInDict ${cservlist[0]} name CordVTN-Test-Service
+ ${updatedcservList}= CORDRobot.setFieldValueInDict ${updatedcservList} description Test Service for CordVTN Test Suite
${resp}= Cord POST ${SERVER_IP} ${CH_CORE_SERVICES} ${updatedcservList}
Should Be Equal As Strings ${resp.status_code} 200
${name}= Get Json Value ${resp.content} /name
@@ -77,8 +73,8 @@
Create New VTN Service Network
[Documentation] Makes a POST Request to XOS to create a new core network
[Tags] vtn pod
- ${updatedCnList}= utils.setFieldValueInDict ${cnlist[0]} template_id ${vsg_network_template_id}
- ${updatedCnList}= utils.setFieldValueInDict ${updatedCnList} owner_id ${vsg_slice_id}
+ ${updatedCnList}= CORDRobot.setFieldValueInDict ${cnlist[0]} template_id ${vsg_network_template_id}
+ ${updatedCnList}= CORDRobot.setFieldValueInDict ${updatedCnList} owner_id ${vsg_slice_id}
Log ${updatedCnList}
${resp}= Cord POST ${SERVER_IP} ${CH_CORE_NETWORKS} ${cnlist[0]}
Should Be Equal As Strings ${resp.status_code} 200
@@ -96,8 +92,8 @@
Create New Slice with New Test Service
[Documentation] Makes a POST Request to XOS to create a new slice and adds new generic test service to that slice
[Tags] vtn pod
- ${updatedCsList}= utils.setFieldValueInDict ${cslist[0]} service_id ${generic_service_id}
- #${updatedCsList}= utils.setFieldValueInDict ${cslist[0]} service_id 12
+ ${updatedCsList}= CORDRobot.setFieldValueInDict ${cslist[0]} service_id ${generic_service_id}
+ #${updatedCsList}= CORDRobot.setFieldValueInDict ${cslist[0]} service_id 12
Log ${updatedCsList}
${resp}= Cord POST ${SERVER_IP} ${CH_CORE_SLICES} ${updatedCsList}
Should Be Equal As Strings ${resp.status_code} 200
@@ -115,10 +111,10 @@
Add Networks to New Test Network Slice
[Documentation] Creates a new network slice for the new slice and adds mgmt and new network to it
[Tags] vsg pod
- ${updatedCsList}= utils.setFieldValueInDict ${cnslist[0]} network_id ${network_id}
- #${updatedCsList}= utils.setFieldValueInDict ${cnslist[0]} network_id 5
- ${updatedCsList}= utils.setFieldValueInDict ${updatedCsList} slice_id ${new_slice_id}
- #${updatedCsList}= utils.setFieldValueInDict ${updatedCsList} slice_id 5
+ ${updatedCsList}= CORDRobot.setFieldValueInDict ${cnslist[0]} network_id ${network_id}
+ #${updatedCsList}= CORDRobot.setFieldValueInDict ${cnslist[0]} network_id 5
+ ${updatedCsList}= CORDRobot.setFieldValueInDict ${updatedCsList} slice_id ${new_slice_id}
+ #${updatedCsList}= CORDRobot.setFieldValueInDict ${updatedCsList} slice_id 5
Log ${updatedCsList}
${resp}= Cord POST ${SERVER_IP} ${CH_CORE_NETWORK_SLICES} ${updatedCsList}
Should Be Equal As Strings ${resp.status_code} 200
@@ -128,9 +124,9 @@
Should Be Equal As Strings ${s_id} ${new_slice_id}
Should Be Equal As Strings ${n_id} ${network_id}
##Add mgmt network to this network slice
- ${updatedCsList}= utils.setFieldValueInDict ${cnslist[0]} network_id ${mgmt_network_id}
- ${updatedCsList}= utils.setFieldValueInDict ${updatedCsList} slice_id ${new_slice_id}
- #${updatedCsList}= utils.setFieldValueInDict ${updatedCsList} slice_id 5
+ ${updatedCsList}= CORDRobot.setFieldValueInDict ${cnslist[0]} network_id ${mgmt_network_id}
+ ${updatedCsList}= CORDRobot.setFieldValueInDict ${updatedCsList} slice_id ${new_slice_id}
+ #${updatedCsList}= CORDRobot.setFieldValueInDict ${updatedCsList} slice_id 5
Log ${updatedCsList}
${resp}= Cord POST ${SERVER_IP} ${CH_CORE_NETWORK_SLICES} ${updatedCsList}
Should Be Equal As Strings ${resp.status_code} 200
@@ -143,9 +139,9 @@
Create New Test Instance
[Documentation] Creates a new instance for the test service
[Tags] vsg pod
- ${updatedCiList}= utils.setFieldValueInDict ${cilist[0]} slice_id ${new_slice_id}
- #${updatedCiList}= utils.setFieldValueInDict ${cilist[0]} slice_id 5
- ${updatedCiList}= utils.setFieldValueInDict ${updatedCiList} image_id ${image_id}
+ ${updatedCiList}= CORDRobot.setFieldValueInDict ${cilist[0]} slice_id ${new_slice_id}
+ #${updatedCiList}= CORDRobot.setFieldValueInDict ${cilist[0]} slice_id 5
+ ${updatedCiList}= CORDRobot.setFieldValueInDict ${updatedCiList} image_id ${image_id}
Log ${updatedCiList}
${resp}= Cord POST ${SERVER_IP} ${CH_CORE_INSTANCES} ${updatedCiList}
#${resp}= Cord POST ${SERVER_IP} ${CH_CORE_INSTANCES} ${cilist[0]}
@@ -196,7 +192,7 @@
${blacklist_sr_ids}= Get Subscriber Root IDs in Use
${ss_id}= Generate Random Number from Blacklist ${blacklist_sr_ids}
Set Suite Variable ${ss_id}
- ${updatedcsList}= utils.setFieldValueInDict ${csubList[0]} service_specific_id ${ss_id}
+ ${updatedcsList}= CORDRobot.setFieldValueInDict ${csubList[0]} service_specific_id ${ss_id}
Log ${updatedcsList}
${resp}= Cord POST ${SERVER_IP} ${VOLT_SUBSCRIBER} ${updatedcsList}
Should Be Equal As Strings ${resp.status_code} 200
@@ -226,10 +222,10 @@
${c_tag}= Generate Random Number from Blacklist ${blacklist_tags} 1 4096 True
Append To List ${blacklist_tags} ${c_tag}
Log ${blacklist_tags}
- ${updatedvtList}= utils.setFieldValueInDict ${vtList[0]} service_specific_id ${subscriber_root_id}
- #${updatedvtList}= utils.setFieldValueInDict ${vtList[0]} subscriber_root_id ${subscriber_root_id}
- ${updatedvtList}= utils.setFieldValueInDict ${updatedvtList} s_tag ${s_tag}
- ${updatedvtList}= utils.setFieldValueInDict ${updatedvtList} c_tag ${c_tag}
+ ${updatedvtList}= CORDRobot.setFieldValueInDict ${vtList[0]} service_specific_id ${subscriber_root_id}
+ #${updatedvtList}= CORDRobot.setFieldValueInDict ${vtList[0]} subscriber_root_id ${subscriber_root_id}
+ ${updatedvtList}= CORDRobot.setFieldValueInDict ${updatedvtList} s_tag ${s_tag}
+ ${updatedvtList}= CORDRobot.setFieldValueInDict ${updatedvtList} c_tag ${c_tag}
Log ${updatedvtList}
${resp}= Cord POST ${SERVER_IP} ${VOLT_TENANT} ${vtList[0]}
Should Be Equal As Strings ${resp.status_code} 200
@@ -338,19 +334,19 @@
Close All Connections
Read InputFile
- ${coreServiceList} = utils.jsonToList ${CORE_SERVICE_PATHFILE} ServiceInfo
+ ${coreServiceList} = CORDRobot.jsonToList ${CORE_SERVICE_PATHFILE} ServiceInfo
Set Suite Variable ${cservlist} ${coreServiceList}
- ${coreNetworkList} = utils.jsonToList ${CORE_NETWORK_PATHFILE} NetworkInfo
+ ${coreNetworkList} = CORDRobot.jsonToList ${CORE_NETWORK_PATHFILE} NetworkInfo
Set Suite Variable ${cnlist} ${coreNetworkList}
- ${coreSliceList} = utils.jsonToList ${CORE_SLICE_PATHFILE} SliceInfo
+ ${coreSliceList} = CORDRobot.jsonToList ${CORE_SLICE_PATHFILE} SliceInfo
Set Suite Variable ${cslist} ${coreSliceList}
- ${coreNetworkSliceList} = utils.jsonToList ${CORE_NETWORK_SLICE_PATHFILE} NetworkSliceInfo
+ ${coreNetworkSliceList} = CORDRobot.jsonToList ${CORE_NETWORK_SLICE_PATHFILE} NetworkSliceInfo
Set Suite Variable ${cnslist} ${coreNetworkSliceList}
- ${coreInstanceList} = utils.jsonToList ${CORE_INSTANCE_PATHFILE} InstanceInfo
+ ${coreInstanceList} = CORDRobot.jsonToList ${CORE_INSTANCE_PATHFILE} InstanceInfo
Set Suite Variable ${cilist} ${coreInstanceList}
- ${cordSubscriberList} = utils.jsonToList ${CORD_SUBSCRIBER_PATHFILE} CordSubscriberInfo
+ ${cordSubscriberList} = CORDRobot.jsonToList ${CORD_SUBSCRIBER_PATHFILE} CordSubscriberInfo
Set Suite Variable ${csubList} ${cordSubscriberList}
- ${voltTenantList} = utils.jsonToList ${VOLT_TENANT_PATHFILE} VoltTenantInfo
+ ${voltTenantList} = CORDRobot.jsonToList ${VOLT_TENANT_PATHFILE} VoltTenantInfo
Set Suite Variable ${vtList} ${voltTenantList}
CORD Get
diff --git a/src/test/cord-api/Tests/DefaultServiceCheck.txt b/src/test/cord-api/Tests/DefaultServiceCheck.txt
index 59341d2..49c0042 100644
--- a/src/test/cord-api/Tests/DefaultServiceCheck.txt
+++ b/src/test/cord-api/Tests/DefaultServiceCheck.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -20,7 +20,7 @@
*** Keywords ***
Read InputFile
- ${serviceList}= utils.jsonToList ${PATHFILE} ServiceInfo
+ ${serviceList}= CORDRobot.jsonToList ${PATHFILE} ServiceInfo
Set Suite Variable ${slist} ${serviceList}
Verify Service Sanity
@@ -28,8 +28,8 @@
Run Keyword If "${type}" == "SANITY" Test Service Sanity
Test Service Sanity
- ${json_result}= restApi.ApiGet CORE_SERVICES
+ ${json_result}= CORDRobot.ApiGet CORE_SERVICES
Log ${json_result}
${serviceList}= Get Variable Value ${slist}
- ${test_result}= utils.compare_list_of_dicts ${serviceList} ${json_result}
+ ${test_result}= CORDRobot.compare_list_of_dicts ${serviceList} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/DemoSimpleExampleService.robot b/src/test/cord-api/Tests/DemoSimpleExampleService.robot
index 07003f9..f84711c 100644
--- a/src/test/cord-api/Tests/DemoSimpleExampleService.robot
+++ b/src/test/cord-api/Tests/DemoSimpleExampleService.robot
@@ -1,7 +1,6 @@
*** Settings ***
Library KafkaLibrary
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
@@ -61,7 +60,7 @@
Get Kubernetes SI Pod IP
${resp}= CORD Get /xosapi/v1/kubernetes/kubernetesserviceinstances/${k8_si_id}
- ${k8_pod_ip}= Get Json Value ${resp.content} /pod_ip
+ ${k8_pod_ip}= Get From Dictionary ${resp.json()} pod_ip
Set Suite Variable ${k8_pod_ip}
Validate SI Message
@@ -100,7 +99,7 @@
${resp}= Post Request ${server_ip} uri=${service} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
diff --git a/src/test/cord-api/Tests/DeploymentTest.txt b/src/test/cord-api/Tests/DeploymentTest.txt
index b0141b0..76fd066 100644
--- a/src/test/cord-api/Tests/DeploymentTest.txt
+++ b/src/test/cord-api/Tests/DeploymentTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -35,9 +35,9 @@
*** Keywords ***
Read InputFile
- ${deploymentList}= utils.jsonToList ${PATHFILE} DeploymentInfo
+ ${deploymentList}= CORDRobot.jsonToList ${PATHFILE} DeploymentInfo
Set Suite Variable ${dlist} ${deploymentList}
- ${putDeploymentList}= utils.jsonToList ${PATHFILE2} DeploymentInfo
+ ${putDeploymentList}= CORDRobot.jsonToList ${PATHFILE2} DeploymentInfo
Set Suite Variable ${putList} ${putDeploymentList}
Verify Deployment functionality
@@ -50,45 +50,45 @@
Test Post Deployment API
[Arguments] ${listIndex}
${deploymentList} = Get Variable Value ${dlist}
- ${deploymentDict}= utils.listToDict ${deploymentList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_DEPLOYMENTS ${deploymentDict}
+ ${deploymentDict}= CORDRobot.listToDict ${deploymentList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_DEPLOYMENTS ${deploymentDict}
Should Be True ${api_result}
Test Get Deployment API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_DEPLOYMENTS
+ ${json_result}= CORDRobot.ApiGet CORE_DEPLOYMENTS
Log ${json_result}
${deploymentList}= Get Variable Value ${dlist}
- ${deploymentDict}= utils.listToDict ${deploymentList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${deploymentDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${name}
- ${test_result}= utils.compare_dict ${deploymentDict} ${getJsonDict}
+ ${deploymentDict}= CORDRobot.listToDict ${deploymentList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${deploymentDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${deploymentDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Deployment API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CORE_DEPLOYMENTS
+ ${get_result}= CORDRobot.ApiGet CORE_DEPLOYMENTS
${putDeploymentList}= Get Variable Value ${putList}
- ${putDeploymentDict}= utils.listToDict ${putDeploymentList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${putDeploymentDict} name
- ${deploymentDict}= utils.getDictFromListofDict ${get_result} name ${name}
- ${deploymentID}= utils.getFieldValueFromDict ${deploymentDict} id
- ${api_result}= restApi.ApiPut CORE_DEPLOYMENTS ${putDeploymentDict} ${deploymentID}
+ ${putDeploymentDict}= CORDRobot.listToDict ${putDeploymentList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${putDeploymentDict} name
+ ${deploymentDict}= CORDRobot.getDictFromListofDict ${get_result} name ${name}
+ ${deploymentID}= CORDRobot.getFieldValueFromDict ${deploymentDict} id
+ ${api_result}= CORDRobot.ApiPut CORE_DEPLOYMENTS ${putDeploymentDict} ${deploymentID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiGet CORE_DEPLOYMENTS ${deploymentID}
- ${test_result}= utils.compare_dict ${putDeploymentDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiGet CORE_DEPLOYMENTS ${deploymentID}
+ ${test_result}= CORDRobot.compare_dict ${putDeploymentDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Deployment API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_DEPLOYMENTS
+ ${json_result}= CORDRobot.ApiGet CORE_DEPLOYMENTS
${deploymentList}= Get Variable Value ${dlist}
- ${deploymentDict}= utils.listToDict ${deploymentList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${deploymentDict} name
+ ${deploymentDict}= CORDRobot.listToDict ${deploymentList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${deploymentDict} name
Log ${name}
- ${deploymentDict}= utils.getDictFromListofDict ${json_result} name ${name}
+ ${deploymentDict}= CORDRobot.getDictFromListofDict ${json_result} name ${name}
Log ${deploymentDict}
- ${deploymentId}= utils.getFieldValueFromDict ${deploymentDict} id
+ ${deploymentId}= CORDRobot.getFieldValueFromDict ${deploymentDict} id
Log ${deploymentId}
- ${test_result}= restApi.ApiDelete CORE_DEPLOYMENTS ${deploymentId}
+ ${test_result}= CORDRobot.ApiDelete CORE_DEPLOYMENTS ${deploymentId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/FabricConfig.txt b/src/test/cord-api/Tests/FabricConfig.txt
index 410b169..b7b066c 100644
--- a/src/test/cord-api/Tests/FabricConfig.txt
+++ b/src/test/cord-api/Tests/FabricConfig.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/FabricSwitch.json
@@ -39,13 +39,13 @@
*** Keywords ***
Read InputFile
- ${FabricList}= utils.jsonToList ${PATHFILE} FabricSwitchInfo
+ ${FabricList}= CORDRobot.jsonToList ${PATHFILE} FabricSwitchInfo
Set Suite Variable ${dlist} ${FabricList}
Set Global Variable ${Fabric_Id} ${EMPTY}
- ${FabricPortList}= utils.jsonToList ${PATHFILE1} FabricSwitchPort
+ ${FabricPortList}= CORDRobot.jsonToList ${PATHFILE1} FabricSwitchPort
Set Suite Variable ${plist} ${FabricPortList}
Set Global Variable ${SwitchPort_Id} ${EMPTY}
- ${FabricInterfaceList}= utils.jsonToList ${PATHFILE2} FabricPortInterface
+ ${FabricInterfaceList}= CORDRobot.jsonToList ${PATHFILE2} FabricPortInterface
Set Suite Variable ${ilist} ${FabricInterfaceList}
Set Global Variable ${FabricInterface_Id} ${EMPTY}
@@ -61,8 +61,8 @@
Test Create Fabric Switch
[Arguments] ${listIndex}
${FabricList} = Get Variable Value ${dlist}
- ${FabricDict}= utils.listToDict ${FabricList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson FABRIC_SWITCH ${FabricDict}
+ ${FabricDict}= CORDRobot.listToDict ${FabricList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson FABRIC_SWITCH ${FabricDict}
Should Be True ${api_result_status}
${Fabric_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${Fabric_Id}
@@ -70,20 +70,20 @@
Test Get Fabric Switch
[Arguments] ${listIndex}
Log ${Fabric_Id}
- ${json_result}= restApi.ApiChameleonGet FABRIC_SWITCH ${Fabric_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet FABRIC_SWITCH ${Fabric_Id}
Log ${json_result}
${FabricList} = Get Variable Value ${dlist}
- ${FabricDict}= utils.listToDict ${FabricList} ${listIndex}
+ ${FabricDict}= CORDRobot.listToDict ${FabricList} ${listIndex}
Log ${FabricDict}
- ${test_result}= utils.compare_dict ${FabricDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${FabricDict} ${json_result}
Should Be True ${test_result}
Test Create Switch Port API
[Arguments] ${listIndex}
${SwitchPortList} = Get Variable Value ${plist}
- ${SwitchPortDict}= utils.listToDict ${SwitchPortList} ${listIndex}
- ${SwitchPortDict}= utils.setFieldValueInDict ${SwitchPortDict} switch_id ${Fabric_Id}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson SWITCH_PORT ${SwitchPortDict}
+ ${SwitchPortDict}= CORDRobot.listToDict ${SwitchPortList} ${listIndex}
+ ${SwitchPortDict}= CORDRobot.setFieldValueInDict ${SwitchPortDict} switch_id ${Fabric_Id}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson SWITCH_PORT ${SwitchPortDict}
Should Be True ${api_result_status}
${SwitchPort_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${SwitchPort_Id}
@@ -91,20 +91,20 @@
Test Get Switch Port API
[Arguments] ${listIndex}
Log ${SwitchPort_Id}
- ${json_result}= restApi.ApiChameleonGet SWITCH_PORT ${SwitchPort_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet SWITCH_PORT ${SwitchPort_Id}
Log ${json_result}
${SwitchPortList} = Get Variable Value ${plist}
- ${SwitchPortDict}= utils.listToDict ${SwitchPortList} ${listIndex}
+ ${SwitchPortDict}= CORDRobot.listToDict ${SwitchPortList} ${listIndex}
Log ${SwitchPortDict}
- ${test_result}= utils.compare_dict ${SwitchPortDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${SwitchPortDict} ${json_result}
Should Be True ${test_result}
Test Create Fabric Interface
[Arguments] ${listIndex}
${FabricInterfaceList}= Get Variable Value ${ilist}
- ${FabricInterfaceDict}= utils.listToDict ${FabricInterfaceList} ${listIndex}
- ${FabricInterfaceDict}= utils.setFieldValueInDict ${FabricInterfaceDict} port_id ${SwitchPort_Id}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson PORT_INTERFACE ${FabricInterfaceDict}
+ ${FabricInterfaceDict}= CORDRobot.listToDict ${FabricInterfaceList} ${listIndex}
+ ${FabricInterfaceDict}= CORDRobot.setFieldValueInDict ${FabricInterfaceDict} port_id ${SwitchPort_Id}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson PORT_INTERFACE ${FabricInterfaceDict}
Should Be True ${api_result_status}
${FabricInterface_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${FabricInterface_Id}
@@ -112,10 +112,10 @@
Test Get Fabric Interface
[Arguments] ${listIndex}
Log ${FabricInterface_Id}
- ${json_result}= restApi.ApiChameleonGet PORT_INTERFACE ${FabricInterface_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet PORT_INTERFACE ${FabricInterface_Id}
Log ${json_result}
${FabricInterfaceList} = Get Variable Value ${ilist}
- ${FabricInterfaceDict}= utils.listToDict ${FabricInterfaceList} ${listIndex}
+ ${FabricInterfaceDict}= CORDRobot.listToDict ${FabricInterfaceList} ${listIndex}
Log ${FabricInterfaceDict}
- ${test_result}= utils.compare_dict ${FabricInterfaceDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${FabricInterfaceDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/HippieOSS.txt b/src/test/cord-api/Tests/HippieOSS.txt
index 9de05be..f5930ad 100644
--- a/src/test/cord-api/Tests/HippieOSS.txt
+++ b/src/test/cord-api/Tests/HippieOSS.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/hippieOSS.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${hippieList}= utils.jsonToList ${PATHFILE} hippieOSSInfo
+ ${hippieList}= CORDRobot.jsonToList ${PATHFILE} hippieOSSInfo
Set Suite Variable ${slist} ${hippieList}
Set Global Variable ${hippieOSS_Id} ${EMPTY}
@@ -33,8 +33,8 @@
Post Hippie OSS
[Arguments] ${listIndex}
${hippieList} = Get Variable Value ${slist}
- ${hippieOSSDict}= utils.listToDict ${hippieList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson OSS_SERVICE ${hippieOSSDict}
+ ${hippieOSSDict}= CORDRobot.listToDict ${hippieList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson OSS_SERVICE ${hippieOSSDict}
Should Be True ${api_result_status}
${hippieOSS_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${hippieOSS_Id}
@@ -42,10 +42,10 @@
Get Hippie OSS
[Arguments] ${listIndex}
Log ${hippieOSS_Id}
- ${json_result}= restApi.ApiChameleonGet OSS_SERVICE ${hippieOSS_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet OSS_SERVICE ${hippieOSS_Id}
Log ${json_result}
${hippieList} = Get Variable Value ${slist}
- ${hippieOSSDict}= utils.listToDict ${hippieList} ${listIndex}
+ ${hippieOSSDict}= CORDRobot.listToDict ${hippieList} ${listIndex}
Log ${hippieOSSDict}
- ${test_result}= utils.compare_dict ${hippieOSSDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${hippieOSSDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/InstanceTest.txt b/src/test/cord-api/Tests/InstanceTest.txt
index 450ef43..0f13c6e 100644
--- a/src/test/cord-api/Tests/InstanceTest.txt
+++ b/src/test/cord-api/Tests/InstanceTest.txt
@@ -7,8 +7,9 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
+
| Variables | ../Properties/RestApiProperties.py
*** Variables ***
@@ -39,7 +40,7 @@
*** Keywords ***
Read InputFile
- ${instanceList} = utils.jsonToList ${PATHFILE} InstanceInfo
+ ${instanceList} = CORDRobot.jsonToList ${PATHFILE} InstanceInfo
Set Suite Variable ${iList} ${instanceList}
${image}= Catenate SEPARATOR= http:// ${IP} : ${PORT} /api/core/images/1/
Set Suite Variable ${image} ${image}
@@ -61,51 +62,51 @@
Test Post Instances
[Arguments] ${listIndex}
${instanceList} = Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${instanceList} ${listIndex}
+ ${instanceDict}= CORDRobot.listToDict ${instanceList} ${listIndex}
${image}= Get Variable Value ${image}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} image ${image}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} image ${image}
${slice}= Get Variable Value ${slice}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} slice ${slice}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} slice ${slice}
${deployment}= Get Variable Value ${deployment}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} deployment ${deployment}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} deployment ${deployment}
${node}= Get Variable Value ${node}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} node ${node}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} node ${node}
${creator}= Get Variable Value ${creator}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} creator ${creator}
- ${api_result}= restApi.ApiPost CORE_INSTANCES ${instanceDict}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} creator ${creator}
+ ${api_result}= CORDRobot.ApiPost CORE_INSTANCES ${instanceDict}
Should Be True ${api_result}
Test Get Instances
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_INSTANCES
+ ${json_result}= CORDRobot.ApiGet CORE_INSTANCES
Log ${json_result}
${instanceList}= Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${instanceList} ${listIndex}
+ ${instanceDict}= CORDRobot.listToDict ${instanceList} ${listIndex}
${image}= Get Variable Value ${image}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} image ${image}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} image ${image}
${slice}= Get Variable Value ${slice}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} slice ${slice}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} slice ${slice}
${deployment}= Get Variable Value ${deployment}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} deployment ${deployment}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} deployment ${deployment}
${node}= Get Variable Value ${node}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} node ${node}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} node ${node}
${creator}= Get Variable Value ${creator}
- ${instanceDict}= utils.setFieldValueInDict ${instanceDict} creator ${creator}
- ${instanceName}= utils.getFieldValueFromDict ${instanceDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${instanceName}
- ${test_result}= utils.compare_dict ${instanceDict} ${getJsonDict}
+ ${instanceDict}= CORDRobot.setFieldValueInDict ${instanceDict} creator ${creator}
+ ${instanceName}= CORDRobot.getFieldValueFromDict ${instanceDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${instanceName}
+ ${test_result}= CORDRobot.compare_dict ${instanceDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Instances
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_INSTANCES
+ ${json_getresult}= CORDRobot.ApiGet CORE_INSTANCES
${instanceList}= Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${iList} ${listIndex}
- ${instanceName}= utils.getFieldValueFromDict ${instanceDict} name
+ ${instanceDict}= CORDRobot.listToDict ${iList} ${listIndex}
+ ${instanceName}= CORDRobot.getFieldValueFromDict ${instanceDict} name
Log ${instanceName}
- ${getInstanceDict}= utils.getDictFromListofDict ${json_getresult} name ${instanceName}
+ ${getInstanceDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${instanceName}
Log ${getInstanceDict}
- ${instanceID}= utils.getFieldValueFromDict ${getInstanceDict} id
+ ${instanceID}= CORDRobot.getFieldValueFromDict ${getInstanceDict} id
Log ${instanceID}
- ${test_result}= restApi.ApiDelete CORE_INSTANCES ${instanceID}
+ ${test_result}= CORDRobot.ApiDelete CORE_INSTANCES ${instanceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/LegacyRCORD_E2EServiceChainTest.txt b/src/test/cord-api/Tests/LegacyRCORD_E2EServiceChainTest.txt
index 22c7bdb..bb7a39e 100644
--- a/src/test/cord-api/Tests/LegacyRCORD_E2EServiceChainTest.txt
+++ b/src/test/cord-api/Tests/LegacyRCORD_E2EServiceChainTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Ch_Subscriber.json
@@ -25,7 +25,7 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
@{instanceList}= Create List
Set Suite Variable @{instanceList}
@@ -37,38 +37,38 @@
Test Post Subscriber Create
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost VOLT_SUBSCRIBER ${subscriberDict}
Sleep 90
- ${service_specific_id}= utils.getFieldValueFromDict ${subscriberDict} service_specific_id
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${service_specific_id}= CORDRobot.getFieldValueFromDict ${subscriberDict} service_specific_id
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
${json_result_list}= Get From Dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
- ${result}= utils.compare_dict ${subscriberDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} service_specific_id ${service_specific_id}
+ ${result}= CORDRobot.compare_dict ${subscriberDict} ${getJsonDict}
Should Be True ${result}
${instanceList} Create List
# Retrieve Subscribed_links_id from Posted Subscriber
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${getJsonDict} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# Retrieve Provided_Service_Instance_Id from "ServiceInstanceLinks"
- ${getServiceLink}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id
# RETRIEVE VOLT OBJECT USING PROVIDER INSTANCE ID
- ${getVoltDict}= restApi.ApiChameleonGet VOLT_TENANT ${provider_service_instance_id}
+ ${getVoltDict}= CORDRobot.ApiChameleonGet VOLT_TENANT ${provider_service_instance_id}
# RETRIEVE SUBSCRIBED_LINKS_IDS FROM THE VOLT DICTIONARY
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${getVoltDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${getVoltDict} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# RETRIEVE PROVIDED_SERVICE_INSTANCE_ID
- ${serviceLinkDict}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${serviceLinkDict}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
Log ${serviceLinkDict}
${VSGTenant}= Get From Dictionary ${serviceLinkDict} provider_service_instance_id
# Retrieve VSGTenant to retrieve instance_id
- ${getVSG_result}= restApi.ApiChameleonGet VSG_TENANT ${VSGTenant}
+ ${getVSG_result}= CORDRobot.ApiChameleonGet VSG_TENANT ${VSGTenant}
${instance_id}= Get From Dictionary ${getVSG_result} instance_id
Append To List ${instanceList} ${instance_id}
Log ${instanceList}
Set Global Variable ${instanceList}
# VALIDATE INSTANCE IS PRESENT IN /CORE/INSTANCES
- ${get_CoreInstanceresult}= restApi.ApiChameleonGet CH_CORE_INSTANCES ${instance_id}
+ ${get_CoreInstanceresult}= CORDRobot.ApiChameleonGet CH_CORE_INSTANCES ${instance_id}
Should Be True ${get_CoreInstanceresult}
diff --git a/src/test/cord-api/Tests/MultiInstanceTest.txt b/src/test/cord-api/Tests/MultiInstanceTest.txt
index a4ef516..a166e10 100644
--- a/src/test/cord-api/Tests/MultiInstanceTest.txt
+++ b/src/test/cord-api/Tests/MultiInstanceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -46,9 +46,9 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
- ${voltList}= utils.jsonToList ${PATHFILE2} voltSubscriberInfo
+ ${voltList}= CORDRobot.jsonToList ${PATHFILE2} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
Verify Instance functionality
@@ -60,41 +60,41 @@
Test Post Subscriber Create
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost TENANT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost TENANT_SUBSCRIBER ${subscriberDict}
Should Be True ${api_result}
Test Post volt Tenant Create
[Arguments] ${listIndex}
${voltTenantList} = Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${account_num}= Get From Dictionary ${voltTenantDict} account_num
- ${get_result}= restApi.ApiGet TENANT_SUBSCRIBER
- ${subscriberDict}= utils.getDictFromListofDict ${get_result} account_num ${account_num}
- ${subscriberID}= utils.getFieldValueFromDict ${subscriberDict} id
- ${updatedVoltDict}= utils.setFieldValueInDict ${voltDict} subscriber ${subscriberID}
- ${api_result}= restApi.ApiPost TENANT_VOLT ${updatedVoltDict}
+ ${get_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${get_result} account_num ${account_num}
+ ${subscriberID}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
+ ${updatedVoltDict}= CORDRobot.setFieldValueInDict ${voltDict} subscriber ${subscriberID}
+ ${api_result}= CORDRobot.ApiPost TENANT_VOLT ${updatedVoltDict}
Should Be True ${api_result}
# Verifying Get operation after POST
- ${getVolt_result}= restApi.ApiGet TENANT_VOLT
- ${getJsonDict}= utils.getDictFromListOfDict ${getVolt_result} subscriber ${subscriberID}
- ${test_result}= utils.compare_dict ${voltDict} ${getJsonDict}
+ ${getVolt_result}= CORDRobot.ApiGet TENANT_VOLT
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${getVolt_result} subscriber ${subscriberID}
+ ${test_result}= CORDRobot.compare_dict ${voltDict} ${getJsonDict}
Should Be True ${test_result}
Test Instance Validation
[Arguments] ${listIndex}
${voltTenantList}= Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${input_sTag}= Get From Dictionary ${voltDict} s_tag
- ${get_result}= restApi.ApiGet TENANT_VOLT
- ${tenantDict}= utils.getDictFromListofDict ${get_result} s_tag ${input_sTag}
+ ${get_result}= CORDRobot.ApiGet TENANT_VOLT
+ ${tenantDict}= CORDRobot.getDictFromListofDict ${get_result} s_tag ${input_sTag}
Log ${tenantDict}
- ${instance_id_fromvolt}= utils.getFieldValueFromDict ${tenantDict} instance_id
- ${instance_name}= utils.getFieldValueFromDict ${tenantDict} instance_name
+ ${instance_id_fromvolt}= CORDRobot.getFieldValueFromDict ${tenantDict} instance_id
+ ${instance_name}= CORDRobot.getFieldValueFromDict ${tenantDict} instance_name
${instance_id_name}= Catenate SEPARATOR=- ${instance_name} ${instance_id_fromvolt}
- ${get_instanceresult}= restApi.ApiGet CORE_INSTANCES
- ${instanceDict}= utils.getDictFromListofDict ${get_instanceresult} instance_name ${instance_id_name}
- ${instance_id_fromCore}= utils.getFieldValueFromDict ${instanceDict} id
+ ${get_instanceresult}= CORDRobot.ApiGet CORE_INSTANCES
+ ${instanceDict}= CORDRobot.getDictFromListofDict ${get_instanceresult} instance_name ${instance_id_name}
+ ${instance_id_fromCore}= CORDRobot.getFieldValueFromDict ${instanceDict} id
Should Be Equal As Strings ${instance_id_fromvolt} ${instance_id_fromCore}
diff --git a/src/test/cord-api/Tests/NodeTest.txt b/src/test/cord-api/Tests/NodeTest.txt
index fda6537..882354c 100644
--- a/src/test/cord-api/Tests/NodeTest.txt
+++ b/src/test/cord-api/Tests/NodeTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
| Variables | ../Properties/RestApiProperties.py
*** Variables ***
@@ -33,7 +33,7 @@
*** Keywords ***
Read InputFile
- ${nodeList}= utils.jsonToList ${PATHFILE} NodeInfo
+ ${nodeList}= CORDRobot.jsonToList ${PATHFILE} NodeInfo
Set Suite Variable ${nlist} ${nodeList}
${siteDeployment}= Catenate SEPARATOR= http:// ${IP} : ${PORT} /api/core/sitedeployments/1/
Set Suite Variable ${siteDeployment} ${siteDeployment}
@@ -47,35 +47,35 @@
Test Post Node API
[Arguments] ${listIndex}
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
${siteDeployment}= Get Variable Value ${siteDeployment}
- ${nodeDict}= utils.setFieldValueInDict ${nodeDict} site_deployment ${siteDeployment}
- ${api_result}= restApi.ApiPost CORE_NODES ${nodeDict}
+ ${nodeDict}= CORDRobot.setFieldValueInDict ${nodeDict} site_deployment ${siteDeployment}
+ ${api_result}= CORDRobot.ApiPost CORE_NODES ${nodeDict}
Should Be True ${api_result}
Test Get Node API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_NODES
+ ${json_result}= CORDRobot.ApiGet CORE_NODES
Log ${json_result}
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
${siteDeployment}= Get Variable Value ${siteDeployment}
- ${nodeDict}= utils.setFieldValueInDict ${nodeDict} site_deployment ${siteDeployment}
- ${name}= utils.getFieldValueFromDict ${nodeDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${name}
- ${test_result}= utils.compare_dict ${nodeDict} ${getJsonDict}
+ ${nodeDict}= CORDRobot.setFieldValueInDict ${nodeDict} site_deployment ${siteDeployment}
+ ${name}= CORDRobot.getFieldValueFromDict ${nodeDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${nodeDict} ${getJsonDict}
Should Be True ${test_result}
Test Delete Node API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_NODES
+ ${json_result}= CORDRobot.ApiGet CORE_NODES
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${nodeDict} name
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${nodeDict} name
Log ${name}
- ${nodeDict}= utils.getDictFromListofDict ${json_result} name ${name}
+ ${nodeDict}= CORDRobot.getDictFromListofDict ${json_result} name ${name}
Log ${nodeDict}
- ${nodeId}= utils.getFieldValueFromDict ${nodeDict} id
+ ${nodeId}= CORDRobot.getFieldValueFromDict ${nodeDict} id
Log ${nodeId}
- ${test_result}= restApi.ApiDelete CORE_NODES ${nodeId}
+ ${test_result}= CORDRobot.ApiDelete CORE_NODES ${nodeId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/OSSVolt.txt b/src/test/cord-api/Tests/OSSVolt.txt
index 2282d99..6bdab45 100644
--- a/src/test/cord-api/Tests/OSSVolt.txt
+++ b/src/test/cord-api/Tests/OSSVolt.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/ossVolt.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${ossVoltList}= utils.jsonToList ${PATHFILE} ossVoltInfo
+ ${ossVoltList}= CORDRobot.jsonToList ${PATHFILE} ossVoltInfo
Set Suite Variable ${dlist} ${ossVoltList}
Set Global Variable ${VOLTDevice_Id} ${EMPTY}
Set Global Variable ${hippieOSS_Id} ${EMPTY}
@@ -34,20 +34,20 @@
Test Post OSS Volt
[Arguments] ${listIndex}
${ossVoltList} = Get Variable Value ${dlist}
- ${ossVoltDict}= utils.listToDict ${ossvoltList} ${listIndex}
- ${api_getResult}= restApi.ApiGet VOLT_SERVICE
+ ${ossVoltDict}= CORDRobot.listToDict ${ossvoltList} ${listIndex}
+ ${api_getResult}= CORDRobot.ApiGet VOLT_SERVICE
${voltServiceList}= Get From Dictionary ${api_getResult} items
- ${voltServiceDict}= utils.getDictFromListOfDict ${voltServiceList} leaf_model_name VOLTService
+ ${voltServiceDict}= CORDRobot.getDictFromListOfDict ${voltServiceList} leaf_model_name VOLTService
${VOLTService_Id}= Get From Dictionary ${voltServiceDict} id
- ${ossVoltDict}= utils.setFieldValueInDict ${ossVoltDict} provider_service_id ${VOLTService_Id}
+ ${ossVoltDict}= CORDRobot.setFieldValueInDict ${ossVoltDict} provider_service_id ${VOLTService_Id}
Log ${ossVoltDict}
- ${api_getResult}= restApi.ApiGet OSS_SERVICE
+ ${api_getResult}= CORDRobot.ApiGet OSS_SERVICE
${ServiceList}= Get From Dictionary ${api_getResult} items
- ${ServiceDict}= utils.getDictFromListOfDict ${ServiceList} self_content_type_id hippie-oss.hippieossservice
+ ${ServiceDict}= CORDRobot.getDictFromListOfDict ${ServiceList} self_content_type_id hippie-oss.hippieossservice
${hippieOSS_Id}= Get From Dictionary ${ServiceDict} id
- ${ossVoltDict}= utils.setFieldValueInDict ${ossVoltDict} subscriber_service_id ${hippieOSS_Id}
+ ${ossVoltDict}= CORDRobot.setFieldValueInDict ${ossVoltDict} subscriber_service_id ${hippieOSS_Id}
Log ${ossVoltDict}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson OSS_VOLT ${ossVoltDict}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson OSS_VOLT ${ossVoltDict}
Should Be True ${api_result_status}
${VOLTDevice_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${VOLTDevice_Id}
@@ -55,10 +55,10 @@
Test Get OSS Volt
[Arguments] ${listIndex}
Log ${VOLTDevice_Id}
- ${json_result}= restApi.ApiChameleonGet OSS_VOLT ${VOLTDevice_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet OSS_VOLT ${VOLTDevice_Id}
Log ${json_result}
${voltDeviceList} = Get Variable Value ${dlist}
- ${voltDeviceDict}= utils.listToDict ${voltDeviceList} ${listIndex}
+ ${voltDeviceDict}= CORDRobot.listToDict ${voltDeviceList} ${listIndex}
Log ${voltDeviceDict}
- ${test_result}= utils.compare_dict ${voltDeviceDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${voltDeviceDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/RCORDLite_E2ETest.txt b/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
index 4195f76..354ede4 100644
--- a/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
+++ b/src/test/cord-api/Tests/RCORDLite_E2ETest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/RCORDLite_Subscriber.json
@@ -25,7 +25,7 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
@{instanceList}= Create List
Set Suite Variable @{instanceList}
@@ -37,31 +37,31 @@
Test Post Subscriber Create
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson VOLT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson VOLT_SUBSCRIBER ${subscriberDict}
Sleep 90
Should Be True ${api_result_status}
${Subscriber_Id}= Get From Dictionary ${api_result_json} id
- ${json_result}= restApi.ApiChameleonGet VOLT_SUBSCRIBER ${Subscriber_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet VOLT_SUBSCRIBER ${Subscriber_Id}
Log ${json_result}
- ${result}= utils.compare_dict ${subscriberDict} ${json_result}
+ ${result}= CORDRobot.compare_dict ${subscriberDict} ${json_result}
Should Be True ${result}
${instanceList} Create List
# Retrieve Subscribed_links_id from Posted Subscriber
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${json_result} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${json_result} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# Retrieve Provided_Service_Instance_Id from "ServiceInstanceLinks"
- ${getServiceLink}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id
# RETRIEVE VOLT OBJECT USING PROVIDER INSTANCE ID
- ${getVoltDict}= restApi.ApiChameleonGet VOLT_TENANT ${provider_service_instance_id}
+ ${getVoltDict}= CORDRobot.ApiChameleonGet VOLT_TENANT ${provider_service_instance_id}
# RETRIEVE SUBSCRIBED_LINKS_IDS FROM THE VOLT DICTIONARY
- ${subscribed_links_ids_list}= utils.getFieldValueFromDict ${getVoltDict} subscribed_links_ids
+ ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${getVoltDict} subscribed_links_ids
${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0
# RETRIEVE PROVIDED_SERVICE_INSTANCE_ID
- ${serviceLinkDict}= restApi.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
+ ${serviceLinkDict}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids}
Log ${serviceLinkDict}
${VSGTenant}= Get From Dictionary ${serviceLinkDict} provider_service_instance_id
# Retrieve VSGTenant to retrieve instance_id
- ${getVSG_result}= restApi.ApiChameleonGet HWVSG_TENANT ${VSGTenant}
+ ${getVSG_result}= CORDRobot.ApiChameleonGet HWVSG_TENANT ${VSGTenant}
Should Be True ${getVSG_result}
diff --git a/src/test/cord-api/Tests/RealOLT_Test.txt b/src/test/cord-api/Tests/RealOLT_Test.txt
index 86faa32..f0061e9 100644
--- a/src/test/cord-api/Tests/RealOLT_Test.txt
+++ b/src/test/cord-api/Tests/RealOLT_Test.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/RealOLTDevice.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${voltDeviceList}= utils.jsonToList ${PATHFILE} VOLTDeviceInfo
+ ${voltDeviceList}= CORDRobot.jsonToList ${PATHFILE} VOLTDeviceInfo
Set Suite Variable ${dlist} ${voltDeviceList}
Set Global Variable ${VOLTDevice_Id} ${EMPTY}
@@ -33,14 +33,14 @@
Test Post VOLT Device API
[Arguments] ${listIndex}
${voltDeviceList} = Get Variable Value ${dlist}
- ${voltDeviceDict}= utils.listToDict ${voltDeviceList} ${listIndex}
- ${api_getResult}= restApi.ApiGet VOLT_SERVICE
+ ${voltDeviceDict}= CORDRobot.listToDict ${voltDeviceList} ${listIndex}
+ ${api_getResult}= CORDRobot.ApiGet VOLT_SERVICE
${voltServiceList}= Get From Dictionary ${api_getResult} items
- ${voltServiceDict}= utils.getDictFromListOfDict ${voltServiceList} leaf_model_name VOLTService
+ ${voltServiceDict}= CORDRobot.getDictFromListOfDict ${voltServiceList} leaf_model_name VOLTService
${VOLTService_Id}= Get From Dictionary ${voltServiceDict} id
- ${voltDeviceDict}= utils.setFieldValueInDict ${voltDeviceDict} volt_service_id ${VOLTService_Id}
+ ${voltDeviceDict}= CORDRobot.setFieldValueInDict ${voltDeviceDict} volt_service_id ${VOLTService_Id}
Log ${voltDeviceDict}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson VOLT_DEVICE ${voltDeviceDict}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson VOLT_DEVICE ${voltDeviceDict}
Should Be True ${api_result_status}
${VOLTDevice_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${VOLTDevice_Id}
@@ -48,10 +48,10 @@
Test Get VOLT Device API
[Arguments] ${listIndex}
Log ${VOLTDevice_Id}
- ${json_result}= restApi.ApiChameleonGet VOLT_DEVICE ${VOLTDevice_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet VOLT_DEVICE ${VOLTDevice_Id}
Log ${json_result}
${voltDeviceList} = Get Variable Value ${dlist}
- ${voltDeviceDict}= utils.listToDict ${voltDeviceList} ${listIndex}
+ ${voltDeviceDict}= CORDRobot.listToDict ${voltDeviceList} ${listIndex}
Log ${voltDeviceDict}
- ${test_result}= utils.compare_dict ${voltDeviceDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${voltDeviceDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/SanityFlavors.txt b/src/test/cord-api/Tests/SanityFlavors.txt
index 4754cbb..2815a73 100644
--- a/src/test/cord-api/Tests/SanityFlavors.txt
+++ b/src/test/cord-api/Tests/SanityFlavors.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -32,7 +32,7 @@
*** Keywords ***
Read InputFile
- ${flavorList} = utils.jsonToList ${PATHFILE} flavorsInfo
+ ${flavorList} = CORDRobot.jsonToList ${PATHFILE} flavorsInfo
Set Suite Variable ${vList} ${flavorList}
Verify Flavor API functionality
@@ -44,31 +44,31 @@
Test Post Flavors
[Arguments] ${listIndex}
${flavorList} = Get Variable Value ${vList}
- ${flavorDict}= utils.listToDict ${flavorList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_FLAVORS ${flavorDict}
+ ${flavorDict}= CORDRobot.listToDict ${flavorList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_FLAVORS ${flavorDict}
Should Be True ${api_result}
Test Get Flavors
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_FLAVORS
+ ${json_result}= CORDRobot.ApiGet CORE_FLAVORS
Log ${json_result}
${flavorList}= Get Variable Value ${vList}
- ${inputDict}= utils.listToDict ${flavorList} ${listIndex}
- ${flavorName}= utils.getFieldValueFromDict ${inputDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${flavorName}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${flavorList} ${listIndex}
+ ${flavorName}= CORDRobot.getFieldValueFromDict ${inputDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${flavorName}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Flavors
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_FLAVORS
+ ${json_getresult}= CORDRobot.ApiGet CORE_FLAVORS
${flavorList}= Get Variable Value ${vList}
- ${flavorDict}= utils.listToDict ${vList} ${listIndex}
- ${flavorName}= utils.getFieldValueFromDict ${flavorDict} name
+ ${flavorDict}= CORDRobot.listToDict ${vList} ${listIndex}
+ ${flavorName}= CORDRobot.getFieldValueFromDict ${flavorDict} name
Log ${flavorName}
- ${getFlavorDict}= utils.getDictFromListofDict ${json_getresult} name ${flavorName}
+ ${getFlavorDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${flavorName}
Log ${getFlavorDict}
- ${flavorID}= utils.getFieldValueFromDict ${getFlavorDict} id
+ ${flavorID}= CORDRobot.getFieldValueFromDict ${getFlavorDict} id
Log ${flavorID}
- ${test_result}= restApi.ApiDelete CORE_FLAVORS ${flavorID}
+ ${test_result}= CORDRobot.ApiDelete CORE_FLAVORS ${flavorID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/SanityInstance.txt b/src/test/cord-api/Tests/SanityInstance.txt
index f072f9c..cd3048a 100644
--- a/src/test/cord-api/Tests/SanityInstance.txt
+++ b/src/test/cord-api/Tests/SanityInstance.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -36,7 +36,7 @@
*** Keywords ***
Read InputFile
- ${instanceList} = utils.jsonToList ${PATHFILE} InstanceInfo
+ ${instanceList} = CORDRobot.jsonToList ${PATHFILE} InstanceInfo
Set Suite Variable ${iList} ${instanceList}
Verify Instance API functionality
@@ -48,31 +48,31 @@
Test Post Instances
[Arguments] ${listIndex}
${instanceList} = Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${instanceList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_SANITY_INSTANCES ${instanceDict}
+ ${instanceDict}= CORDRobot.listToDict ${instanceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_SANITY_INSTANCES ${instanceDict}
Should Be True ${api_result}
Test Get Instances
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_INSTANCES
+ ${json_result}= CORDRobot.ApiGet CORE_INSTANCES
Log ${json_result}
${instanceList}= Get Variable Value ${iList}
- ${inputDict}= utils.listToDict ${instanceList} ${listIndex}
- ${instanceName}= utils.getFieldValueFromDict ${inputDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${instanceName}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${instanceList} ${listIndex}
+ ${instanceName}= CORDRobot.getFieldValueFromDict ${inputDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${instanceName}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Instances
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_INSTANCES
+ ${json_getresult}= CORDRobot.ApiGet CORE_INSTANCES
${instanceList}= Get Variable Value ${iList}
- ${instanceDict}= utils.listToDict ${iList} ${listIndex}
- ${instanceName}= utils.getFieldValueFromDict ${instanceDict} name
+ ${instanceDict}= CORDRobot.listToDict ${iList} ${listIndex}
+ ${instanceName}= CORDRobot.getFieldValueFromDict ${instanceDict} name
Log ${instanceName}
- ${getInstanceDict}= utils.getDictFromListofDict ${json_getresult} name ${instanceName}
+ ${getInstanceDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${instanceName}
Log ${getInstanceDict}
- ${instanceID}= utils.getFieldValueFromDict ${getInstanceDict} id
+ ${instanceID}= CORDRobot.getFieldValueFromDict ${getInstanceDict} id
Log ${instanceID}
- ${test_result}= restApi.ApiDelete CORE_INSTANCES ${instanceID}
+ ${test_result}= CORDRobot.ApiDelete CORE_INSTANCES ${instanceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/SanityNode.txt b/src/test/cord-api/Tests/SanityNode.txt
index 0bf27f8..a9d6502 100644
--- a/src/test/cord-api/Tests/SanityNode.txt
+++ b/src/test/cord-api/Tests/SanityNode.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -30,7 +30,7 @@
*** Keywords ***
Read InputFile
- ${nodeList}= utils.jsonToList ${PATHFILE} NodeInfo
+ ${nodeList}= CORDRobot.jsonToList ${PATHFILE} NodeInfo
Set Suite Variable ${nlist} ${nodeList}
Verify Node functionality
@@ -42,31 +42,31 @@
Test Post Node API
[Arguments] ${listIndex}
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_SANITY_NODES ${nodeDict}
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_SANITY_NODES ${nodeDict}
Should Be True ${api_result}
Test Get Node API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_NODES
+ ${json_result}= CORDRobot.ApiGet CORE_NODES
Log ${json_result}
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${nodeDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${name}
- ${test_result}= utils.compare_dict ${nodeDict} ${getJsonDict}
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${nodeDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${nodeDict} ${getJsonDict}
Should Be True ${test_result}
Test Delete Node API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_NODES
+ ${json_result}= CORDRobot.ApiGet CORE_NODES
${nodeList}= Get Variable Value ${nlist}
- ${nodeDict}= utils.listToDict ${nodeList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${nodeDict} name
+ ${nodeDict}= CORDRobot.listToDict ${nodeList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${nodeDict} name
Log ${name}
- ${nodeDict}= utils.getDictFromListofDict ${json_result} name ${name}
+ ${nodeDict}= CORDRobot.getDictFromListofDict ${json_result} name ${name}
Log ${nodeDict}
- ${nodeId}= utils.getFieldValueFromDict ${nodeDict} id
+ ${nodeId}= CORDRobot.getFieldValueFromDict ${nodeDict} id
Log ${nodeId}
- ${test_result}= restApi.ApiDelete CORE_NODES ${nodeId}
+ ${test_result}= CORDRobot.ApiDelete CORE_NODES ${nodeId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/SanitySlice.txt b/src/test/cord-api/Tests/SanitySlice.txt
index 454eba5..e19fbec 100644
--- a/src/test/cord-api/Tests/SanitySlice.txt
+++ b/src/test/cord-api/Tests/SanitySlice.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -22,7 +22,7 @@
*** Keywords ***
Read InputFile
- ${sliceList} = utils.jsonToList ${PATHFILE} sliceInfo
+ ${sliceList} = CORDRobot.jsonToList ${PATHFILE} sliceInfo
Set Suite Variable ${sList} ${sliceList}
Verify Slice API functionality
@@ -34,31 +34,31 @@
Test Post Slices
[Arguments] ${listIndex}
${sliceList} = Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_SANITY_SLICES ${sliceDict}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_SANITY_SLICES ${sliceDict}
Should Be True ${api_result}
Test Get Slices
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SLICES
+ ${json_result}= CORDRobot.ApiGet CORE_SLICES
Log ${json_result}
${sliceList}= Get Variable Value ${sList}
- ${inputDict}= utils.listToDict ${sliceList} ${listIndex}
- ${ID}= utils.getFieldValueFromDict ${inputDict} id
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} id ${ID}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
+ ${ID}= CORDRobot.getFieldValueFromDict ${inputDict} id
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} id ${ID}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Slices
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_SLICES
+ ${json_getresult}= CORDRobot.ApiGet CORE_SLICES
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sList} ${listIndex}
- ${sliceName}= utils.getFieldValueFromDict ${sliceDict} name
+ ${sliceDict}= CORDRobot.listToDict ${sList} ${listIndex}
+ ${sliceName}= CORDRobot.getFieldValueFromDict ${sliceDict} name
Log ${sliceName}
- ${getSliceDict}= utils.getDictFromListofDict ${json_getresult} name ${sliceName}
+ ${getSliceDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${sliceName}
Log ${getSliceDict}
- ${sliceID}= utils.getFieldValueFromDict ${getSliceDict} id
+ ${sliceID}= CORDRobot.getFieldValueFromDict ${getSliceDict} id
Log ${sliceID}
- ${test_result}= restApi.ApiDelete CORE_SLICES ${sliceID}
+ ${test_result}= CORDRobot.ApiDelete CORE_SLICES ${sliceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/Sanity_PONPort.txt b/src/test/cord-api/Tests/Sanity_PONPort.txt
index ba7237a..5f93339 100644
--- a/src/test/cord-api/Tests/Sanity_PONPort.txt
+++ b/src/test/cord-api/Tests/Sanity_PONPort.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
# Update the input file for olt_device_id before running the tests
@@ -37,7 +37,7 @@
*** Keywords ***
Read InputFile
- ${PONPortList}= utils.jsonToList ${PATHFILE} PONPortInfo
+ ${PONPortList}= CORDRobot.jsonToList ${PATHFILE} PONPortInfo
Set Suite Variable ${plist} ${PONPortList}
Set Suite Variable ${PONPort_Id} ${EMPTY}
@@ -50,8 +50,8 @@
Test Post PONPort API
[Arguments] ${listIndex}
${PONPortList} = Get Variable Value ${plist}
- ${PONPortDict}= utils.listToDict ${PONPortList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson PON_PORT ${PONPortDict}
+ ${PONPortDict}= CORDRobot.listToDict ${PONPortList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson PON_PORT ${PONPortDict}
Should Be True ${api_result_status}
${PONPort_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${PONPort_Id}
@@ -59,15 +59,15 @@
Test Get PONPort API
[Arguments] ${listIndex}
Log ${PONPort_Id}
- ${json_result}= restApi.ApiChameleonGet PON_PORT ${PONPort_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet PON_PORT ${PONPort_Id}
Log ${json_result}
${PONPortList} = Get Variable Value ${plist}
- ${PONPortDict}= utils.listToDict ${PONPortList} ${listIndex}
+ ${PONPortDict}= CORDRobot.listToDict ${PONPortList} ${listIndex}
Log ${PONPortDict}
- ${test_result}= utils.compare_dict ${PONPortDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${PONPortDict} ${json_result}
Should Be True ${test_result}
Test Delete PONPort API
[Arguments] ${listIndex}
- ${test_result}= restApi.ApiChameleonDelete PON_PORT ${PONPort_Id}
+ ${test_result}= CORDRobot.ApiChameleonDelete PON_PORT ${PONPort_Id}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/ServiceTest.txt b/src/test/cord-api/Tests/ServiceTest.txt
index 4a31ad8..9b6817f 100644
--- a/src/test/cord-api/Tests/ServiceTest.txt
+++ b/src/test/cord-api/Tests/ServiceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -35,9 +35,9 @@
*** Keywords ***
Read InputFile
- ${serviceList}= utils.jsonToList ${PATHFILE} ServiceInfo
+ ${serviceList}= CORDRobot.jsonToList ${PATHFILE} ServiceInfo
Set Suite Variable ${slist} ${serviceList}
- ${putServiceList}= utils.jsonToList ${PATHFILE2} ServiceInfo
+ ${putServiceList}= CORDRobot.jsonToList ${PATHFILE2} ServiceInfo
Set Suite Variable ${putList} ${putServiceList}
Verify Service functionality
@@ -50,45 +50,45 @@
Test Post Service API
[Arguments] ${listIndex}
${serviceList} = Get Variable Value ${slist}
- ${serviceDict}= utils.listToDict ${serviceList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_SERVICES ${serviceDict}
+ ${serviceDict}= CORDRobot.listToDict ${serviceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_SERVICES ${serviceDict}
Should Be True ${api_result}
Test Get Service API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SERVICES
+ ${json_result}= CORDRobot.ApiGet CORE_SERVICES
Log ${json_result}
${serviceList}= Get Variable Value ${slist}
- ${serviceDict}= utils.listToDict ${serviceList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${serviceDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${name}
- ${test_result}= utils.compare_dict ${serviceDict} ${getJsonDict}
+ ${serviceDict}= CORDRobot.listToDict ${serviceList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${serviceDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${serviceDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Service API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CORE_SERVICES
+ ${get_result}= CORDRobot.ApiGet CORE_SERVICES
${putServiceList}= Get Variable Value ${putList}
- ${putServiceDict}= utils.listToDict ${putServiceList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${putServiceDict} name
- ${serviceDict}= utils.getDictFromListofDict ${get_result} name ${name}
- ${serviceID}= utils.getFieldValueFromDict ${serviceDict} id
- ${api_result}= restApi.ApiPut CORE_SERVICES ${putServiceDict} ${serviceID}
+ ${putServiceDict}= CORDRobot.listToDict ${putServiceList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${putServiceDict} name
+ ${serviceDict}= CORDRobot.getDictFromListofDict ${get_result} name ${name}
+ ${serviceID}= CORDRobot.getFieldValueFromDict ${serviceDict} id
+ ${api_result}= CORDRobot.ApiPut CORE_SERVICES ${putServiceDict} ${serviceID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiGet CORE_SERVICES ${serviceID}
- ${test_result}= utils.compare_dict ${putServiceDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiGet CORE_SERVICES ${serviceID}
+ ${test_result}= CORDRobot.compare_dict ${putServiceDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Service API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SERVICES
+ ${json_result}= CORDRobot.ApiGet CORE_SERVICES
${serviceList}= Get Variable Value ${slist}
- ${serviceDict}= utils.listToDict ${serviceList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${serviceDict} name
+ ${serviceDict}= CORDRobot.listToDict ${serviceList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${serviceDict} name
Log ${name}
- ${serviceDict}= utils.getDictFromListofDict ${json_result} name ${name}
+ ${serviceDict}= CORDRobot.getDictFromListofDict ${json_result} name ${name}
Log ${serviceDict}
- ${serviceId}= utils.getFieldValueFromDict ${serviceDict} id
+ ${serviceId}= CORDRobot.getFieldValueFromDict ${serviceDict} id
Log ${serviceId}
- ${test_result}= restApi.ApiDelete CORE_SERVICES ${serviceId}
+ ${test_result}= CORDRobot.ApiDelete CORE_SERVICES ${serviceId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/SingleInstanceTest.txt b/src/test/cord-api/Tests/SingleInstanceTest.txt
index 209f09c..8ce29f0 100644
--- a/src/test/cord-api/Tests/SingleInstanceTest.txt
+++ b/src/test/cord-api/Tests/SingleInstanceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -40,9 +40,9 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
- ${voltList}= utils.jsonToList ${PATHFILE2} voltSubscriberInfo
+ ${voltList}= CORDRobot.jsonToList ${PATHFILE2} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
Verify Instance functionality
@@ -54,35 +54,35 @@
Test Post Subscriber Create
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost TENANT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost TENANT_SUBSCRIBER ${subscriberDict}
Should Be True ${api_result}
Test Post volt Tenant Create
[Arguments] ${listIndex}
${voltTenantList} = Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${account_num}= Get From Dictionary ${voltTenantDict} account_num
- ${get_result}= restApi.ApiGet TENANT_SUBSCRIBER
- ${subscriberDict}= utils.getDictFromListofDict ${get_result} account_num ${account_num}
- ${subscriberID}= utils.getFieldValueFromDict ${subscriberDict} id
- ${updatedVoltDict}= utils.setFieldValueInDict ${voltDict} subscriber ${subscriberID}
- ${api_result}= restApi.ApiPost TENANT_VOLT ${updatedVoltDict}
+ ${get_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${get_result} account_num ${account_num}
+ ${subscriberID}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
+ ${updatedVoltDict}= CORDRobot.setFieldValueInDict ${voltDict} subscriber ${subscriberID}
+ ${api_result}= CORDRobot.ApiPost TENANT_VOLT ${updatedVoltDict}
Should Be True ${api_result}
# Verifying Get operation after POST
- ${getVolt_result}= restApi.ApiGet TENANT_VOLT
- ${getJsonDict}= utils.getDictFromListOfDict ${getVolt_result} subscriber ${subscriberID}
- ${test_result}= utils.compare_dict ${voltDict} ${getJsonDict}
+ ${getVolt_result}= CORDRobot.ApiGet TENANT_VOLT
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${getVolt_result} subscriber ${subscriberID}
+ ${test_result}= CORDRobot.compare_dict ${voltDict} ${getJsonDict}
Should Be True ${test_result}
Test Instance Validation
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet TENANT_SUBSCRIBER
- ${instance_id_fromvolt}= utils.getAllFieldValues ${get_result} instance_id
- ${instance_name}= utils.getAllFieldValues ${get_result} instance_name
+ ${get_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
+ ${instance_id_fromvolt}= CORDRobot.getAllFieldValues ${get_result} instance_id
+ ${instance_name}= CORDRobot.getAllFieldValues ${get_result} instance_name
${instance_id_name}= Catenate SEPARATOR=- ${instance_name} ${instance_id_fromvolt}
- ${get_instanceresult}= restApi.ApiGet CORE_INSTANCES
- ${instanceDict}= utils.getDictFromListofDict ${get_instanceresult} instance_name ${instance_id_name}
- ${instance_id_fromCore}= utils.getFieldValueFromDict ${instanceDict} id
+ ${get_instanceresult}= CORDRobot.ApiGet CORE_INSTANCES
+ ${instanceDict}= CORDRobot.getDictFromListofDict ${get_instanceresult} instance_name ${instance_id_name}
+ ${instance_id_fromCore}= CORDRobot.getFieldValueFromDict ${instanceDict} id
Should Be Equal As Strings ${instance_id_fromvolt} ${instance_id_fromCore}
diff --git a/src/test/cord-api/Tests/SiteTest.txt b/src/test/cord-api/Tests/SiteTest.txt
index 21f4357..75599eb 100644
--- a/src/test/cord-api/Tests/SiteTest.txt
+++ b/src/test/cord-api/Tests/SiteTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -35,9 +35,9 @@
*** Keywords ***
Read InputFile
- ${siteList}= utils.jsonToList ${PATHFILE} SiteInfo
+ ${siteList}= CORDRobot.jsonToList ${PATHFILE} SiteInfo
Set Suite Variable ${slist} ${siteList}
- ${putSiteList}= utils.jsonToList ${PATHFILE2} SiteInfo
+ ${putSiteList}= CORDRobot.jsonToList ${PATHFILE2} SiteInfo
Set Suite Variable ${putList} ${putSiteList}
Verify Site functionality
@@ -50,45 +50,45 @@
Test Post Site API
[Arguments] ${listIndex}
${siteList} = Get Variable Value ${slist}
- ${siteDict}= utils.listToDict ${siteList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_SITES ${siteDict}
+ ${siteDict}= CORDRobot.listToDict ${siteList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_SITES ${siteDict}
Should Be True ${api_result}
Test Get Site API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SITES
+ ${json_result}= CORDRobot.ApiGet CORE_SITES
Log ${json_result}
${siteList}= Get Variable Value ${slist}
- ${siteDict}= utils.listToDict ${siteList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${siteDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${name}
- ${test_result}= utils.compare_dict ${siteDict} ${getJsonDict}
+ ${siteDict}= CORDRobot.listToDict ${siteList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${siteDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${name}
+ ${test_result}= CORDRobot.compare_dict ${siteDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Site API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet CORE_SITES
+ ${get_result}= CORDRobot.ApiGet CORE_SITES
${putSiteList}= Get Variable Value ${putList}
- ${putSiteDict}= utils.listToDict ${putSiteList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${putSiteDict} name
- ${siteDict}= utils.getDictFromListofDict ${get_result} name ${name}
- ${siteID}= utils.getFieldValueFromDict ${siteDict} id
- ${api_result}= restApi.ApiPut CORE_SITES ${putSiteDict} ${siteID}
+ ${putSiteDict}= CORDRobot.listToDict ${putSiteList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${putSiteDict} name
+ ${siteDict}= CORDRobot.getDictFromListofDict ${get_result} name ${name}
+ ${siteID}= CORDRobot.getFieldValueFromDict ${siteDict} id
+ ${api_result}= CORDRobot.ApiPut CORE_SITES ${putSiteDict} ${siteID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiGet CORE_SITES ${siteID}
- ${test_result}= utils.compare_dict ${putSiteDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiGet CORE_SITES ${siteID}
+ ${test_result}= CORDRobot.compare_dict ${putSiteDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Site API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SITES
+ ${json_result}= CORDRobot.ApiGet CORE_SITES
${siteList}= Get Variable Value ${slist}
- ${siteDict}= utils.listToDict ${siteList} ${listIndex}
- ${name}= utils.getFieldValueFromDict ${siteDict} name
+ ${siteDict}= CORDRobot.listToDict ${siteList} ${listIndex}
+ ${name}= CORDRobot.getFieldValueFromDict ${siteDict} name
Log ${name}
- ${siteDict}= utils.getDictFromListofDict ${json_result} name ${name}
+ ${siteDict}= CORDRobot.getDictFromListofDict ${json_result} name ${name}
Log ${siteDict}
- ${siteId}= utils.getFieldValueFromDict ${siteDict} id
+ ${siteId}= CORDRobot.getFieldValueFromDict ${siteDict} id
Log ${siteId}
- ${test_result}= restApi.ApiDelete CORE_SITES ${siteId}
+ ${test_result}= CORDRobot.ApiDelete CORE_SITES ${siteId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/SliceTest.txt b/src/test/cord-api/Tests/SliceTest.txt
index d1cd2e9..ee7ec11 100644
--- a/src/test/cord-api/Tests/SliceTest.txt
+++ b/src/test/cord-api/Tests/SliceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
| Variables | ../Properties/RestApiProperties.py
*** Variables ***
@@ -33,7 +33,7 @@
*** Keywords ***
Read InputFile
- ${sliceList} = utils.jsonToList ${PATHFILE} SliceInfo
+ ${sliceList} = CORDRobot.jsonToList ${PATHFILE} SliceInfo
Set Suite Variable ${sList} ${sliceList}
${site}= Catenate SEPARATOR= http:// ${IP} : ${PORT} /api/core/sites/1/
Set Suite Variable ${site} ${site}
@@ -49,39 +49,39 @@
Test Post Slice API
[Arguments] ${listIndex}
${sliceList} = Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
${site}= Get Variable Value ${site}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} site ${site}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} site ${site}
${creator}= Get Variable Value ${creator}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} creator ${creator}
- ${api_result}= restApi.ApiPost CORE_SLICES ${sliceDict}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} creator ${creator}
+ ${api_result}= CORDRobot.ApiPost CORE_SLICES ${sliceDict}
Should Be True ${api_result}
Test Get Slice API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SLICES
+ ${json_result}= CORDRobot.ApiGet CORE_SLICES
Log ${json_result}
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
${site}= Get Variable Value ${site}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} site ${site}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} site ${site}
${creator}= Get Variable Value ${creator}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} creator ${creator}
- ${ID}= utils.getFieldValueFromDict ${sliceDict} id
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} id ${ID}
- ${test_result}= utils.compare_dict ${sliceDict} ${getJsonDict}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} creator ${creator}
+ ${ID}= CORDRobot.getFieldValueFromDict ${sliceDict} id
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} id ${ID}
+ ${test_result}= CORDRobot.compare_dict ${sliceDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Slice API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_SLICES
+ ${json_getresult}= CORDRobot.ApiGet CORE_SLICES
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sList} ${listIndex}
- ${sliceName}= utils.getFieldValueFromDict ${sliceDict} name
+ ${sliceDict}= CORDRobot.listToDict ${sList} ${listIndex}
+ ${sliceName}= CORDRobot.getFieldValueFromDict ${sliceDict} name
Log ${sliceName}
- ${getSliceDict}= utils.getDictFromListofDict ${json_getresult} name ${sliceName}
+ ${getSliceDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${sliceName}
Log ${getSliceDict}
- ${sliceID}= utils.getFieldValueFromDict ${getSliceDict} id
+ ${sliceID}= CORDRobot.getFieldValueFromDict ${getSliceDict} id
Log ${sliceID}
- ${test_result}= restApi.ApiDelete CORE_SLICES ${sliceID}
+ ${test_result}= CORDRobot.ApiDelete CORE_SLICES ${sliceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/SubscriberTest.txt b/src/test/cord-api/Tests/SubscriberTest.txt
index d69181e..04f272c 100644
--- a/src/test/cord-api/Tests/SubscriberTest.txt
+++ b/src/test/cord-api/Tests/SubscriberTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -46,9 +46,9 @@
*** Keywords ***
Read InputFile
- ${subscriberList} = utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${subscriberList} = CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${subscriberList}
- ${putSubscriberList}= utils.jsonToList ${PATHFILE2} SubscriberInfo
+ ${putSubscriberList}= CORDRobot.jsonToList ${PATHFILE2} SubscriberInfo
Set Suite Variable ${putList} ${putSubscriberList}
Verify Subscriber functionality
@@ -61,45 +61,45 @@
Test Post Subscriber API
[Arguments] ${listIndex}
${subscriberList} = Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${api_result}= restApi.ApiPost TENANT_SUBSCRIBER ${subscriberDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost TENANT_SUBSCRIBER ${subscriberDict}
Should Be True ${api_result}
Test Get Subscriber API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet TENANT_SUBSCRIBER
+ ${json_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
Log ${json_result}
${subscriberList}= Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${AccountNum}= utils.getFieldValueFromDict ${subscriberDict} account_num
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} account_num ${AccountNum}
- ${test_result}= utils.compare_dict ${subscriberDict} ${getJsonDict}
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${AccountNum}= CORDRobot.getFieldValueFromDict ${subscriberDict} account_num
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} account_num ${AccountNum}
+ ${test_result}= CORDRobot.compare_dict ${subscriberDict} ${getJsonDict}
Should Be True ${test_result}
Test Edit Subscriber API
[Arguments] ${listIndex}
- ${get_result}= restApi.ApiGet TENANT_SUBSCRIBER
+ ${get_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
${putSubscriberList}= Get Variable Value ${putList}
- ${putSubscriberDict}= utils.listToDict ${putSubscriberList} ${listIndex}
- ${AcctNum}= utils.getFieldValueFromDict ${putSubscriberDict} account_num
- ${subscriberDict}= utils.getDictFromListofDict ${get_result} account_num ${AcctNum}
- ${subscriberID}= utils.getFieldValueFromDict ${subscriberDict} id
- ${api_result}= restApi.ApiPut TENANT_SUBSCRIBER ${putSubscriberDict} ${subscriberID}
+ ${putSubscriberDict}= CORDRobot.listToDict ${putSubscriberList} ${listIndex}
+ ${AcctNum}= CORDRobot.getFieldValueFromDict ${putSubscriberDict} account_num
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${get_result} account_num ${AcctNum}
+ ${subscriberID}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
+ ${api_result}= CORDRobot.ApiPut TENANT_SUBSCRIBER ${putSubscriberDict} ${subscriberID}
Should Be True ${api_result}
- ${getResultAfterPut}= restApi.ApiGet TENANT_SUBSCRIBER ${subscriberID}
- ${test_result}= utils.compare_dict ${putSubscriberDict} ${getResultAfterPut}
+ ${getResultAfterPut}= CORDRobot.ApiGet TENANT_SUBSCRIBER ${subscriberID}
+ ${test_result}= CORDRobot.compare_dict ${putSubscriberDict} ${getResultAfterPut}
Should Be True ${test_result}
Test Delete Subscriber API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet TENANT_SUBSCRIBER
+ ${json_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
${subscriberList}= Get Variable Value ${slist}
- ${subscriberDict}= utils.listToDict ${subscriberList} ${listIndex}
- ${AcctNum}= utils.getFieldValueFromDict ${subscriberDict} account_num
+ ${subscriberDict}= CORDRobot.listToDict ${subscriberList} ${listIndex}
+ ${AcctNum}= CORDRobot.getFieldValueFromDict ${subscriberDict} account_num
Log ${AcctNum}
- ${subscriberDict}= utils.getDictFromListofDict ${json_result} account_num ${AcctNum}
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${json_result} account_num ${AcctNum}
Log ${subscriberDict}
- ${subscriberId}= utils.getFieldValueFromDict ${subscriberDict} id
+ ${subscriberId}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
Log ${subscriberId}
- ${test_result}= restApi.ApiDelete TENANT_SUBSCRIBER ${subscriberId}
+ ${test_result}= CORDRobot.ApiDelete TENANT_SUBSCRIBER ${subscriberId}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/SubscriberVolt_Delete.txt b/src/test/cord-api/Tests/SubscriberVolt_Delete.txt
index 5621b24..faab026 100644
--- a/src/test/cord-api/Tests/SubscriberVolt_Delete.txt
+++ b/src/test/cord-api/Tests/SubscriberVolt_Delete.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -27,7 +27,7 @@
*** Keywords ***
Read InputFile
- ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo
+ ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
Verify Deletion of Subscriber and volt Tenant functionality
@@ -36,20 +36,20 @@
Test Delete Subscriber and voltTenant
[Arguments] ${listIndex}
- ${getSubscriber_result}= restApi.ApiGet TENANT_SUBSCRIBER
- ${getVoltTenant_result}= restApi.ApiGet TENANT_VOLT
+ ${getSubscriber_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
+ ${getVoltTenant_result}= CORDRobot.ApiGet TENANT_VOLT
${voltList}= Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${account_num}= Get From Dictionary ${voltTenantDict} account_num
- ${subscriberDict}= utils.getDictFromListofDict ${getSubscriber_result} account_num ${account_num}
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${getSubscriber_result} account_num ${account_num}
Log ${subscriberDict}
- ${subscriberId}= utils.getFieldValueFromDict ${subscriberDict} id
+ ${subscriberId}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
Log ${subscriberId}
- ${subscriber_delete_result}= restApi.ApiDelete TENANT_SUBSCRIBER ${subscriberId}
+ ${subscriber_delete_result}= CORDRobot.ApiDelete TENANT_SUBSCRIBER ${subscriberId}
Should Be True ${subscriber_delete_result}
# Deletion of volt Tenants
- ${getVoltDict}= utils.getDictFromListOfDict ${getVoltTenant_result} subscriber ${subscriberId}
- ${voltID}= utils.getFieldValueFromDict ${getVoltDict} id
- ${volt_delete_result}= restApi.ApiDelete TENANT_VOLT ${voltID}
+ ${getVoltDict}= CORDRobot.getDictFromListOfDict ${getVoltTenant_result} subscriber ${subscriberId}
+ ${voltID}= CORDRobot.getFieldValueFromDict ${getVoltDict} id
+ ${volt_delete_result}= CORDRobot.ApiDelete TENANT_VOLT ${voltID}
Should Be True ${volt_delete_result}
diff --git a/src/test/cord-api/Tests/Subscriber_StatusChecks.txt b/src/test/cord-api/Tests/Subscriber_StatusChecks.txt
index ae85153..eee3777 100644
--- a/src/test/cord-api/Tests/Subscriber_StatusChecks.txt
+++ b/src/test/cord-api/Tests/Subscriber_StatusChecks.txt
@@ -7,9 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Resource ../Framework/utils/utils.robot
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Subscriber_TopDown.json
@@ -41,7 +40,7 @@
Run Keyword And Ignore Error Wait Until Keyword Succeeds 300s 5s Ping Gateway ${dst_ip} ${dst_user} ${dst_pass} ${dst_gateway}
Read InputFile
- ${SubscriberList}= utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${SubscriberList}
Set Global Variable ${Subscriber_Id} ${EMPTY}
Set Global Variable ${status} ${EMPTY}
@@ -56,14 +55,14 @@
[Arguments] ${listIndex}
Set Global Variable ${Subscriber_Id} ${EMPTY}
Log ${Subscriber_Id}
- ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
Log ${json_result}
${SubscriberList} = Get Variable Value ${slist}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} ${listIndex}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} ${listIndex}
Log ${SubscriberDict}
- ${onu_device}= utils.getFieldValueFromDict ${subscriberDict} onu_device
+ ${onu_device}= CORDRobot.getFieldValueFromDict ${subscriberDict} onu_device
${json_result_list}= Get From dictionary ${json_result} items
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} onu_device ${onu_device}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} onu_device ${onu_device}
${status}= Get From Dictionary ${getJsonDict} status
${Subscriber_Id}= Get From Dictionary ${getJsonDict} id
Set Global Variable ${Subscriber_Id}
@@ -74,18 +73,18 @@
Subscriber Status Change
[Arguments] ${listIndex}
${status}= Create Dictionary status=enabled
- ${api_result_status}= restApi.ApiChameleonPut VOLT_SUBSCRIBER ${status} ${Subscriber_Id}
+ ${api_result_status}= CORDRobot.ApiChameleonPut VOLT_SUBSCRIBER ${status} ${Subscriber_Id}
Should Be True ${api_result_status}
Wait Until Keyword Succeeds 60s 2s Test Ping ${ENABLE_STATUS} ${src_ip} ${src_user} ${src_pass} ${dst_host_ip}
Push MAC and IP For Subscriber
[Arguments] ${listIndex}
${SubscriberList} = Get Variable Value ${slist}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} ${listIndex}
- ${mac_address}= utils.getFieldValueFromDict ${subscriberDict} mac_address
- ${ip_address}= utils.getFieldValueFromDict ${subscriberDict} ip_address
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} ${listIndex}
+ ${mac_address}= CORDRobot.getFieldValueFromDict ${subscriberDict} mac_address
+ ${ip_address}= CORDRobot.getFieldValueFromDict ${subscriberDict} ip_address
${input_dict}= Create Dictionary mac_address=${mac_address} ip_address=${ip_address}
- ${api_result_status}= restApi.ApiChameleonPut VOLT_SUBSCRIBER ${input_dict} ${Subscriber_Id}
+ ${api_result_status}= CORDRobot.ApiChameleonPut VOLT_SUBSCRIBER ${input_dict} ${Subscriber_Id}
Should Be True ${api_result_status}
Wait Until Keyword Succeeds 60s 2s Test Ping ${MACIP_STATUS} ${src_ip} ${src_user} ${src_pass} ${dst_host_ip}
diff --git a/src/test/cord-api/Tests/Subscriber_TopDown.txt b/src/test/cord-api/Tests/Subscriber_TopDown.txt
index ce3c12d..e572421 100644
--- a/src/test/cord-api/Tests/Subscriber_TopDown.txt
+++ b/src/test/cord-api/Tests/Subscriber_TopDown.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/Subscriber_TopDown.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${SubscriberList}= utils.jsonToList ${PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${PATHFILE} SubscriberInfo
Set Suite Variable ${slist} ${SubscriberList}
Set Global Variable ${Subscriber_Id} ${EMPTY}
@@ -33,8 +33,8 @@
Post Subscriber
[Arguments] ${listIndex}
${SubscriberList} = Get Variable Value ${slist}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson VOLT_SUBSCRIBER ${SubscriberDict}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson VOLT_SUBSCRIBER ${SubscriberDict}
Should Be True ${api_result_status}
${Subscriber_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${Subscriber_Id}
@@ -42,10 +42,10 @@
Get Subscriber
[Arguments] ${listIndex}
Log ${Subscriber_Id}
- ${json_result}= restApi.ApiChameleonGet VOLT_SUBSCRIBER ${Subscriber_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet VOLT_SUBSCRIBER ${Subscriber_Id}
Log ${json_result}
${SubscriberList} = Get Variable Value ${slist}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} ${listIndex}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} ${listIndex}
Log ${SubscriberDict}
- ${test_result}= utils.compare_dict ${SubscriberDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${SubscriberDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/UISliceTest.txt b/src/test/cord-api/Tests/UISliceTest.txt
index d1cd2e9..ee7ec11 100644
--- a/src/test/cord-api/Tests/UISliceTest.txt
+++ b/src/test/cord-api/Tests/UISliceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
| Variables | ../Properties/RestApiProperties.py
*** Variables ***
@@ -33,7 +33,7 @@
*** Keywords ***
Read InputFile
- ${sliceList} = utils.jsonToList ${PATHFILE} SliceInfo
+ ${sliceList} = CORDRobot.jsonToList ${PATHFILE} SliceInfo
Set Suite Variable ${sList} ${sliceList}
${site}= Catenate SEPARATOR= http:// ${IP} : ${PORT} /api/core/sites/1/
Set Suite Variable ${site} ${site}
@@ -49,39 +49,39 @@
Test Post Slice API
[Arguments] ${listIndex}
${sliceList} = Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
${site}= Get Variable Value ${site}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} site ${site}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} site ${site}
${creator}= Get Variable Value ${creator}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} creator ${creator}
- ${api_result}= restApi.ApiPost CORE_SLICES ${sliceDict}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} creator ${creator}
+ ${api_result}= CORDRobot.ApiPost CORE_SLICES ${sliceDict}
Should Be True ${api_result}
Test Get Slice API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_SLICES
+ ${json_result}= CORDRobot.ApiGet CORE_SLICES
Log ${json_result}
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
${site}= Get Variable Value ${site}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} site ${site}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} site ${site}
${creator}= Get Variable Value ${creator}
- ${sliceDict}= utils.setFieldValueInDict ${sliceDict} creator ${creator}
- ${ID}= utils.getFieldValueFromDict ${sliceDict} id
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} id ${ID}
- ${test_result}= utils.compare_dict ${sliceDict} ${getJsonDict}
+ ${sliceDict}= CORDRobot.setFieldValueInDict ${sliceDict} creator ${creator}
+ ${ID}= CORDRobot.getFieldValueFromDict ${sliceDict} id
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} id ${ID}
+ ${test_result}= CORDRobot.compare_dict ${sliceDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Slice API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_SLICES
+ ${json_getresult}= CORDRobot.ApiGet CORE_SLICES
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sList} ${listIndex}
- ${sliceName}= utils.getFieldValueFromDict ${sliceDict} name
+ ${sliceDict}= CORDRobot.listToDict ${sList} ${listIndex}
+ ${sliceName}= CORDRobot.getFieldValueFromDict ${sliceDict} name
Log ${sliceName}
- ${getSliceDict}= utils.getDictFromListofDict ${json_getresult} name ${sliceName}
+ ${getSliceDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${sliceName}
Log ${getSliceDict}
- ${sliceID}= utils.getFieldValueFromDict ${getSliceDict} id
+ ${sliceID}= CORDRobot.getFieldValueFromDict ${getSliceDict} id
Log ${sliceID}
- ${test_result}= restApi.ApiDelete CORE_SLICES ${sliceID}
+ ${test_result}= CORDRobot.ApiDelete CORE_SLICES ${sliceID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/Users.txt b/src/test/cord-api/Tests/Users.txt
index 1b263aa..e765d65 100644
--- a/src/test/cord-api/Tests/Users.txt
+++ b/src/test/cord-api/Tests/Users.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -36,7 +36,7 @@
*** Keywords ***
Read InputFile
- ${userList} = utils.jsonToList ${PATHFILE} UserInfo
+ ${userList} = CORDRobot.jsonToList ${PATHFILE} UserInfo
Set Suite Variable ${uList} ${userList}
Verify User functionality
@@ -48,31 +48,31 @@
Test Post Users API
[Arguments] ${listIndex}
${userList} = Get Variable Value ${uList}
- ${userDict}= utils.listToDict ${userList} ${listIndex}
- ${api_result}= restApi.ApiPost CORE_USERS ${userDict}
+ ${userDict}= CORDRobot.listToDict ${userList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CORE_USERS ${userDict}
Should Be True ${api_result}
Test Get Users API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CORE_USERS
+ ${json_result}= CORDRobot.ApiGet CORE_USERS
Log ${json_result}
${userList}= Get Variable Value ${uList}
- ${inputDict}= utils.listToDict ${userList} ${listIndex}
- ${email}= utils.getFieldValueFromDict ${inputDict} email
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} email ${email}
- ${test_result}= utils.compare_dict ${inputDict} ${getJsonDict}
+ ${inputDict}= CORDRobot.listToDict ${userList} ${listIndex}
+ ${email}= CORDRobot.getFieldValueFromDict ${inputDict} email
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} email ${email}
+ ${test_result}= CORDRobot.compare_dict ${inputDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Users API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CORE_USERS
+ ${json_getresult}= CORDRobot.ApiGet CORE_USERS
${userList}= Get Variable Value ${uList}
- ${userDict}= utils.listToDict ${uList} ${listIndex}
- ${email}= utils.getFieldValueFromDict ${userDict} email
+ ${userDict}= CORDRobot.listToDict ${uList} ${listIndex}
+ ${email}= CORDRobot.getFieldValueFromDict ${userDict} email
Log ${email}
- ${getUserDict}= utils.getDictFromListofDict ${json_getresult} email ${email}
+ ${getUserDict}= CORDRobot.getDictFromListofDict ${json_getresult} email ${email}
Log ${getUserDict}
- ${userID}= utils.getFieldValueFromDict ${getUserDict} id
+ ${userID}= CORDRobot.getFieldValueFromDict ${getUserDict} id
Log ${userID}
- ${test_result}= restApi.ApiDelete CORE_USERS ${userID}
+ ${test_result}= CORDRobot.ApiDelete CORE_USERS ${userID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/UtilsSynchronizer.txt b/src/test/cord-api/Tests/UtilsSynchronizer.txt
index ab158ea..1266aa8 100644
--- a/src/test/cord-api/Tests/UtilsSynchronizer.txt
+++ b/src/test/cord-api/Tests/UtilsSynchronizer.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -45,7 +45,7 @@
*** Keywords ***
Read InputFile
- ${syncList} = utils.jsonToList ${PATHFILE} SynchronizerInfo
+ ${syncList} = CORDRobot.jsonToList ${PATHFILE} SynchronizerInfo
Set Suite Variable ${sList} ${syncList}
Verify Utility Synchronizer functionality
@@ -57,28 +57,28 @@
Test Post Utils Synchronizer API
[Arguments] ${listIndex}
${syncList} = Get Variable Value ${sList}
- ${syncDict}= utils.listToDict ${syncList} ${listIndex}
- ${api_result}= restApi.ApiPost UTILS_SYNCHRONIZER ${syncDict}
+ ${syncDict}= CORDRobot.listToDict ${syncList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost UTILS_SYNCHRONIZER ${syncDict}
Should Be True ${api_result}
Test Get Utils Synchronizer API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet UTILS_SYNCHRONIZER
+ ${json_result}= CORDRobot.ApiGet UTILS_SYNCHRONIZER
Log ${json_result}
${syncList}= Get Variable Value ${sList}
- ${syncDict}= utils.listToDict ${syncList} ${listIndex}
- ${syncName}= utils.getFieldValueFromDict ${syncDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result} name ${syncName}
- ${test_result}= utils.compare_dict ${syncDict} ${getJsonDict}
+ ${syncDict}= CORDRobot.listToDict ${syncList} ${listIndex}
+ ${syncName}= CORDRobot.getFieldValueFromDict ${syncDict} name
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result} name ${syncName}
+ ${test_result}= CORDRobot.compare_dict ${syncDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Utils Synchronizer API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet UTILS_SYNCHRONIZER
+ ${json_getresult}= CORDRobot.ApiGet UTILS_SYNCHRONIZER
${syncList}= Get Variable Value ${sList}
- ${syncDict}= utils.listToDict ${syncList} ${listIndex}
- ${syncName}= utils.getFieldValueFromDict ${syncDict} name
- ${getSyncDict}= utils.getDictFromListofDict ${json_getresult} name ${syncName}
- ${syncID}= utils.getFieldValueFromDict ${getSyncDict} id
- ${test_result}= restApi.ApiDelete UTILS_SYNCHRONIZER ${syncID}
+ ${syncDict}= CORDRobot.listToDict ${syncList} ${listIndex}
+ ${syncName}= CORDRobot.getFieldValueFromDict ${syncDict} name
+ ${getSyncDict}= CORDRobot.getDictFromListofDict ${json_getresult} name ${syncName}
+ ${syncID}= CORDRobot.getFieldValueFromDict ${getSyncDict} id
+ ${test_result}= CORDRobot.ApiDelete UTILS_SYNCHRONIZER ${syncID}
Should be True ${test_result}
diff --git a/src/test/cord-api/Tests/VOLTDevice_Test.txt b/src/test/cord-api/Tests/VOLTDevice_Test.txt
index 75444a8..653086b 100644
--- a/src/test/cord-api/Tests/VOLTDevice_Test.txt
+++ b/src/test/cord-api/Tests/VOLTDevice_Test.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/VOLTDevice.json
@@ -56,13 +56,13 @@
*** Keywords ***
Read InputFile
- ${voltDeviceList}= utils.jsonToList ${PATHFILE} VOLTDeviceInfo
+ ${voltDeviceList}= CORDRobot.jsonToList ${PATHFILE} VOLTDeviceInfo
Set Suite Variable ${dlist} ${voltDeviceList}
Set Global Variable ${VOLTDevice_Id} ${EMPTY}
- ${PONPortList}= utils.jsonToList ${PATHFILE1} PONPortInfo
+ ${PONPortList}= CORDRobot.jsonToList ${PATHFILE1} PONPortInfo
Set Suite Variable ${plist} ${PONPortList}
Set Suite Variable ${PONPort_Id} ${EMPTY}
- ${ONUDeviceList}= utils.jsonToList ${PATHFILE2} ONUDeviceInfo
+ ${ONUDeviceList}= CORDRobot.jsonToList ${PATHFILE2} ONUDeviceInfo
Set Suite Variable ${nlist} ${ONUDeviceList}
Set Suite Variable ${ONUDevice_Id} ${EMPTY}
@@ -79,14 +79,14 @@
Test Post VOLT Device API
[Arguments] ${listIndex}
${voltDeviceList} = Get Variable Value ${dlist}
- ${voltDeviceDict}= utils.listToDict ${voltDeviceList} ${listIndex}
- ${api_getResult}= restApi.ApiGet VOLT_SERVICE
+ ${voltDeviceDict}= CORDRobot.listToDict ${voltDeviceList} ${listIndex}
+ ${api_getResult}= CORDRobot.ApiGet VOLT_SERVICE
${voltServiceList}= Get From Dictionary ${api_getResult} items
- ${voltServiceDict}= utils.getDictFromListOfDict ${voltServiceList} leaf_model_name VOLTService
+ ${voltServiceDict}= CORDRobot.getDictFromListOfDict ${voltServiceList} leaf_model_name VOLTService
${VOLTService_Id}= Get From Dictionary ${voltServiceDict} id
- ${voltDeviceDict}= utils.setFieldValueInDict ${voltDeviceDict} volt_service_id ${VOLTService_Id}
+ ${voltDeviceDict}= CORDRobot.setFieldValueInDict ${voltDeviceDict} volt_service_id ${VOLTService_Id}
Log ${voltDeviceDict}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson VOLT_DEVICE ${voltDeviceDict}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson VOLT_DEVICE ${voltDeviceDict}
Should Be True ${api_result_status}
${VOLTDevice_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${VOLTDevice_Id}
@@ -94,20 +94,20 @@
Test Get VOLT Device API
[Arguments] ${listIndex}
Log ${VOLTDevice_Id}
- ${json_result}= restApi.ApiChameleonGet VOLT_DEVICE ${VOLTDevice_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet VOLT_DEVICE ${VOLTDevice_Id}
Log ${json_result}
${voltDeviceList} = Get Variable Value ${dlist}
- ${voltDeviceDict}= utils.listToDict ${voltDeviceList} ${listIndex}
+ ${voltDeviceDict}= CORDRobot.listToDict ${voltDeviceList} ${listIndex}
Log ${voltDeviceDict}
- ${test_result}= utils.compare_dict ${voltDeviceDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${voltDeviceDict} ${json_result}
Should Be True ${test_result}
Test Post PONPort API
[Arguments] ${listIndex}
${PONPortList} = Get Variable Value ${plist}
- ${PONPortDict}= utils.listToDict ${PONPortList} ${listIndex}
- ${PONPortDict}= utils.setFieldValueInDict ${PONPortDict} olt_device_id ${VOLTDevice_Id}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson PON_PORT ${PONPortDict}
+ ${PONPortDict}= CORDRobot.listToDict ${PONPortList} ${listIndex}
+ ${PONPortDict}= CORDRobot.setFieldValueInDict ${PONPortDict} olt_device_id ${VOLTDevice_Id}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson PON_PORT ${PONPortDict}
Should Be True ${api_result_status}
${PONPort_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${PONPort_Id}
@@ -115,20 +115,20 @@
Test Get PONPort API
[Arguments] ${listIndex}
Log ${PONPort_Id}
- ${json_result}= restApi.ApiChameleonGet PON_PORT ${PONPort_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet PON_PORT ${PONPort_Id}
Log ${json_result}
${PONPortList} = Get Variable Value ${plist}
- ${PONPortDict}= utils.listToDict ${PONPortList} ${listIndex}
+ ${PONPortDict}= CORDRobot.listToDict ${PONPortList} ${listIndex}
Log ${PONPortDict}
- ${test_result}= utils.compare_dict ${PONPortDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${PONPortDict} ${json_result}
Should Be True ${test_result}
Test Post ONUDevice API
[Arguments] ${listIndex}
${ONUDeviceList}= Get Variable Value ${nlist}
- ${ONUDeviceDict}= utils.listToDict ${ONUDeviceList} ${listIndex}
- ${ONUDeviceDict}= utils.setFieldValueInDict ${ONUDeviceDict} pon_port_id ${PONPort_Id}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson ONU_DEVICE ${ONUDeviceDict}
+ ${ONUDeviceDict}= CORDRobot.listToDict ${ONUDeviceList} ${listIndex}
+ ${ONUDeviceDict}= CORDRobot.setFieldValueInDict ${ONUDeviceDict} pon_port_id ${PONPort_Id}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson ONU_DEVICE ${ONUDeviceDict}
Should Be True ${api_result_status}
${ONUDevice_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${ONUDevice_Id}
@@ -136,15 +136,15 @@
Test Get ONUDevice API
[Arguments] ${listIndex}
Log ${ONUDevice_Id}
- ${json_result}= restApi.ApiChameleonGet ONU_DEVICE ${ONUDevice_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet ONU_DEVICE ${ONUDevice_Id}
Log ${json_result}
${ONUDeviceList} = Get Variable Value ${nlist}
- ${ONUDeviceDict}= utils.listToDict ${ONUDeviceList} ${listIndex}
+ ${ONUDeviceDict}= CORDRobot.listToDict ${ONUDeviceList} ${listIndex}
Log ${ONUDeviceDict}
- ${test_result}= utils.compare_dict ${ONUDeviceDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${ONUDeviceDict} ${json_result}
Should Be True ${test_result}
Test Delete VOLT Device API
[Arguments] ${listIndex}
- ${test_result}= restApi.ApiChameleonDelete VOLT_DEVICE ${VOLTDevice_Id}
+ ${test_result}= CORDRobot.ApiChameleonDelete VOLT_DEVICE ${VOLTDevice_Id}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/VoltTenant.txt b/src/test/cord-api/Tests/VoltTenant.txt
index 136cae6..2b2e7bd 100644
--- a/src/test/cord-api/Tests/VoltTenant.txt
+++ b/src/test/cord-api/Tests/VoltTenant.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -25,9 +25,9 @@
*** Keywords ***
Read InputFile
- ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo
+ ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo
Set Suite Variable ${vlist} ${voltList}
- ${putvoltList}= utils.jsonToList ${PATHFILE2} voltSubscriberInfo
+ ${putvoltList}= CORDRobot.jsonToList ${PATHFILE2} voltSubscriberInfo
Set Suite Variable ${putList} ${putvoltList}
Verify volt Tenant Functionality
@@ -37,29 +37,29 @@
Test Post volt Tenant API
[Arguments] ${listIndex}
${voltTenantList} = Get Variable Value ${vlist}
- ${voltTenantDict}= utils.listToDict ${voltTenantList} ${listIndex}
+ ${voltTenantDict}= CORDRobot.listToDict ${voltTenantList} ${listIndex}
${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
${account_num}= Get From Dictionary ${voltTenantDict} account_num
- ${get_result}= restApi.ApiGet TENANT_SUBSCRIBER
- ${subscriberDict}= utils.getDictFromListofDict ${get_result} account_num ${account_num}
- ${subscriberID}= utils.getFieldValueFromDict ${subscriberDict} id
- ${updatedVoltDict}= utils.setFieldValueInDict ${voltDict} subscriber ${subscriberID}
- ${api_result}= restApi.ApiPost TENANT_VOLT ${updatedVoltDict}
+ ${get_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER
+ ${subscriberDict}= CORDRobot.getDictFromListofDict ${get_result} account_num ${account_num}
+ ${subscriberID}= CORDRobot.getFieldValueFromDict ${subscriberDict} id
+ ${updatedVoltDict}= CORDRobot.setFieldValueInDict ${voltDict} subscriber ${subscriberID}
+ ${api_result}= CORDRobot.ApiPost TENANT_VOLT ${updatedVoltDict}
Should Be True ${api_result}
# Verifying Get operation after POST
- ${getVolt_result}= restApi.ApiGet TENANT_VOLT
- ${getJsonDict}= utils.getDictFromListOfDict ${getVolt_result} subscriber ${subscriberID}
- ${test_result}= utils.compare_dict ${voltDict} ${getJsonDict}
+ ${getVolt_result}= CORDRobot.ApiGet TENANT_VOLT
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${getVolt_result} subscriber ${subscriberID}
+ ${test_result}= CORDRobot.compare_dict ${voltDict} ${getJsonDict}
Should Be True ${test_result}
# Verifying PUT operation
${putvoltList}= Get Variable Value ${putList}
- ${putVoltDict}= utils.listToDict ${putvoltList} ${listIndex}
+ ${putVoltDict}= CORDRobot.listToDict ${putvoltList} ${listIndex}
${putvoltTenantDict}= Get From Dictionary ${putVoltDict} voltTenant
- ${voltID}= utils.getFieldValueFromDict ${getJsonDict} id
- ${put_result}= restApi.ApiPut TENANT_VOLT ${putvoltTenantDict} ${voltID}
+ ${voltID}= CORDRobot.getFieldValueFromDict ${getJsonDict} id
+ ${put_result}= CORDRobot.ApiPut TENANT_VOLT ${putvoltTenantDict} ${voltID}
Should Be True ${put_result}
# Verifying Get after PUT operation
- ${getVolt_afterPut}= restApi.ApiGet TENANT_VOLT
- ${getVoltDict}= utils.getDictFromListofDict ${getVolt_afterPut} id ${voltID}
- ${result_afterPut}= utils.compare_dict ${putvoltTenantDict} ${getVoltDict}
+ ${getVolt_afterPut}= CORDRobot.ApiGet TENANT_VOLT
+ ${getVoltDict}= CORDRobot.getDictFromListofDict ${getVolt_afterPut} id ${voltID}
+ ${result_afterPut}= CORDRobot.compare_dict ${putvoltTenantDict} ${getVoltDict}
Should Be True ${result_afterPut}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt b/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
index 6ff873c..a984f5c 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../../Framework/utils/utils.py
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/ATTWhiteList.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${AttWhiteListList}= utils.jsonToList ${PATHFILE} AttWhiteListInfo
+ ${AttWhiteListList}= CORDRobot.jsonToList ${PATHFILE} AttWhiteListInfo
Set Suite Variable ${slist} ${AttWhiteListList}
Set Global Variable ${AttWorkFlowDriver_Id} ${EMPTY}
Set Global Variable ${AttWhiteList_Id} ${EMPTY}
@@ -34,15 +34,15 @@
Post White List
[Arguments] ${listIndex}
${AttWhiteListList} = Get Variable Value ${slist}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} ${listIndex}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} ${listIndex}
# Retrieve ATT Service Driver Id
- ${api_getResult}= restApi.ApiGet ATT_SERVICE
+ ${api_getResult}= CORDRobot.ApiGet ATT_SERVICE
${AttWorkFlowDriverList}= Get From Dictionary ${api_getResult} items
- ${AttWorkFlowDriverDict}= utils.getDictFromListOfDict ${AttWorkFlowDriverList} leaf_model_name AttWorkflowDriverService
+ ${AttWorkFlowDriverDict}= CORDRobot.getDictFromListOfDict ${AttWorkFlowDriverList} leaf_model_name AttWorkflowDriverService
${AttWorkFlowDriver_Id}= Get From Dictionary ${AttWorkFlowDriverDict} id
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${AttWorkFlowDriver_Id}
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${AttWorkFlowDriver_Id}
Log ${AttWhiteListDict}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson ATT_WHITELIST ${AttWhiteListDict}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson ATT_WHITELIST ${AttWhiteListDict}
Should Be True ${api_result_status}
${AttWhiteList_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${AttWhiteList_Id}
@@ -50,10 +50,10 @@
Get White List
[Arguments] ${listIndex}
Log ${AttWhiteList_Id}
- ${json_result}= restApi.ApiChameleonGet ATT_WHITELIST ${AttWhiteList_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet ATT_WHITELIST ${AttWhiteList_Id}
Log ${json_result}
${AttWhiteListList} = Get Variable Value ${slist}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} ${listIndex}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} ${listIndex}
Log ${AttWhiteListDict}
- ${test_result}= utils.compare_dict ${AttWhiteListDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${AttWhiteListDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt b/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
index 6254777..781efa8 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../../Framework/utils/utils.py
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/ATTWorkFlowDriver.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${AttWorkFlowList}= utils.jsonToList ${PATHFILE} AttWorkFlowDriverInfo
+ ${AttWorkFlowList}= CORDRobot.jsonToList ${PATHFILE} AttWorkFlowDriverInfo
Set Suite Variable ${slist} ${AttWorkFlowList}
Set Global Variable ${AttWorkFlowDriver_Id} ${EMPTY}
@@ -33,8 +33,8 @@
Post ATT Driver
[Arguments] ${listIndex}
${AttWorkFlowList} = Get Variable Value ${slist}
- ${AttWorkFlowDriverDict}= utils.listToDict ${AttWorkFlowList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson ATT_SERVICE ${AttWorkFlowDriverDict}
+ ${AttWorkFlowDriverDict}= CORDRobot.listToDict ${AttWorkFlowList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson ATT_SERVICE ${AttWorkFlowDriverDict}
Should Be True ${api_result_status}
${AttWorkFlowDriver_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${AttWorkFlowDriver_Id}
@@ -42,10 +42,10 @@
Get ATT Driver
[Arguments] ${listIndex}
Log ${AttWorkFlowDriver_Id}
- ${json_result}= restApi.ApiChameleonGet ATT_SERVICE ${AttWorkFlowDriver_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet ATT_SERVICE ${AttWorkFlowDriver_Id}
Log ${json_result}
${AttWorkFlowList} = Get Variable Value ${slist}
- ${AttWorkFlowDriverDict}= utils.listToDict ${AttWorkFlowList} ${listIndex}
+ ${AttWorkFlowDriverDict}= CORDRobot.listToDict ${AttWorkFlowList} ${listIndex}
Log ${AttWorkFlowDriverDict}
- ${test_result}= utils.compare_dict ${AttWorkFlowDriverDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${AttWorkFlowDriverDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_FabricConfig.txt b/src/test/cord-api/Tests/WorkflowValidations/ATT_FabricConfig.txt
index beb277a..a211672 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_FabricConfig.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_FabricConfig.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../../Framework/utils/utils.py
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ../data/FabricSwitch.json
@@ -30,10 +30,10 @@
*** Keywords ***
Read InputFile
- ${FabricList}= utils.jsonToList ${PATHFILE} FabricSwitchInfo
+ ${FabricList}= CORDRobot.jsonToList ${PATHFILE} FabricSwitchInfo
Set Suite Variable ${dlist} ${FabricList}
Set Global Variable ${Fabric_Id} ${EMPTY}
- ${FabricPortList}= utils.jsonToList ${PATHFILE1} FabricSwitchPort
+ ${FabricPortList}= CORDRobot.jsonToList ${PATHFILE1} FabricSwitchPort
Set Suite Variable ${plist} ${FabricPortList}
Set Global Variable ${SwitchPort_Id} ${EMPTY}
@@ -47,8 +47,8 @@
Test Create Fabric Switch
[Arguments] ${listIndex}
${FabricList} = Get Variable Value ${dlist}
- ${FabricDict}= utils.listToDict ${FabricList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson FABRIC_SWITCH ${FabricDict}
+ ${FabricDict}= CORDRobot.listToDict ${FabricList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson FABRIC_SWITCH ${FabricDict}
Should Be True ${api_result_status}
${Fabric_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${Fabric_Id}
@@ -56,20 +56,20 @@
Test Get Fabric Switch
[Arguments] ${listIndex}
Log ${Fabric_Id}
- ${json_result}= restApi.ApiChameleonGet FABRIC_SWITCH ${Fabric_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet FABRIC_SWITCH ${Fabric_Id}
Log ${json_result}
${FabricList} = Get Variable Value ${dlist}
- ${FabricDict}= utils.listToDict ${FabricList} ${listIndex}
+ ${FabricDict}= CORDRobot.listToDict ${FabricList} ${listIndex}
Log ${FabricDict}
- ${test_result}= utils.compare_dict ${FabricDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${FabricDict} ${json_result}
Should Be True ${test_result}
Test Create Switch Port API
[Arguments] ${listIndex}
${SwitchPortList} = Get Variable Value ${plist}
- ${SwitchPortDict}= utils.listToDict ${SwitchPortList} ${listIndex}
- ${SwitchPortDict}= utils.setFieldValueInDict ${SwitchPortDict} switch_id ${Fabric_Id}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson SWITCH_PORT ${SwitchPortDict}
+ ${SwitchPortDict}= CORDRobot.listToDict ${SwitchPortList} ${listIndex}
+ ${SwitchPortDict}= CORDRobot.setFieldValueInDict ${SwitchPortDict} switch_id ${Fabric_Id}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson SWITCH_PORT ${SwitchPortDict}
Should Be True ${api_result_status}
${SwitchPort_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${SwitchPort_Id}
@@ -77,10 +77,10 @@
Test Get Switch Port API
[Arguments] ${listIndex}
Log ${SwitchPort_Id}
- ${json_result}= restApi.ApiChameleonGet SWITCH_PORT ${SwitchPort_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet SWITCH_PORT ${SwitchPort_Id}
Log ${json_result}
${SwitchPortList} = Get Variable Value ${plist}
- ${SwitchPortDict}= utils.listToDict ${SwitchPortList} ${listIndex}
+ ${SwitchPortDict}= CORDRobot.listToDict ${SwitchPortList} ${listIndex}
Log ${SwitchPortDict}
- ${test_result}= utils.compare_dict ${SwitchPortDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${SwitchPortDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot
index 12359d8..7bc579a 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.robot
@@ -23,17 +23,9 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library /home/cord/voltha/tests/atests/common/testCaseUtils.py
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/OLT.robot
-Resource ../../Framework/DHCP.robot
-Variables ../../Properties/RestApiProperties.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
+ariables ../../Properties/RestApiProperties.py
*** Variables ***
${POD_NAME} flex-pod1-olt
@@ -314,19 +306,19 @@
Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
- ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
+ ${AttWhiteListList}= CORDRobot.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Set Suite Variable ${AttWhiteListList}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
Set Global Variable ${onu_location}
- ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Set Global Variable ${SubscriberList}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
- ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
- ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
- ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
- ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
+ ${s_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} s_tag
+ ${c_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} c_tag
+ ${VoltDeviceList}= CORDRobot.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
+ ${VoltDeviceDict}= CORDRobot.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Set Global Variable ${VoltDeviceList}
Set Global Variable ${VoltDeviceDict}
Set Suite Variable ${s_tag}
@@ -401,7 +393,7 @@
Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
Create Whitelist
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
Remove Whitelist
@@ -417,7 +409,7 @@
CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Create Subscriber
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Remove Subscriber
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001_Optimized.robot b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001_Optimized.robot
index 9c5b318..607d670 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001_Optimized.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001_Optimized.robot
@@ -23,16 +23,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library /home/cord/voltha/tests/atests/common/testCaseUtils.py
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/OLT.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
@@ -288,21 +280,21 @@
Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
- ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
+ ${AttWhiteListList}= CORDRobot.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Set Suite Variable ${AttWhiteListList}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
Set Global Variable ${onu_device}
${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
Set Global Variable ${onu_location}
- ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Set Global Variable ${SubscriberList}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
- ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
- ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
- ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
- ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
+ ${s_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} s_tag
+ ${c_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} c_tag
+ ${VoltDeviceList}= CORDRobot.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
+ ${VoltDeviceDict}= CORDRobot.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Set Global Variable ${VoltDeviceList}
Set Global Variable ${VoltDeviceDict}
Set Suite Variable ${s_tag}
@@ -403,7 +395,7 @@
Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
Create Whitelist
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
Remove Whitelist
@@ -419,7 +411,7 @@
CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Create Subscriber
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Remove Subscriber
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test002.robot b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test002.robot
index e4b1c63..2acdd49 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test002.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test002.robot
@@ -23,16 +23,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library /home/ubuntu/voltha/tests/atests/common/testCaseUtils.py
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/OLT.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
@@ -126,20 +118,20 @@
Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
- ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
+ ${AttWhiteListList}= CORDRobot.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Set Suite Variable ${AttWhiteListList}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
Set Suite Variable ${att_workflow_service_id}
${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
Set Global Variable ${onu_location}
- ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Set Global Variable ${SubscriberList}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
- ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
- ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
- ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
- ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
+ ${s_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} s_tag
+ ${c_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} c_tag
+ ${VoltDeviceList}= CORDRobot.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
+ ${VoltDeviceDict}= CORDRobot.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Set Global Variable ${VoltDeviceList}
Set Global Variable ${VoltDeviceDict}
Set Suite Variable ${s_tag}
@@ -217,8 +209,8 @@
Create Whitelist
[Arguments] ${index_id}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} ${index_id}
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} ${index_id}
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
Remove Whitelist
@@ -239,7 +231,7 @@
Create Subscriber
[Arguments] ${index_id}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} ${index_id}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} ${index_id}
Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Remove Subscriber
diff --git a/src/test/cord-api/Tests/WorkflowValidations/BBSIM.robot b/src/test/cord-api/Tests/WorkflowValidations/BBSIM.robot
index c4e16d4..b9fc8f2 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/BBSIM.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/BBSIM.robot
@@ -21,14 +21,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
diff --git a/src/test/cord-api/Tests/WorkflowValidations/BNGPortMapping.txt b/src/test/cord-api/Tests/WorkflowValidations/BNGPortMapping.txt
index dac01c2..7082ee8 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/BNGPortMapping.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/BNGPortMapping.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../../Framework/utils/utils.py
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${PATHFILE} ${CURDIR}/data/BNGPortMapping.json
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${BNGList}= utils.jsonToList ${PATHFILE} BNGPortMapping
+ ${BNGList}= CORDRobot.jsonToList ${PATHFILE} BNGPortMapping
Set Suite Variable ${dlist} ${BNGList}
Set Global Variable ${BNG_Id} ${EMPTY}
@@ -33,8 +33,8 @@
Create BNG Mapping
[Arguments] ${listIndex}
${BNGList} = Get Variable Value ${dlist}
- ${BNGDict}= utils.listToDict ${BNGList} ${listIndex}
- ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson BNG_MAP ${BNGDict}
+ ${BNGDict}= CORDRobot.listToDict ${BNGList} ${listIndex}
+ ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson BNG_MAP ${BNGDict}
Should Be True ${api_result_status}
${BNG_Id}= Get From Dictionary ${api_result_json} id
Set Global Variable ${BNG_Id}
@@ -42,10 +42,10 @@
Validate posted BNG Port
[Arguments] ${listIndex}
Log ${BNG_Id}
- ${json_result}= restApi.ApiChameleonGet BNG_MAP ${BNG_Id}
+ ${json_result}= CORDRobot.ApiChameleonGet BNG_MAP ${BNG_Id}
Log ${json_result}
${BNGList} = Get Variable Value ${dlist}
- ${BNGDict}= utils.listToDict ${BNGList} ${listIndex}
+ ${BNGDict}= CORDRobot.listToDict ${BNGList} ${listIndex}
Log ${BNGDict}
- ${test_result}= utils.compare_dict ${BNGDict} ${json_result}
+ ${test_result}= CORDRobot.compare_dict ${BNGDict} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/DataPlane_FailureTests.robot b/src/test/cord-api/Tests/WorkflowValidations/DataPlane_FailureTests.robot
index 4c0571f..e116c01 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/DataPlane_FailureTests.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/DataPlane_FailureTests.robot
@@ -23,16 +23,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library /home/cord/voltha/tests/atests/common/testCaseUtils.py
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/OLT.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
@@ -139,19 +131,19 @@
Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
- ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
+ ${AttWhiteListList}= CORDRobot.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Set Suite Variable ${AttWhiteListList}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
Set Global Variable ${onu_location}
- ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Set Global Variable ${SubscriberList}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
- ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
- ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
- ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
- ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
+ ${s_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} s_tag
+ ${c_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} c_tag
+ ${VoltDeviceList}= CORDRobot.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
+ ${VoltDeviceDict}= CORDRobot.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Set Global Variable ${VoltDeviceList}
Set Global Variable ${VoltDeviceDict}
Set Suite Variable ${s_tag}
@@ -233,7 +225,7 @@
Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
Create Whitelist
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
Remove Whitelist
@@ -249,7 +241,7 @@
CORD Put ${ATT_WHITELIST} {"pon_port_id": ${onu_location} } ${whitelist_id}
Create Subscriber
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
Wait Until Keyword Succeeds 120s 15s CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Remove Subscriber
diff --git a/src/test/cord-api/Tests/WorkflowValidations/SIAB.robot b/src/test/cord-api/Tests/WorkflowValidations/SIAB.robot
index 88a7753..e3e5115 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/SIAB.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/SIAB.robot
@@ -23,16 +23,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ${VOLTHA_DIR}/tests/atests/common/testCaseUtils.py
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/OLT.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
@@ -295,22 +287,22 @@
Create Session ${server_ip} http://${server_ip}:${server_port} auth=${AUTH} headers=${HEADERS}
${att_workflow_service_id}= Get Service Owner Id ${ATT_SERVICE}
${volt_service_id}= Get Service Owner Id ${VOLT_SERVICE}
- ${AttWhiteListList}= utils.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
+ ${AttWhiteListList}= CORDRobot.jsonToList ${WHITELIST_PATHFILE} AttWhiteListInfo
Set Suite Variable ${AttWhiteListList}
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
- ${AttWhiteListDict}= utils.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${att_workflow_service_id}
${onu_device}= Get From Dictionary ${AttWhiteListDict} serial_number
Log ${onu_device}
Set Global Variable ${onu_device}
${onu_location}= Get From Dictionary ${AttWhiteListDict} pon_port_id
Set Global Variable ${onu_location}
- ${SubscriberList}= utils.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
+ ${SubscriberList}= CORDRobot.jsonToList ${SUBSCRIBER_PATHFILE} SubscriberInfo
Set Global Variable ${SubscriberList}
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
- ${s_tag}= utils.getFieldValueFromDict ${SubscriberDict} s_tag
- ${c_tag}= utils.getFieldValueFromDict ${SubscriberDict} c_tag
- ${VoltDeviceList}= utils.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
- ${VoltDeviceDict}= utils.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
+ ${s_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} s_tag
+ ${c_tag}= CORDRobot.getFieldValueFromDict ${SubscriberDict} c_tag
+ ${VoltDeviceList}= CORDRobot.jsonToList ${VOLT_DEVICE_PATHFILE} VOLTDeviceInfo
+ ${VoltDeviceDict}= CORDRobot.setFieldValueInDict ${VoltDeviceList[0]} volt_service_id ${volt_service_id}
Set Global Variable ${VoltDeviceList}
Set Global Variable ${VoltDeviceDict}
Set Suite Variable ${s_tag}
@@ -389,9 +381,9 @@
Run kubectl wait -n voltha pod/${RG_CONTAINER} --for condition=Ready --timeout=180s
Create Whitelist
- ${AttWhiteListDict}= utils.listToDict ${AttWhiteListList} 0
+ ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} 0
${resp}= CORD Post ${ATT_WHITELIST} ${AttWhiteListDict}
- ${whitelist_id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Global Variable ${whitelist_id}
Remove Whitelist
@@ -399,7 +391,7 @@
CORD Delete ${ATT_WHITELIST} ${whitelist_id}
Create Subscriber
- ${SubscriberDict}= utils.listToDict ${SubscriberList} 0
+ ${SubscriberDict}= CORDRobot.listToDict ${SubscriberList} 0
CORD Post ${VOLT_SUBSCRIBER} ${SubscriberDict}
Remove Subscriber
diff --git a/src/test/cord-api/Tests/WorkflowValidations/SystemUpgrade.robot b/src/test/cord-api/Tests/WorkflowValidations/SystemUpgrade.robot
index c674140..6f53df8 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/SystemUpgrade.robot
+++ b/src/test/cord-api/Tests/WorkflowValidations/SystemUpgrade.robot
@@ -22,15 +22,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Resource ../../Framework/Subscriber.robot
-Resource ../../Framework/ATTWorkFlowDriver.robot
-Resource ../../Framework/Kubernetes.robot
-Resource ../../Framework/ONU.robot
-Resource ../../Framework/OLT.robot
-Resource ../../Framework/DHCP.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
*** Variables ***
diff --git a/src/test/cord-api/Tests/defaultImagesCheck.txt b/src/test/cord-api/Tests/defaultImagesCheck.txt
index fd38c2e..132243c 100644
--- a/src/test/cord-api/Tests/defaultImagesCheck.txt
+++ b/src/test/cord-api/Tests/defaultImagesCheck.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${USER} admin
@@ -21,7 +21,7 @@
*** Keywords ***
Read InputFile
- ${imageList}= utils.jsonToList ${PATHFILE} imagesInfo
+ ${imageList}= CORDRobot.jsonToList ${PATHFILE} imagesInfo
Set Suite Variable ${ilist} ${imageList}
Verify Image Check
@@ -29,8 +29,8 @@
Run Keyword If "${type}" == "IMAGE" Test Image Check
Test Image Check
- ${json_result}= restApi.ApiGet CORE_IMAGES
+ ${json_result}= CORDRobot.ApiGet CORE_IMAGES
Log ${json_result}
${imageList}= Get Variable Value ${ilist}
- ${test_result}= utils.compare_list_of_dicts ${imageList} ${json_result}
+ ${test_result}= CORDRobot.compare_list_of_dicts ${imageList} ${json_result}
Should Be True ${test_result}
diff --git a/src/test/cord-api/Tests/targets/xosapitests.xtarget b/src/test/cord-api/Tests/targets/xosapitests.xtarget
index 90b1b96..79cc0e4 100644
--- a/src/test/cord-api/Tests/targets/xosapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosapitests.xtarget
@@ -8,9 +8,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library HttpLibrary.HTTP
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../Properties/RestApiProperties.py
*** Variables ***
@@ -49,7 +48,7 @@
${resp}= Get Request ${SERVER_IP} ${service}/${id}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${amend_value}= Run Keyword If '${key}' != 'null' Get Json Value ${resp.content} /${key}
+ ${amend_value}= Run Keyword If '${key}' != 'null' Get From Dictionary ${resp.json()} ${key}
${amend_value}= Run Keyword If '${key}' != 'null' Remove String ${amend_value} "
Run Keyword If '${key}' != 'null' Should Contain "${value}" ${amend_value}
[Return] ${resp}
@@ -61,7 +60,7 @@
${resp}= Post Request ${SERVER_IP} uri=${service} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
@@ -72,7 +71,7 @@
${resp}= Put Request ${SERVER_IP} uri=${service}/${data_id} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
@@ -225,7 +224,7 @@
${json_{{ m.name | lower}}_tmp}= Set Json Value ${json_{{ m.name | lower }}_tmp} /no_sync true
${json_{{ m.name | lower }}_tmp}= To JSON ${json_{{ m.name | lower }}_tmp}
${resp}= CORD Post /xosapi/v1/${xos_service}/{{ m.name | lower}}s ${json_{{ m.name | lower }}_tmp}
- ${id_{{ m.name | lower }}_tmp}= Get Json Value ${resp.content} /id
+ ${id_{{ m.name | lower }}_tmp}= Get From Dictionary ${resp.json()} id
Append To List ${dependent_{{ m.name | lower }}_ids} ${id_{{ m.name | lower }}_tmp}
[Return] ${id_{{ m.name | lower }}_tmp}
{% endif %}
diff --git a/src/test/cord-api/Tests/targets/xoslibrary.xtarget b/src/test/cord-api/Tests/targets/xoslibrary.xtarget
index 5e40468..5da2b9d 100644
--- a/src/test/cord-api/Tests/targets/xoslibrary.xtarget
+++ b/src/test/cord-api/Tests/targets/xoslibrary.xtarget
@@ -5,9 +5,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library HttpLibrary.HTTP
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../Properties/RestApiProperties.py
*** Keywords ***
@@ -24,7 +23,7 @@
${resp}= Get Request ${SERVER_IP} ${service}/${id}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${updated_value}= Run Keyword If '${key}' != 'null' Get Json Value ${resp.content} /${key}
+ ${updated_value}= Run Keyword If '${key}' != 'null' Get From Dictionary ${resp.json()} ${key}
${updated_value}= Run Keyword If '${key}' != 'null' Remove String ${updated_value} "
Run Keyword If '${key}' != 'null' Should Contain "${value}" ${updated_value}
[Return] ${resp}
@@ -36,7 +35,7 @@
${resp}= Post Request ${SERVER_IP} uri=${service} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
@@ -47,7 +46,7 @@
${resp}= Put Request ${SERVER_IP} uri=${service}/${data_id} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
@@ -89,7 +88,7 @@
${json_{{ m.name | lower }}_1}= Set Json Value ${json_{{ m.name | lower }}_1} /{{ f.name }} "${json_{{ m.name | lower }}_{{ f.name }}_1}"
{% elif f.name == "s_tag" and m.name == "BNGPortMapping" -%}
${json_{{ m.name | lower}}_{{ f.name }}_1}= Generate Random Value vlan_tag
- ${json_{{ m.name | lower}}_1}= Set Json Value ${json_{{ m.name | lower }}_1} /{{ f.name }} "${json_{{ m.name | lower}}_{{ f.name }}_1}"
+ ${json_{{ m.name | lower}}_1}= Set Json Value ${json_{{ m.name | lower }}_1} /{{ f.name }} "${json_{{ m.name | lower}}_{{ f.name }}_1}"
{% else -%}
${json_{{ m.name | lower}}_{{ f.name }}_1}= Generate Random Value {{ f.type }}
${json_{{ m.name | lower }}_1}= Set Json Value ${json_{{ m.name | lower }}_1} /{{ f.name }} "${json_{{ m.name | lower }}_{{ f.name }}_1}"
@@ -247,10 +246,10 @@
${json_{{ m.name | lower}}_amend_1}= Set Json Value ${json_{{ m.name | lower }}_amend_1} /serial_number "amendserialnumber"
{% endif %}
${json_{{ m.name | lower}}_tmp}= Set Json Value ${json_{{ m.name | lower }}_tmp} /no_policy true
- ${json_{{ m.name | lower}}_tmp}= Set Json Value ${json_{{ m.name | lower }}_tmp} /no_sync true
+ ${json_{{ m.name | lower}}_tmp}= Set Json Value ${json_{{ m.name | lower }}_tmp} /no_sync true
${json_{{ m.name | lower }}_tmp}= To JSON ${json_{{ m.name | lower }}_tmp}
${resp}= CORD Post /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}} ${json_{{ m.name | lower }}_tmp}
- ${id_{{ m.name | lower }}_tmp}= Get Json Value ${resp.content} /id
+ ${id_{{ m.name | lower }}_tmp}= Get From Dictionary ${resp.json()} id
Append To List ${dependent_{{ m.name | lower }}_ids} ${id_{{ m.name | lower }}_tmp}
[Return] ${id_{{ m.name | lower }}_tmp}
{% endif %}
diff --git a/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget b/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
index c35d3e4..af9a668 100644
--- a/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
+++ b/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget
@@ -9,9 +9,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library HttpLibrary.HTTP
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Resource ${TESTLIBRARY}
Variables ../Properties/RestApiProperties.py
diff --git a/src/test/cord-api/Tests/targets/xosserviceupgradetest.xtarget b/src/test/cord-api/Tests/targets/xosserviceupgradetest.xtarget
index c87b17d..cf12f7f 100644
--- a/src/test/cord-api/Tests/targets/xosserviceupgradetest.xtarget
+++ b/src/test/cord-api/Tests/targets/xosserviceupgradetest.xtarget
@@ -9,9 +9,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library HttpLibrary.HTTP
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Resource ${TESTLIBRARY}
Variables ../Properties/RestApiProperties.py
@@ -47,4 +46,4 @@
Should Be Equal As Strings ${resp.status_code} 200
${jsondata}= To Json ${resp.content}
Log ${data}
- ${test_result}= utils.compare_list_of_dicts ${list1} ${jsondata['items']}
\ No newline at end of file
+ ${test_result}= CORDRobot.compare_list_of_dicts ${list1} ${jsondata['items']}
diff --git a/src/test/cord-api/Tests/targets/xosstaticlibrary.xtarget b/src/test/cord-api/Tests/targets/xosstaticlibrary.xtarget
index 62b2f4c..1791f49 100644
--- a/src/test/cord-api/Tests/targets/xosstaticlibrary.xtarget
+++ b/src/test/cord-api/Tests/targets/xosstaticlibrary.xtarget
@@ -5,9 +5,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library HttpLibrary.HTTP
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../Properties/RestApiProperties.py
*** Variables ***
@@ -37,7 +36,7 @@
${resp}= Get Request ${SERVER_IP} ${service}/${id}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${updated_value}= Run Keyword If '${key}' != 'null' Get Json Value ${resp.content} /${key}
+ ${updated_value}= Run Keyword If '${key}' != 'null' Get From Dictionary ${resp.json()} ${key}
${updated_value}= Run Keyword If '${key}' != 'null' Remove String ${updated_value} "
Run Keyword If '${key}' != 'null' Should Contain "${value}" ${updated_value}
[Return] ${resp}
@@ -49,7 +48,7 @@
${resp}= Post Request ${SERVER_IP} uri=${service} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
@@ -60,7 +59,7 @@
${resp}= Put Request ${SERVER_IP} uri=${service}/${data_id} data=${data}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
- ${id}= Get Json Value ${resp.content} /id
+ ${id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${id}
[Return] ${resp}
@@ -254,7 +253,7 @@
${json_{{ m.name | lower}}_tmp}= Set Json Value ${json_{{ m.name | lower }}_tmp} /no_sync true
${json_{{ m.name | lower }}_tmp}= To JSON ${json_{{ m.name | lower }}_tmp}
${resp}= CORD Post /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower}} ${json_{{ m.name | lower }}_tmp}
- ${id_{{ m.name | lower }}_tmp}= Get Json Value ${resp.content} /id
+ ${id_{{ m.name | lower }}_tmp}= Get From Dictionary ${resp.json()} id
Append To List ${dependent_{{ m.name | lower }}_ids} ${id_{{ m.name | lower }}_tmp}
[Return] ${id_{{ m.name | lower }}_tmp}
{% endif %}
@@ -270,7 +269,7 @@
[Arguments] ${model} ${data}
${condition} ${modelId}= Check If Model Exists ${model}
${resp}= Run Keyword Unless ${condition} CORD Post ${model} ${data}
- ${id}= Run Keyword Unless ${condition} Get Json Value ${resp.content} /id
+ ${id}= Run Keyword Unless ${condition} Get From Dictionary ${resp.json()} id
${model_id}= Set Variable If ${condition} ${modelId} ${id}
[Return] ${model_id}
diff --git a/src/test/cord-api/Tests/xos-att-workflow-driver-tests/ATT_Workflow.robot b/src/test/cord-api/Tests/xos-att-workflow-driver-tests/ATT_Workflow.robot
index 0fbc7d9..52e56bb 100644
--- a/src/test/cord-api/Tests/xos-att-workflow-driver-tests/ATT_Workflow.robot
+++ b/src/test/cord-api/Tests/xos-att-workflow-driver-tests/ATT_Workflow.robot
@@ -1,11 +1,11 @@
*** Settings ***
Library KafkaLibrary
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
-Resource ../../Framework/utils/utils.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Suite Setup Setup
Suite Teardown Teardown
Test Template Send Event and Verify
@@ -53,7 +53,7 @@
[Documentation] Validate that creating a new whitelist entry for the "invalid" onu device will enable the onu
[Template] None
${resp}= CORD Post ${att_whitelist_api} {"serial_number": "${onu_invalid_sn}", "device_id": "${deviceId}", "pon_port_id": ${ponportno}, "owner_id": ${attworkflowservice_id}}
- ${whitelist_entry2_id}= Get Json Value ${resp.content} /id
+ ${whitelist_entry2_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${whitelist_entry2_id}
Wait Until Keyword Succeeds 30s 5s Validate ONU Device Status ${onu_invalid_sn} ENABLED
@@ -96,25 +96,25 @@
${attworkflowservice_id}= Get From Dictionary ${attworkflowservice} id
Set Suite Variable ${attworkflowservice_id}
${resp}= CORD Post ${subscriber_api} {"onu_device": "${onu_serial_no}", "status": "pre-provisioned", "upstream_bps": 1, "downstream_bps": 1, "tech_profile_id": 1}
- ${subscriber_id}= Get Json Value ${resp.content} /id
+ ${subscriber_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${subscriber_id}
${resp}= CORD Post ${olt_api} {"volt_service_id": ${voltservice_id}, "name": "testoltdevice1", "device_type": "ponism", "host": "172.17.0.1", "port": 50060, "switch_port": "1", "dp_id": "${deviceId}", "outer_tpid": "0x8100", "uplink": "128"}
- ${oltdevice_id}= Get Json Value ${resp.content} /id
+ ${oltdevice_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${oltdevice_id}
${resp}= CORD Post ${pon_ports_api} {"olt_device_id": ${oltdevice_id}, "port_no": "${ponportno}", "name": "testponport1"}
- ${ponport_id}= Get Json Value ${resp.content} /id
+ ${ponport_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${ponport_id}
${resp}= CORD Post ${onu_device_api} {"serial_number": "${onu_serial_no}", "pon_port_id": ${ponport_id}, "vendor": "abcdefg"}
- ${onu_device1_id}= Get Json Value ${resp.content} /id
+ ${onu_device1_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${onu_device1_id}
${resp}= CORD Post ${uni_ports_api} {"onu_device_id": "${onu_device1_id}", "port_no": ${uniportno}, "name": "testuniport"}
- ${uni_port_id}= Get Json Value ${resp.content} /id
+ ${uni_port_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${uni_port_id}
${resp}= CORD Post ${onu_device_api} {"serial_number": "${onu_invalid_sn}", "pon_port_id": ${ponport_id}, "vendor": "abcdefg"}
- ${onu_device2_id}= Get Json Value ${resp.content} /id
+ ${onu_device2_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${onu_device2_id}
${resp}= CORD Post ${att_whitelist_api} {"serial_number": "${onu_serial_no}", "device_id": "${deviceId}", "pon_port_id": ${ponportno}, "owner_id": ${attworkflowservice_id}}
- ${whitelist_entry_id}= Get Json Value ${resp.content} /id
+ ${whitelist_entry_id}= Get From Dictionary ${resp.json()} id
Set Suite Variable ${whitelist_entry_id}
Send Event and Verify
diff --git a/src/test/cord-api/Tests/xos-backup-tests/xos-backup.robot b/src/test/cord-api/Tests/xos-backup-tests/xos-backup.robot
index 93c2267..3affc23 100644
--- a/src/test/cord-api/Tests/xos-backup-tests/xos-backup.robot
+++ b/src/test/cord-api/Tests/xos-backup-tests/xos-backup.robot
@@ -4,15 +4,12 @@
*** Settings ***
Documentation Test backup/restore of a models in XOS
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
Library DateTime
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
-Variables ../../Properties/RestApiProperties.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Suite Setup Setup
Suite Teardown Teardown
Test Template Validate Operation
@@ -134,4 +131,4 @@
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${jsondata}= To Json ${resp.content}
- Should Be Equal As Strings ${jsondata['status']} ${state}
\ No newline at end of file
+ Should Be Equal As Strings ${jsondata['status']} ${state}
diff --git a/src/test/cord-api/Tests/xos-migration-tests/xos-remove-service.robot b/src/test/cord-api/Tests/xos-migration-tests/xos-remove-service.robot
index 01a9bd0..fcb61ee 100644
--- a/src/test/cord-api/Tests/xos-migration-tests/xos-remove-service.robot
+++ b/src/test/cord-api/Tests/xos-migration-tests/xos-remove-service.robot
@@ -1,15 +1,13 @@
*** Settings ***
Documentation Test remove of a service
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
Library DateTime
-Library ../../Framework/utils/utils.py
Library DatabaseLibrary
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
Suite Setup Setup
Suite Teardown Teardown
diff --git a/src/test/cord-api/Tests/xos-migration-tests/xos-service-migrations.robot b/src/test/cord-api/Tests/xos-migration-tests/xos-service-migrations.robot
index 0d042ca..0770577 100644
--- a/src/test/cord-api/Tests/xos-migration-tests/xos-service-migrations.robot
+++ b/src/test/cord-api/Tests/xos-migration-tests/xos-service-migrations.robot
@@ -20,14 +20,12 @@
*** Settings ***
Documentation Test migration of a Service in the core
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
Library DateTime
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
Suite Setup Setup
Suite Teardown Teardown
diff --git a/src/test/cord-api/Tests/xos-scale-tests/utils/devices.py b/src/test/cord-api/Tests/xos-scale-tests/utils/devices.py
index 86c6e6b..dd142a8 100644
--- a/src/test/cord-api/Tests/xos-scale-tests/utils/devices.py
+++ b/src/test/cord-api/Tests/xos-scale-tests/utils/devices.py
@@ -12,8 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import
+
from tinydb import TinyDB, Query
-from robot.api import logger
+# from robot.api import logger
+
class devices(object):
@@ -119,7 +122,7 @@
formatted for the XOS Rest API
:return: a list of PON Ports
"""
- return self.pon_ports.all();
+ return self.pon_ports.all()
def update_pon_port_id(self, pon_port, id):
"""
@@ -152,7 +155,7 @@
return onus
def get_rest_onus(self):
- return self.onus.all();
+ return self.onus.all()
def update_onu_id(self, onu, id):
Onu = Query()
@@ -178,7 +181,7 @@
return unis
def get_rest_unis(self):
- return self.uni_ports.all();
+ return self.uni_ports.all()
def update_uni_id(self, uni, id):
UniPort = Query()
diff --git a/src/test/cord-api/Tests/xos-scale-tests/xos-scale-att-workflow.robot b/src/test/cord-api/Tests/xos-scale-tests/xos-scale-att-workflow.robot
index 44b45c4..c7c85cb 100644
--- a/src/test/cord-api/Tests/xos-scale-tests/xos-scale-att-workflow.robot
+++ b/src/test/cord-api/Tests/xos-scale-tests/xos-scale-att-workflow.robot
@@ -2,7 +2,6 @@
Documentation Scale up models in a SEBA deployment with no backends
Library KafkaLibrary
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
diff --git a/src/test/cord-api/Tests/xos-test-service/test-service.robot b/src/test/cord-api/Tests/xos-test-service/test-service.robot
index 220c4b4..b7c9ed4 100644
--- a/src/test/cord-api/Tests/xos-test-service/test-service.robot
+++ b/src/test/cord-api/Tests/xos-test-service/test-service.robot
@@ -7,14 +7,12 @@
*** Settings ***
Documentation Test migration of a Service in the core
Library RequestsLibrary
-Library HttpLibrary.HTTP
Library Collections
Library String
Library OperatingSystem
Library DateTime
-Library ../../Framework/utils/utils.py
-Resource ../../Framework/utils/utils.robot
-Library ../../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../../Properties/RestApiProperties.py
Suite Setup Setup
Suite Teardown Teardown
diff --git a/src/test/cord-api/setup_venv.sh b/src/test/cord-api/setup_venv.sh
deleted file mode 100755
index 120906f..0000000
--- a/src/test/cord-api/setup_venv.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-# setup_venv_lite.sh
-# sets up a python virtualenv for running cord-tester framework tests
-
-WORKSPACE=${WORKSPACE:-.}
-VENVDIR="${WORKSPACE}/venv-cord-tester"
-
-# create venv if it's not yet there
-if [ ! -x "${VENVDIR}/bin/activate" ]; then
- echo "Setting up dev/test virtualenv in ${VENVDIR} for CORD-TESTER"
- virtualenv -q "${VENVDIR}" --no-site-packages
- echo "Virtualenv created."
-fi
-
-echo "Installing python requirements in virtualenv with pip"
-source "${VENVDIR}/bin/activate"
-pip install --upgrade pip
-pip install cryptography==2.4.2 robotframework robotframework-requests robotframework-sshlibrary \
- pexpect robotframework-httplibrary robotframework-kafkalibrary pygments pyyaml \
- robotframework-databaselibrary psycopg2==2.7.7 paramiko==2.4.2
-pip install requests tinydb
-
-echo "CORD-TESTER virtualenv created. Run 'source ${VENVDIR}/bin/activate'."
diff --git a/src/test/diag/verifyCollectDiag.robot b/src/test/diag/verifyCollectDiag.robot
index 4139d3a..a03edf9 100644
--- a/src/test/diag/verifyCollectDiag.robot
+++ b/src/test/diag/verifyCollectDiag.robot
@@ -18,9 +18,8 @@
*** Settings ***
Documentation Test suite for checking results collected by `make collect-diag` command
Library OperatingSystem
-Library ../cord-api/Framework/utils/onosUtils.py
-Library ../cord-api/Framework/utils/utils.py
-Resource ../cord-api/Framework/utils/utils.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${DOCKER_CONTAINERS_FILE} ${CURDIR}/dockerContainers.json
@@ -31,14 +30,14 @@
*** Test Cases ***
Verify Docker Containers
[Documentation] Verify expected containers are up and running
- ${dockerContainersExpected} utils.jsonToList ${DOCKER_CONTAINERS_FILE} docker-containers-${CORD_PROFILE}
+ ${dockerContainersExpected} CORDRobot.jsonToList ${DOCKER_CONTAINERS_FILE} docker-containers-${CORD_PROFILE}
: FOR ${container} IN @{dockerContainersExpected}
\ Run Keyword And Continue On Failure Verify Docker Container ${container}
Verify Synchronizer Logs
[Documentation] Verify synchronizer logs are correct
${latestDiag}= Run ls -1t /home/cord | head -1
- ${synchronizerLogs} utils.readFiles /home/cord/${latestDiag}/docker/*synchronizer*.logs
+ ${synchronizerLogs} CORDRobot.readFiles /home/cord/${latestDiag}/docker/*synchronizer*.logs
: FOR ${key} IN @{synchronizerLogs.keys()}
\ @{name}= Split String ${key} -synchronizer
\ @{name}= Split String From Right @{name}[0] _ 1
@@ -57,7 +56,7 @@
Verify Synchronizer Log
[Arguments] ${name} ${log}
- ${config} utils.readFile /opt/cord/orchestration/*/*/xos/synchronizer/@{name}[1]_config.yaml
+ ${config} CORDRobot.readFile /opt/cord/orchestration/*/*/xos/synchronizer/@{name}[1]_config.yaml
${match1}= Get Lines Matching Regexp ${config} ^steps_dir: ".*"$
${match2}= Get Lines Matching Regexp ${config} ^model_policies_dir: ".*"$
Run Keyword If '${match1}' != '${EMPTY}' Should Contain ${log} Waiting for event or timeout msg= "Waiting for event or timeout" not found in @{name}[1] synchronizer log
@@ -77,17 +76,17 @@
Verify ONOS Status
[Arguments] ${onosName}
- ${onosStatus} utils.readFile /home/cord/diag-*/${onosName}/nodes
+ ${onosStatus} CORDRobot.readFile /home/cord/diag-*/${onosName}/nodes
Should Contain ${onosStatus} READY
Verify ONOS Applications
[Arguments] ${onosName} ${cordProfile}
- ${onosAppsExpected} utils.jsonToList ${ONOS_APPS_FILE} ${onosName}-${cordProfile}
- ${onosApps} utils.readFile /home/cord/diag-*/${onosName}/apps_-s_-a
+ ${onosAppsExpected} CORDRobot.jsonToList ${ONOS_APPS_FILE} ${onosName}-${cordProfile}
+ ${onosApps} CORDRobot.readFile /home/cord/diag-*/${onosName}/apps_-s_-a
: FOR ${app} IN @{onosAppsExpected}
\ Should Contain ${onosApps} ${app}
Verify ONOS Log
[Arguments] ${onosName}
- ${onosLog} utils.readFile /home/cord/diag-*/${onosName}/log_display
+ ${onosLog} CORDRobot.readFile /home/cord/diag-*/${onosName}/log_display
Should Not Contain ${onosLog} ERROR
diff --git a/src/test/diag/verifySoakDiag.txt b/src/test/diag/verifySoakDiag.txt
index 0b9b22c..ca7648b 100644
--- a/src/test/diag/verifySoakDiag.txt
+++ b/src/test/diag/verifySoakDiag.txt
@@ -16,8 +16,8 @@
*** Settings ***
Documentation Test suite for checking results collected by various commands on the soak server
Library OperatingSystem
-Library ../cord-api/Framework/utils/onosUtils.py
-Library ../cord-api/Framework/utils/utils.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${FILE_PATH} /home/cord/SoakTest_Logs
diff --git a/src/test/ng4t/NG4T-Test.robot b/src/test/ng4t/NG4T-Test.robot
index 8627800..2b7f33d 100644
--- a/src/test/ng4t/NG4T-Test.robot
+++ b/src/test/ng4t/NG4T-Test.robot
@@ -17,8 +17,8 @@
Documentation Test runner suite for executing NG4T Tests inside the venb vm instance
Library OperatingSystem
Library SSHLibrary
-Library ../cord-api/Framework/utils/utils.py
-Resource ../cord-api/Framework/utils/utils.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${compute_node_user} ubuntu
@@ -45,7 +45,7 @@
${nova_id}= Run . /opt/cord_profile/admin-openrc.sh; nova list --all-tenants | grep venb | awk '{print $2}'
${mgmt_ip}= Run . /opt/cord_profile/admin-openrc.sh; nova show ${nova_id} | grep management | awk '{print $5}'
${compute_hostname}= Run . /opt/cord_profile/admin-openrc.sh; nova show ${nova_id} | grep :host | awk '{print $4}'
- ${ng4t_tests} utils.jsonToList ${NG4T_TESTS_FILE} mcord-ng4t-tests
+ ${ng4t_tests} CORDRobot.jsonToList ${NG4T_TESTS_FILE} mcord-ng4t-tests
Set Suite Variable ${compute_hostname}
Set Suite Variable ${ng4t_tests}
Set Suite Variable ${mgmt_ip}
diff --git a/src/test/robot/SanityK8POD.robot b/src/test/robot/SanityK8POD.robot
index b51fd54..f433c31 100644
--- a/src/test/robot/SanityK8POD.robot
+++ b/src/test/robot/SanityK8POD.robot
@@ -17,9 +17,8 @@
Documentation Test suite to validate K8s in the experimental ControlKube Scenario
Suite Setup Setup
Library OperatingSystem
-Library ../cord-api/Framework/utils/onosUtils.py
-Library ../cord-api/Framework/utils/utils.py
-Resource ../cord-api/Framework/utils/utils.robot
+Library CORDRobot
+Library ImportResource resources=CORDRobot
*** Variables ***
${deployment} physical
@@ -156,37 +155,37 @@
@{xos_core_services}= Create List
@{onos_fabric_services}= Create List
@{voltha_services}= Create List
- ${xos-core_containers} utils.jsonToList ${resources_file} xos-core-containers
+ ${xos-core_containers} CORDRobot.jsonToList ${resources_file} xos-core-containers
: FOR ${container} IN @{xos-core_containers}
\ Append To List ${core_containers} ${container}
- ${rcord_containers} utils.jsonToList ${resources_file} rcord-lite-containers
+ ${rcord_containers} CORDRobot.jsonToList ${resources_file} rcord-lite-containers
: FOR ${container} IN @{rcord_containers}
\ Append To List ${rcord_lite_containers} ${container}
- ${onosfabric_containers} utils.jsonToList ${resources_file} onos-fabric-containers
+ ${onosfabric_containers} CORDRobot.jsonToList ${resources_file} onos-fabric-containers
: FOR ${container} IN @{onosfabric_containers}
\ Append To List ${onos_fabric_containers} ${container}
- ${volthaContainers} utils.jsonToList ${resources_file} voltha-containers
+ ${volthaContainers} CORDRobot.jsonToList ${resources_file} voltha-containers
: FOR ${container} IN @{volthaContainers}
\ Append To List ${voltha_containers} ${container}
- ${xos-core_deployments} utils.jsonToList ${resources_file} xos-core-deployments
+ ${xos-core_deployments} CORDRobot.jsonToList ${resources_file} xos-core-deployments
: FOR ${deployment} IN @{xos-core_containers}
\ Append To List ${core_deployments} ${deployment}
- ${rcord_deployments} utils.jsonToList ${resources_file} rcord-lite-deployments
+ ${rcord_deployments} CORDRobot.jsonToList ${resources_file} rcord-lite-deployments
: FOR ${deployment} IN @{rcord_deployments}
\ Append To List ${rcord_lite_deployments} ${deployment}
- ${onosfabric_deployments} utils.jsonToList ${resources_file} onos-fabric-deployments
+ ${onosfabric_deployments} CORDRobot.jsonToList ${resources_file} onos-fabric-deployments
: FOR ${deployment} IN @{onosfabric_deployments}
\ Append To List ${onos_fabric_deployments} ${deployment}
- ${volthaDeployments} utils.jsonToList ${resources_file} voltha-deployments
+ ${volthaDeployments} CORDRobot.jsonToList ${resources_file} voltha-deployments
: FOR ${deployment} IN @{volthaDeployments}
\ Append To List ${voltha_deployments} ${deployment}
- ${core_services} utils.jsonToList ${resources_file} xos-core-services
+ ${core_services} CORDRobot.jsonToList ${resources_file} xos-core-services
: FOR ${service} IN @{core_services}
\ Append To List ${xos_core_services} ${service}
- ${onos_services} utils.jsonToList ${resources_file} onos-fabric-services
+ ${onos_services} CORDRobot.jsonToList ${resources_file} onos-fabric-services
: FOR ${service} IN @{onos_services}
\ Append To List ${onos_fabric_services} ${service}
- ${volthaServices} utils.jsonToList ${resources_file} voltha-services
+ ${volthaServices} CORDRobot.jsonToList ${resources_file} voltha-services
: FOR ${service} IN @{volthaServices}
\ Append To List ${voltha_services} ${service}
Set Suite Variable @{core_containers}
diff --git a/src/test/robot/SanityPhyPOD.robot b/src/test/robot/SanityPhyPOD.robot
deleted file mode 100755
index 85536e7..0000000
--- a/src/test/robot/SanityPhyPOD.robot
+++ /dev/null
@@ -1,255 +0,0 @@
-# Copyright 2017-present Radisys Corporation
-#
-# 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 for checking default maas,xos and onos containers and fabric switch default services and maas cli commands
-Library OperatingSystem
-Library ../cord-api/Framework/utils/onosUtils.py
-Library ../cord-api/Framework/utils/utils.py
-Resource ../cord-api/Framework/utils/utils.robot
-
-*** Variables ***
-@{MAAS_SERVICE_STATUS} start/running is running
-@{JUJU_SERVICE_STATUS} active is ready unknown
-@{LXD_CONTAINER_STATUS} RUNNING
-@{BOOT_RESOURCES_OUTPUT} ubuntu/trusty
-${FABRIC_SWITCH_PROMPT} \#
-${FABRIC_SWITCH_USER} root
-${FABRIC_SWITCH_PASSWD} onl
-@{FABRIC_SERVICE_STATUS} is running
-${IP_PATTERN} (\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)
-${PUBLIC_IFACE} eth2
-${NUM_OF_SWITCHES} 4
-${CORD_PROFILE} rcord
-${FABRIC} on
-${DOCKER_CONTAINERS_FILE} ${CURDIR}/../diag/dockerContainers.json
-
-*** Test Cases ***
-Verify Headnode Interfaces
- [Tags] fabric notready
- [Documentation] Verifies the headnode interface is up and has external connectivity
- Verify HeadNode Interfaces Detected
- Test Ping ${PUBLIC_IFACE} www.opennetworking.org
-
-Get Compute Node and Fabric Info
- [Documentation] Get all information pretaining to the compute nodes and fabric
- ${nodes}= Create List
- ${hostnames}= Create List
- ${hostname_prefixes}= Create List
- ${node_ips}= Create List
- ${node_data_ips}= Create List
- ${node_count} Run cord prov list | grep node | wc -l
- ${node_count}= Convert To Integer ${node_count}
- Log ${node_count}
- ##Get hostname
- : FOR ${INDEX} IN RANGE 1 ${node_count}+1
- \ ${hostname}= Run cord prov list | grep node | awk '{print $2}' | sed -n ${INDEX}p
- \ Append To List ${hostnames} ${hostname}
- ##Get hostname prefixes
- : FOR ${INDEX} IN RANGE 0 ${node_count}
- \ ${hostname_prefix}= Remove String ${hostnames[${INDEX}]} .cord.lab
- \ Append To List ${hostname_prefixes} ${hostname_prefix}
- ##Get compute node data ips
- ${cordvtnnodes}= ONOS Command Execute onos-cord 8102 cordvtn-nodes | grep fabric
- ${nds}= Split To Lines ${cordvtnnodes}
- : FOR ${i} IN @{nds}
- \ ${data_ip}= Get Compute Node IP ${i}
- \ Append To List ${node_data_ips} ${data_ip}
- ##Get compute node ips
- : FOR ${i} IN @{hostname_prefixes}
- \ ${node_ip}= Run cord harvest list | grep ${i} | awk '{print $4}'
- \ Append To List ${node_ips} ${node_ip}
- @{switch_ips}= Discover FABRIC IPs
- Set Suite Variable ${switch_ips}
- Set Suite Variable ${hostnames}
- Set Suite Variable ${hostname_prefixes}
- Set Suite Variable ${node_ips}
- Set Suite Variable ${node_data_ips}
-
-Verify Compute Nodes Pingability Through Fabric
- [Documentation] Verifies that the two compute nodes can ping each other through the fabric
- [Tags] fabric
- ##Verify pingablilty across compute nodes
- : FOR ${src} IN @{hostname_prefixes}
- \ Ping All Compute Nodes Through Fabric ${src}
-
-Verify Compute Nodes to Fabric Pingability
- [Documentation] Verifies that the two compute nodes can ping the switches
- [Tags] fabric
- ##Verify pingability from compute nodes to fabric
- : FOR ${src} IN @{hostname_prefixes}
- \ Ping All Fabric Switches ${src}
-
-Verify CordVTN Nodes
- [Documentation] Verifies that the cordvtn app running in onos identifies the nodes and devices (fabric)
- ${nodes}= Execute ONOS Command onos-cord 8102 cordvtn-nodes
- : FOR ${i} IN @{node_ips}
- \ ${node_1}= Get Lines Containing String ${nodes} ${i}
- \ Run Keyword If "${FABRIC}" == "on" Verify CordVTN Node ${node_1} COMPLETE ${i}
- \ Run Keyword If "${FABRIC}" == "off" Verify CordVTN Node ${node_1} DEVICE_CREATED ${i}
- ${ports}= Execute ONOS Command onos-cord 8102 cordvtn-ports
- ${devices}= Execute ONOS Command onos-fabric 8101 devices
- @{switch_ips}= Discover FABRIC IPs
- : FOR ${i} IN @{switch_ips}
- \ Should Contain ${devices} ${i}
-
-Verify MAAS Service State
- [Template] Verify MAAS Service
- maas-dhcpd
- maas-regiond
- maas-clusterd
- maas-proxy
- bind9
-
-Verify Docker Containers State
- ${dockerContainers} utils.jsonToList ${DOCKER_CONTAINERS_FILE} docker-containers-${CORD_PROFILE}
- : FOR ${container} IN @{dockerContainers}
- \ Run Keyword And Continue On Failure Verify Containers ${container}
-
-Verify Juju Services State
- [Template] Verify JUJU Service
- ceilometer
- ceilometer-agent
- glance
- keystone
- mongodb
- nagios
- neutron-api
- nova-cloud-controller
- nova-compute
- openstack-dashboard
- percona-cluster
- rabbitmq-server
-
-Verify Openstack LXD Containers State
- [Template] Verify Openstack LXD Containers
- ceilometer
- glance
- keystone
- mongodb
- nagios
- neutron-api
- nova-cloud-controller
- openstack-dashboard
- percona-cluster
- rabbitmq-server
-
-Verify MAAS CLI commands
- [Tags] notready
- Login MAAS Server
- Verify MAAS CLI Commands boot-resources read | jq 'map(select(.type == "Synced"))' ubuntu/trusty
- Verify MAAS CLI Commands devices list | jq '.' | jq '.[]'.hostname | wc -l ${NUM_OF_SWITCHES}
- #Verify MAAS CLI Commands events query | jq '.' | jq .events[].id | wc -l 100
- Verify MAAS CLI Commands fabrics read | jq '.' | jq .[].name | wc -l 4
- Verify MAAS CLI Commands networks read | jq '.' | jq .[].name | wc -l 4
- Verify MAAS CLI Commands node-groups list | jq '.' | jq .[].status | wc -l 1
- Verify MAAS CLI Commands subnets read | jq '.' | jq .[].name | wc -l 4
- Verify MAAS CLI Commands nodes list | jq '.' | jq .[].substatus_name | wc -l 1
- Verify MAAS CLI Commands zones read | jq '.' | jq .[].name | wc -l 2
- Logout MAAS Server
-
-Verify Fabric Switch Service
- [Tags] fabric
- @{switch_ips}= Discover FABRIC IPs
- : FOR ${i} IN @{switch_ips}
- \ Verify Fabric Switch Service ${i} faultd
- \ Verify Fabric Switch Service ${i} netplug
- \ Verify Fabric Switch Service ${i} onlp-snmpd
- \ Verify Fabric Switch Service ${i} onlpd
- \ Verify Fabric Switch Service ${i} rsyslog
- \ Verify Fabric Switch Service ${i} snmpd
- \ Verify Fabric Switch Service ${i} ssh
- \ Verify Fabric Switch Service ${i} udev
- \ Verify Fabric Switch Service ${i} watchdog
-
-*** Keywords ***
-Verify HeadNode Interfaces Detected
- ${cmd}= Catenate SEPARATOR=| sudo ethtool mgmtbr grep 'Link detected:' awk '{ print $3 }'
- ${output}= Run ${cmd}
- Should Contain ${output} yes msg= mgmtbr is not detected !!!. Reason:
- ${cmd}= Catenate SEPARATOR=| sudo ethtool fabric grep 'Link detected:' awk '{ print $3 }'
- ${output}= Run ${cmd}
- Should Contain ${output} yes msg= fabric interface is not detected !!!. Reason:
-
-Verify CordVTN Node
- [Arguments] ${node} ${status} ${ip}
- Should Contain ${node} ${status}
- Should Contain ${node} ${ip}
-
-Verify Containers
- [Arguments] ${name}
- ${container_id}= Get Docker Container ID ${name}
- ${output}= Run docker inspect --format="{{ .State.Running }}" ${container_id}
- Should Contain ${output} true msg=${name} is not running !!!. Reason:
-
-Verify MAAS Service
- [Arguments] ${name}
- ${cmd}= Catenate sudo service ${name} status
- ${output}= Run ${cmd}
- Should Contain Any ${output} @{MAAS_SERVICE_STATUS} msg= ${name} is not running !!!. Reason:
-
-Verify JUJU Service
- [Arguments] ${name}
- ${cmd} Catenate SEPARATOR=| juju status --format=tabular grep -v grep grep ${name}/0 awk '{ print $2,$7,$8,$9,$10}'
- ${output}= Run ${cmd}
- Should Contain Any ${output} @{JUJU_SERVICE_STATUS} msg= ${name} is not running !!!. Reason:
-
-Verify Openstack LXD Containers
- [Arguments] ${name}
- ${cmd} Catenate SEPARATOR=| sudo lxc list grep -v grep grep ${name}-1 awk '{ print $2,$4 }'
- ${output}= Run ${cmd}
- Should Contain Any ${output} @{LXD_CONTAINER_STATUS} msg= ${name} is not running !!!. Reason:
-
-Verify MAAS CLI Commands
- [Arguments] ${name} ${expected}
- ${cmd} Catenate maas cord ${name}
- ${output}= Run ${cmd}
- Should Contain ${output} ${expected} msg=Reason:
-
-Login MAAS Server
- ${cmd} Catenate maas login cord http://localhost/MAAS/api/1.0 $(sudo maas-region-admin apikey --user=cord)
- ${output}= Run ${cmd}
- Should Contain ${output} You are now logged in to the MAAS msg= MAAS login failure !!!. Reason:
-
-Logout MAAS Server
- ${cmd} Catenate maas logout cord
- ${output}= Run ${cmd}
-
-Discover FABRIC IPs
- ${switches}= Run cord prov list | grep fabric | awk '{print $4}'
- @{switch_ips}= Split To Lines ${switches}
- [Return] ${switch_ips}
-
-Verify Fabric Switch Service
- [Arguments] ${ip} ${name}
- ${cmd}= Catenate service ${name} status
- ${output}= Run Command On Remote System ${ip} ${cmd} ${FABRIC_SWITCH_USER} ${FABRIC_SWITCH_PASSWD} ${FABRIC_SWITCH_PROMPT} 60s False
- Should Contain Any ${output} @{FABRIC_SERVICE_STATUS} msg= ${name} is not running !!!. Reason:
-
-Ping All Compute Nodes Through Fabric
- [Arguments] ${src_ip}
- : FOR ${dst_ip} IN @{node_data_ips}
- \ Verify Ping ubuntu ${src_ip} ${dst_ip}
-
-Ping All Fabric Switches
- [Arguments] ${src_ip}
- : FOR ${dst_ip} IN @{switch_ips}
- \ Verify Ping ubuntu ${src_ip} ${dst_ip}
-
-Verify Ping
- [Arguments] ${srcName} ${srcIP} ${dst}
- ${result}= Run ssh ${srcName}@${srcIP} "ping -c 3 ${dst}"
- Should Contain ${result} 64 bytes
- Should Not Contain ${result} Destination Host Unreachable