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/.gitignore b/.gitignore
index b209a27..fe9747d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
# IDEs artifacts
.idea
-# Virtual envs
-src/test/cord-api/venv-cord-tester/
+# Virtual
+venv_cord
# Byte-compiled / optimized / DLL files
__pycache__/
@@ -28,6 +28,7 @@
*.egg-info/
.installed.cfg
*.egg
+cord-robot/CORDRobot/VERSION
# PyInstaller
# Usually these files are written by a python script from a template
@@ -70,3 +71,9 @@
# Gradle
.gradle
+
+
+# Robot output
+output.xml
+report.html
+log.html
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3d4099f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,131 @@
+# 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.
+
+# use bash for pushd/popd, and to fail quickly. virtualenv's activate
+# has undefined variables, so no -u
+SHELL := bash -e -o pipefail
+
+WORKSPACE ?= $(HOME)
+VERSION ?= $(shell cat ./VERSION)
+
+# Robot confiig
+ROBOT_FILE ?=
+ROBOT_DIR ?=
+ROBOT_DEBUG_LOG_OPT ?=
+ROBOT_MISC_ARGS ?=
+ROBOT_TEST_TAGS ?= stable
+
+# Robot Job definitions
+siab-robot: ROBOT_FILE := SIAB.robot
+siab-robot: ROBOT_DIR := src/test/cord-api/Tests/WorkflowValidations
+siab-robot: ROBOT_MISC_ARGS += --removekeywords wuks -e notready $(ROBOT_DEBUG_LOG_OPT) -i $(ROBOT_TEST_TAGS) -v VOLTHA_DIR:$(WORKSPACE)/cord/incubator/voltha -v SUBSCRIBER_FILENAME:SIABSubscriberLatest -v WHITELIST_FILENAME:SIABWhitelistLatest -v OLT_DEVICE_FILENAME:SIABOLT0Device
+siab-robot: seba-robot
+
+seba-robot: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ cd $(ROBOT_DIR) ;\
+ robot -V $(ROBOT_FILE) $(ROBOT_MISC_ARGS)
+
+# self-test, lint, and setup targets
+ROBOT_LINT_ARGS ?= --verbose \
+ --configure LineTooLong:120 -e LineTooLong \
+ -e TooManyTestSteps \
+ -e TooManyTestCases \
+ --configure TooFewTestSteps:1 \
+ --configure TooFewKeywordSteps:1 \
+ -e FileTooLong \
+ -e TrailingWhitespace
+
+PYTHON_FILES := $(shell find ./src -name *.py -print)
+ROBOT_FILES := $(shell find ./src -name *.robot -print)
+YAML_FILES := $(shell find . -type f \( -name *.yaml -o -name *.yml \) -print)
+JSON_FILES := $(shell find ./src -name *.json -print)
+JENKINSFILES := $(shell find . -type f -name 'Jenkinsfile*' -print)
+
+# virtualenv for the robot tools
+venv_cord:
+ virtualenv -p python3 $@ ;\
+ source ./$@/bin/activate ;\
+ pip install -r requirements.txt ;\
+ pip install -e cord-robot
+
+test: cord-robot-test
+
+cord-robot-test:
+ cd cord-robot; tox
+
+lint: lint-python lint-json lint-yaml # lint-robot lint-jenkins
+
+lint-robot: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ rflint $(ROBOT_LINT_ARGS) $(ROBOT_FILES)
+
+# check deps for format and python3 cleanliness
+lint-python: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ pylint --py3k $(PYTHON_FILES) ;\
+ flake8 --max-line-length=119 --count $(PYTHON_FILES)
+
+lint-yaml: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ yamllint \
+ -d "{extends: default, rules: {line-length: {max: 119}}}" \
+ -s $(YAML_FILES)
+
+lint-json: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ for jsonfile in $(JSON_FILES); do \
+ echo "Validating json file: $$jsonfile" ;\
+ python -m json.tool $$jsonfile > /dev/null ;\
+ done
+
+# only works on declarative pipeline Jenkinsfiles
+lint-jenkins:
+ ./scripts/jflint.sh $(JENKINSFILES)
+
+# tidy target will be more useful once issue with removing leading comments
+# is resolved: https://github.com/robotframework/robotframework/issues/3263
+tidy-robot: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ python -m robot.tidy --inplace $(ROBOT_FILES);
+
+## Variables for gendocs
+TEST_SOURCE := $(wildcard tests/*/*.robot)
+TEST_BASENAME := $(basename $(TEST_SOURCE))
+TEST_DIRS := $(dir $(TEST_SOURCE))
+
+LIB_SOURCE := $(wildcard libraries/*.robot)
+LIB_BASENAME := $(basename $(LIB_SOURCE))
+LIB_DIRS := $(dir $(LIB_SOURCE))
+
+.PHONY: gendocs lint test
+# In future explore use of --docformat REST - integration w/Sphinx?
+gendocs: venv_cord
+ source ./$</bin/activate ; set -u ;\
+ mkdir -p $@ ;\
+ for dir in ${LIB_DIRS}; do mkdir -p $@/$$dir; done;\
+ for dir in ${LIB_BASENAME}; do\
+ python -m robot.libdoc --format HTML $$dir.robot $@/$$dir.html ;\
+ done ;\
+ for dir in ${TEST_DIRS}; do mkdir -p $@/$$dir; done;\
+ for dir in ${TEST_BASENAME}; do\
+ python -m robot.testdoc $$dir.robot $@/$$dir.html ;\
+ done
+
+clean:
+ find . -name output.xml -print
+
+clean-all: clean
+ rm -rf venv_cord gendocs cord-robot/CORDRobot/VERSION
+
diff --git a/VERSION b/VERSION
index c10edc3..7ec1d6d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.1.0-dev
+2.1.0
diff --git a/src/test/cord-api/Framework/utils/utils.py b/cord-robot/CORDRobot/CORDDictUtils.py
similarity index 97%
rename from src/test/cord-api/Framework/utils/utils.py
rename to cord-robot/CORDRobot/CORDDictUtils.py
index b475c06..ea13212 100644
--- a/src/test/cord-api/Framework/utils/utils.py
+++ b/cord-robot/CORDRobot/CORDDictUtils.py
@@ -22,7 +22,7 @@
import string
-class utils(object):
+class CORDDictUtils(object):
@staticmethod
def listToDict(alist, intListIndex):
dictInfo = alist[int(intListIndex)]
@@ -254,7 +254,7 @@
def getAllFieldValues(self, getJsonDataDictList, fieldName):
value_list = []
- uniqValue = ""
+ # uniqValue = "" - this is unused, commented out
uniq_list = []
for data in getJsonDataDictList:
fieldValue = ""
@@ -262,7 +262,8 @@
value_list.append(fieldValue)
uniq_list = sorted(set(value_list))
if len(uniq_list) == 1:
- uniqValue = uniq_list[0]
+ pass # see above, unused?
+ # uniqValue = uniq_list[0]
else:
print("list of values found for ", fieldName, ";", uniq_list)
return fieldValue
diff --git a/cord-robot/CORDRobot/__init__.py b/cord-robot/CORDRobot/__init__.py
new file mode 100644
index 0000000..8c357f6
--- /dev/null
+++ b/cord-robot/CORDRobot/__init__.py
@@ -0,0 +1,36 @@
+# 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 os
+
+from .CORDDictUtils import CORDDictUtils
+from .restApi import restApi
+from .testCaseUtils import TestCaseUtils
+
+
+# return the library version
+def _version_():
+ with open(os.path.join(os.path.dirname(__file__), "VERSION")) as f:
+ return f.read().strip()
+
+
+# Inherit all the other sub-classes
+class CORDRobot(CORDDictUtils, restApi, TestCaseUtils):
+
+ ROBOT_LIBRARY_SCOPE = "GLOBAL"
+
+ def cr_version(self):
+ return _version_()
diff --git a/cord-robot/CORDRobot/restApi.py b/cord-robot/CORDRobot/restApi.py
new file mode 100644
index 0000000..afec6a6
--- /dev/null
+++ b/cord-robot/CORDRobot/restApi.py
@@ -0,0 +1,210 @@
+# 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
+
+# These are the default values used with XOS
+restApiDefaults = {
+ 'ATT_SERVICE': '/xosapi/v1/att-workflow-driver/attworkflowdriverservices',
+ 'ATT_SERVICEINSTANCES': '/xosapi/v1/att-workflow-driver/attworkflowdriverserviceinstances',
+ 'ATT_WHITELIST': '/xosapi/v1/att-workflow-driver/attworkflowdriverwhitelistentries',
+ 'BNG_MAP': '/xosapi/v1/fabric-crossconnect/bngportmappings',
+ 'CH_CORE_DEPLOYMENTS': '/xosapi/v1/core/deployments',
+ 'CH_CORE_FLAVORS': '/xosapi/v1/core/flavors',
+ 'CH_CORE_IMAGES': '/xosapi/v1/core/images',
+ 'CH_CORE_INSTANCES': '/xosapi/v1/core/instances',
+ 'CH_CORE_NETWORKS': '/xosapi/v1/core/networks',
+ 'CH_CORE_NETWORK_SLICES': '/xosapi/v1/core/networkslices',
+ 'CH_CORE_NETWORK_TEMPLATES': '/xosapi/v1/core/networktemplates',
+ 'CH_CORE_NODES': '/xosapi/v1/core/nodes',
+ 'CH_CORE_PORTS': '/xosapi/v1/core/ports',
+ 'CH_CORE_SERVICELINK': '/xosapi/v1/core/serviceinstancelinks',
+ 'CH_CORE_SERVICES': '/xosapi/v1/core/services',
+ 'CH_CORE_SERVICES': '/xosapi/v1/core/services',
+ 'CH_CORE_SITEDEPLOYMENTS': '/xosapi/v1/core/sitedeployments',
+ 'CH_CORE_SITES': '/xosapi/v1/core/sites',
+ 'CH_CORE_SLICES': '/xosapi/v1/core/slices',
+ 'CH_CORE_SLICES': '/xosapi/v1/core/slices',
+ 'CH_CORE_USERS': '/xosapi/v1/core/users',
+ 'CORE_DEPLOYMENTS': '/api/core/deployments/',
+ 'CORE_FLAVORS': '/api/core/flavors/',
+ 'CORE_IMAGES': '/api/core/images/',
+ 'CORE_INSTANCES': '/api/core/instances/',
+ 'CORE_NODES': '/api/core/nodes/',
+ 'CORE_SANITY_INSTANCES': '/api/core/instances/?no_hyperlinks=1',
+ 'CORE_SANITY_NODES': '/api/core/nodes/?no_hyperlinks=1',
+ 'CORE_SANITY_SLICES': '/api/core/slices/?no_hyperlinks=1',
+ 'CORE_SERVICES': '/api/core/services/',
+ 'CORE_SITEDEPLOYMENTS': '/api/core/sitedeployments',
+ 'CORE_SITES': '/api/core/sites/',
+ 'CORE_SLICES': '/api/core/slices/',
+ 'CORE_USERS': '/api/core/users/',
+ 'FABRIC_CROSSCONNECT_SERVICEINSTANCES': '/xosapi/v1/fabric-crossconnect/fabriccrossconnectserviceinstances',
+ 'FABRIC_SWITCH': '/xosapi/v1/fabric/switches',
+ 'HWVSG_TENANT': '/xosapi/v1/vsg-hw/vsghwserviceinstances',
+ 'ONU_DEVICE': '/xosapi/v1/volt/onudevices',
+ 'OSS_SERVICE': '/xosapi/v1/hippie-oss/hippieossservices',
+ 'OSS_SERVICEINSTANCE': '/xosapi/v1/hippie-oss/hippieossserviceinstances',
+ 'OSS_VOLT': '/xosapi/v1/core/servicedependencys',
+ 'PON_PORT': '/xosapi/v1/volt/ponports',
+ 'PORT_INTERFACE': '/xosapi/v1/fabric/portinterfaces',
+ 'SERVER_IP': '127.0.0.1',
+ 'SERVER_PORT': '30006',
+ 'SWITCH_PORT': '/xosapi/v1/fabric/switchports',
+ 'TENANT_SUBSCRIBER': '/api/tenant/cord/subscriber/',
+ 'TENANT_VOLT': '/api/tenant/cord/volt/',
+ 'UTILS_LOGIN': '/api/utility/login/',
+ 'UTILS_SYNCHRONIZER': '/api/utility/synchronizer/',
+ 'VOLT_DEVICE': '/xosapi/v1/volt/oltdevices',
+ 'VOLT_SERVICE': '/xosapi/v1/volt/voltservices',
+ 'VOLT_SUBSCRIBER': '/xosapi/v1/rcord/rcordsubscribers',
+ 'VOLT_TENANT': '/xosapi/v1/volt/voltserviceinstances',
+ 'VSG_TENANT': '/xosapi/v1/vsg/vsgserviceinstances',
+ 'XOS_PASSWD': 'letmein',
+ 'XOS_USER': 'admin@opencord.org',
+}
+
+jsonHeader = {"Content-Type": "application/json"}
+
+
+class restApi():
+ """
+ Functions for testing CORD API with POST, GET, PUT, DELETE method
+ """
+
+ def getEnvOrDefault(self, key):
+ """
+ Find a variable in environment, or use Default value
+ """
+ if key in os.environ:
+ value = os.environ[key]
+ elif key in restApiDefaults:
+ value = restApiDefaults[key]
+ else:
+ print("Unable to find '%s' in environment or defaults!" % key)
+ value = None
+
+ return value
+
+ def getURL(self, key):
+ """
+ Get REST API suffix from key and return the full URL
+ """
+ urlSuffix = self.getEnvOrDefault(key)
+ url = "http://" + self.getEnvOrDefault("SERVER_IP") + ":" + self.getEnvOrDefault("SERVER_PORT") + 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=jsonHeader,
+ auth=(self.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD"))
+ )
+ 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=jsonHeader,
+ auth=(self.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD"))
+ )
+ 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.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD")))
+ 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.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD")))
+ 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=jsonHeader,
+ auth=(self.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD"))
+ )
+ 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=jsonHeader,
+ auth=(self.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD"))
+ )
+ 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.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD")))
+ 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.getEnvOrDefault("XOS_USER"), self.getEnvOrDefault("XOS_PASSWD")))
+ passed = self.checkResult(resp, requests.codes.created) or self.checkResult(
+ resp, requests.codes.ok
+ )
+ return passed
diff --git a/cord-robot/CORDRobot/rf-resources/ATTWorkFlowDriver.resource b/cord-robot/CORDRobot/rf-resources/ATTWorkFlowDriver.resource
new file mode 100644
index 0000000..8f932f8
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/ATTWorkFlowDriver.resource
@@ -0,0 +1,107 @@
+# 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 CORDRobot
+
+*** Variable ***
+${ONU_STATE_VAR} admin_onu_state
+
+*** Keywords ***
+Service Instance Status Check
+ [Arguments] ${onu_device}
+ [Documentation] Returns onu_state and authentication_state fields for an ONU device
+ ... from att workflow driver
+ ${json_result}= CORDRobot.ApiGet ATT_SERVICEINSTANCES
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.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 from att workflow driver for a particular ONU device
+ ${json_result}= CORDRobot.ApiGet ATT_SERVICEINSTANCES
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.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}= CORDRobot.listToDict ${elist} ${list_index}
+ ${api_result}= CORDRobot.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 serial number
+ ${json_result}= CORDRobot.ApiGet ATT_WHITELIST
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.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 serial number
+ ${json_result}= CORDRobot.ApiGet ATT_SERVICEINSTANCES
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.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}= CORDRobot.ApiChameleonDelete ATT_WHITELIST ${id}
+ Should Be True ${api_result}
+
+Validate ATT Workflow Driver SI
+ [Documentation] FIXME
+ [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
+ [Documentation] FIXME
+ [Arguments] ${expected_status} ${onu_device}
+ ${dhcp_state}= Service Instance DHCP State Check ${onu_device}
+ Should Be Equal ${dhcp_state} ${expected_status}
diff --git a/cord-robot/CORDRobot/rf-resources/CIAB.resource b/cord-robot/CORDRobot/rf-resources/CIAB.resource
new file mode 100644
index 0000000..e765d2d
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/CIAB.resource
@@ -0,0 +1,76 @@
+# 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 CORD-in-a-Box
+Library SSHLibrary
+Resource utils.resource
+
+*** Keywords ***
+Execute Command on CIAB Server in Specific VM
+ [Documentation] SSHs into ${HOST} where CIAB is running and executes a
+ ... command in the Prod Vagrant VM where all the containers are running
+ [Arguments] ${system} ${vm} ${cmd}
+ ... ${user}=${VM_USER} ${password}=${VM_PASS}
+ ... ${prompt}=$ ${use_key}=True ${strip_line}=True
+ ${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
+ [Documentation] SSHs into ${system} where CIAB is running and executes a
+ ... command in the Prod Vagrant VM where all the containers are running
+ [Arguments] ${system} ${node} ${hostname} ${cmd}
+ ... ${user}=${VM_USER} ${password}=${VM_PASS} ${prompt}=$ ${use_key}=True
+ ${conn_id}= SSHLibrary.Open Connection ${system} prompt=${prompt} timeout=300s
+ # FIXME: Truthy comparison of strings
+ 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}
+
+Get Docker Logs
+ ##In Ciab, all containers are run in the prod vm so we must log into that
+ [Documentation] Retrieves the logs of a docker container running inside
+ ... given ${system}
+ [Arguments] ${system} ${container_id}
+ ... ${user}=${USER} ${password}=${PASSWD} ${prompt}=prod:~$
+ ${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}
diff --git a/cord-robot/CORDRobot/rf-resources/DHCP.resource b/cord-robot/CORDRobot/rf-resources/DHCP.resource
new file mode 100644
index 0000000..feb1cbb
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/DHCP.resource
@@ -0,0 +1,72 @@
+# 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 DHCP server and client functions
+Library OperatingSystem
+Resource utils.resource
+
+*** Keywords ***
+Send Dhclient Request
+ [Documentation] Executes a dhclient against a particular interface on the RG (src)
+ [Arguments] ${iface} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ ${result}= Login And Run Command On Remote System
+ ... dhclient -nw ${iface}
+ ... ${ip} ${user} ${pass} ${container_type} ${container_name}
+ [Return] ${result}
+
+Send Dhclient Request K8S
+ [Documentation] Run dhclient inside rg container in 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
+
+Add Default Route to Dst Gateway
+ [Documentation] Adds an entry to the routing table on the RG (src)
+ # FIXME - Argument order of iface/ip/user/pass should match other functions
+ [Arguments] ${src_gateway} ${dst_subnet} ${iface} ${ip}
+ ... ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
+ ${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
+ [Documentation] Check if the sepcified interface has an IPv4 address assigned
+ # FIXME - should ip_should_exist have a default value?
+ [Arguments] ${ip_should_exist} ${iface} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ ${output}= Login And Run Command On Remote System
+ ... ip address show ${iface}
+ ... ${ip} ${user} ${pass} ${container_type} ${container_name}
+ # FIXME - ipv4_regex not set if container_type != K8S?
+ ${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
+ # FIXME - use a boolean rather than string comparison against truthy value
+ 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}
+
+Start DHCP Server on Remote Host
+ [Documentation] Start the 'dhcpd' process on specified network interface
+ ... on a 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}
diff --git a/cord-robot/CORDRobot/rf-resources/Kubernetes.resource b/cord-robot/CORDRobot/rf-resources/Kubernetes.resource
new file mode 100644
index 0000000..14857dd
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/Kubernetes.resource
@@ -0,0 +1,101 @@
+# 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 CORDRobot
+Resource utils.resource
+
+*** Keywords ***
+Helm Chart is Removed
+ [Documentation] Verify the specified helm chart has been removed
+ [Arguments] ${helm_chart}
+ ${rc}= Run And Return Rc
+ ... helm ls -q | grep ${helm_chart}
+ Should Be Equal As Integers ${rc} 1
+
+Kubernetes PODs in Namespace are Removed
+ [Documentation] Verify all Kubernetes pods in specified namespace have been removed
+ [Arguments] ${namespace}
+ ${rc} ${output}= Run And Return Rc And Output
+ ... kubectl get pods --no-headers -n ${namespace}
+ Should Contain ${output} No resources found
+
+Kubernetes PODs in Namespace are Running
+ [Documentation] Verify the number of Kubernetes pods that are running
+ ... in specified namespace is as expected
+ [Arguments] ${namespace} ${pod_num}
+ ${rc} ${output}= Run And Return Rc And Output
+ ... kubectl get pods -n ${namespace} | grep -i running | grep 1/1 | wc -l
+ Should Be Equal As Integers ${output} ${pod_num}
+
+Reinstall Voltha
+ [Documentation] Remove voltha helm chart and wait
+ Run 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 helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
+ # FIXME - HELM_CHARTS_DIR should a parameter
+ Run cd ${HELM_CHARTS_DIR}; helm dep up voltha
+ # FIXME - KUBERNETES_YAML should a parameter
+ Run 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
+ [Documentation] Get UTC datetime in RFC3339ish format
+ [Arguments] ${ip} ${user} ${pass}
+ ${result}= Login And Run Command On Remote System
+ ... date -u +"%Y-%m-%dT%H:%M:%S.%NZ" ${ip} ${user} ${pass}
+ # FIXME - is this needed? Does date return multiple lines?
+ ${result}= Get Line ${result} 0
+ [Return] ${result}
+
+Log Kubernetes Container Log Since Time
+ [Documentation] Returns the output of kubectl logs of a pod since timestamp
+ [Arguments] ${datetime} ${pod_prefix}
+ # FIXME - rc var isn't checked and then overwritten in this set of commands
+ ${rc} ${namespace}= Run And Return Rc And Output
+ ... kubectl get pods --all-namespaces | grep ' ${pod_prefix}' | head -1 | awk '{print $1}'
+ ${rc} ${pod_name}= Run And Return Rc And Output
+ ... 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
+ ... kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${pod_name} -c onos
+ ... ELSE Run And Return Rc And Output
+ ... kubectl logs --timestamps -n ${namespace} --since-time=${datetime} ${pod_name}
+ Log ${output}
+
+Log Kubernetes Containers Logs Since Time
+ [Documentation] Given a datetime and list of containers, print logs for those containers
+ [Arguments] ${datetime} ${pod_list}
+ FOR ${pod_prefix} IN @{pod_list}
+ Log Kubernetes Container Log Since Time ${datetime} ${pod_prefix}
+ END
+
+Get Kubernetes POD Name By Prefix
+ [Documentation] Return the first POD name that starts with the specified prefix
+ [Arguments] ${prefix}
+ ${rc} ${output}= Run And Return Rc And Outputi
+ ... kubectl get pods --all-namespaces | grep '${prefix}' | head -1 | awk '{print $2}'
+ [Return] ${output}
diff --git a/cord-robot/CORDRobot/rf-resources/Network.resource b/cord-robot/CORDRobot/rf-resources/Network.resource
new file mode 100644
index 0000000..227f084
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/Network.resource
@@ -0,0 +1,71 @@
+# 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 interacting with network config, such as
+... interfaces, VLANs, routes on a host
+Resource utils.resource
+
+*** Keywords ***
+Add Ip Address on Interface on Host
+ [Documentation] Add IP addresss on interface on remote 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}
+
+Delete IP Addresses from Interface on Remote Host
+ [Documentation] Remove specified IP address on an 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
+ [Documentation] Add double S/C-VLAN tagging on an interface on remote 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
+ [Documentation] Deleted interface (link) 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 Route to Remote Host
+ [Documentation] Add route on remote host given subnet and gateway
+ [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}
diff --git a/cord-robot/CORDRobot/rf-resources/OLT.resource b/cord-robot/CORDRobot/rf-resources/OLT.resource
new file mode 100644
index 0000000..bdfc1a1
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/OLT.resource
@@ -0,0 +1,87 @@
+# 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 CORDRobot
+
+*** Keywords ***
+Openolt is Up
+ [Documentation] Verify that openolt process is started and ready to connect to voltha
+ [Arguments] ${ip} ${user} ${pass} ${prompt}=~#
+ Check Remote File Contents True
+ ... /var/log/openolt.log oper_state: up
+ ... ${ip} ${user} ${pass} prompt=${prompt}
+
+OLT Status Check
+ [Documentation] Returns "operational_status" and "admin_status" of a particular
+ ... OLT device from "olt device list"
+ [Arguments] ${olt_device}
+ ${json_result}= CORDRobot.ApiGet VOLT_DEVICE
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.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
+ [Documentation] Check that OLT has the expected 'operational_status' and 'admin_status'
+ [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
+ [Documentation] Obtain and log output of VOLTHA diagnostic commands
+ ${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
+ END
+ Set Suite Variable ${olt_device_id}
+ Set Suite Variable ${logical_device_id}
+ CORDRobot.write_log_of_voltha_cli_comand /tmp
+ ... voltha_devices.log devices
+ ... host=${server_ip}
+ CORDRobot.write_log_of_voltha_cli_comand /tmp
+ ... logical_devices.log logical_device ${logical_device_id}
+ ... voltha_logical_ports.log ports
+ ... voltha_logical_flows.log flow
+ ... host=${server_ip}
+ CORDRobot.write_log_of_voltha_cli_comand /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}
diff --git a/cord-robot/CORDRobot/rf-resources/ONOS.resource b/cord-robot/CORDRobot/rf-resources/ONOS.resource
new file mode 100644
index 0000000..dfe519b
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/ONOS.resource
@@ -0,0 +1,118 @@
+# 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.
+# onos common functions
+
+*** Settings ***
+Documentation Library for ONOS Functions
+Library SSHLibrary
+
+*** Keywords ***
+Execute ONOS CLI Command
+ [Documentation] Establishes an ssh connection to ONOS contoller and executes a command
+ [Arguments] ${host} ${port} ${cmd} ${user}=karaf ${pass}=karaf
+ ${conn_id}= SSHLibrary.Open Connection ${host} port=${port} timeout=300s
+ SSHLibrary.Login ${user} ${pass}
+ @{result_values} SSHLibrary.Execute Command ${cmd} return_rc=True
+ ... return_stderr=True return_stdout=True
+ ${output} Set Variable @{result_values}[0]
+ Log ${output}
+ Should Be Empty @{result_values}[1]
+ Should Be Equal As Integers @{result_values}[2] 0
+ SSHLibrary.Close Connection
+ [Return] ${output}
+
+Validate XConnect in ONOS
+ [Documentation] Check if Fabric Crossconnnect matches exists value
+ [Arguments] ${server_ip} ${stag} ${exists}=True ${port}=30120
+ # FIXME: use Robot-based JSON manipulation, shorten line
+ ${rc}= Run And Return RC
+ ... http -a karaf:karaf GET http://${server_ip}:${port}/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
+
+Get ONOS Status
+ [Documentation] Obtain and log output of ONOS diagnostic commands
+ [Arguments] ${server_ip}=${None} ${server_port}=30115
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_apps.log apps -a -s
+ ... host=${server_ip} port=${server_port}
+ ${onos_apps} Get Binary File /tmp/onos_apps.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_devices.log devices
+ ... host=${server_ip} port=${server_port}
+ ${onos_devices} Get Binary File /tmp/onos_devices.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_ports.log ports
+ ... host=${server_ip} port=${server_port}
+ ${onos_ports} Get Binary File /tmp/onos_ports.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_flows.log flows -s
+ ... host=${server_ip} port=${server_port}
+ ${onos_flows} Get Binary File /tmp/onos_flows.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_meters.log meters
+ ... host=${server_ip} port=${server_port}
+ ${onos_meters} Get Binary File /tmp/onos_meters.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_volt_prog_subscribers.log volt-programmed-subscribers
+ ... host=${server_ip} port=${server_port}
+ ${onos_volt_prog_subscribers} Get Binary File /tmp/onos_volt_prog_subscribers.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_volt_prog_meters.log volt-programmed-meters
+ ... host=${server_ip} port=${server_port}
+ ${onos_volt_prog_meters} Get Binary File /tmp/onos_volt_prog_meters.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_volt_bp_meters.log volt-bpmeter-mappings
+ ... host=${server_ip} port=${server_port}
+ ${onos_volt_bp_meters} Get Binary File /tmp/onos_volt_bp_meters.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_dhcpl2.log dhcpl2relay-allocations
+ ... host=${server_ip} port=${server_port}
+ ${onos_dhcpl2} Get Binary File /tmp/onos_dhcpl2.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_aaa_users.log aaa-users
+ ... host=${server_ip} port=${server_port}
+ ${onos_aaa_users} Get Binary File /tmp/onos_aaa_users.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_netcfg.log netcfg
+ ... host=${server_ip} port=${server_port}
+ ${onos_netcfg} Get Binary File /tmp/onos_netcfg.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_groups.log groups
+ ... host=${server_ip} port=${server_port}
+ ${onos_groups} Get Binary File /tmp/onos_groups.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_hosts.log hosts
+ ... host=${server_ip} port=${server_port}
+ ${onos_hosts} Get Binary File /tmp/onos_hosts.log
+ CORDRobot.write_log_of_onos_cli_command /tmp
+ ... onos_links.log links
+ ... host=${server_ip} port=${server_port}
+ ${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/cord-robot/CORDRobot/rf-resources/ONU.resource
similarity index 67%
rename from src/test/cord-api/Framework/ONU.robot
rename to cord-robot/CORDRobot/rf-resources/ONU.resource
index 6633273..7ec8d98 100644
--- a/src/test/cord-api/Framework/ONU.robot
+++ b/cord-robot/CORDRobot/rf-resources/ONU.resource
@@ -19,47 +19,50 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library utils/utils.py
-Library restApi.py
+Library CORDRobot
*** Keywords ***
ONU Status Check
+ [Documentation] Returns "operational_status" and "admin_status" of
+ ... a particular ONU device from "onu device list"
[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
+ ${json_result}= CORDRobot.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
+ ${getJsonDict}= CORDRobot.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
+ [Arguments] ${device_list} ${list_index}
${dlist} = Get Variable Value ${device_list}
- ${onu_dictionary}= utils.listToDict ${dlist} ${list_index}
- ${api_result}= restApi.ApiPost ONU_DEVICE ${onu_dictionary}
+ ${onu_dictionary}= CORDRobot.listToDict ${dlist} ${list_index}
+ ${api_result}= CORDRobot.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
+ [Arguments] ${serial_number}
+ ${json_result}= CORDRobot.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
+ ${getJsonDict}= CORDRobot.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}
+ ${api_result}= CORDRobot.ApiChameleonDelete ONU_DEVICE ${id}
Should Be True ${api_result}
Validate ONU States
+ [Documentation] Check that ONU has the expected 'operational_status' and 'admin_status'
[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}
diff --git a/cord-robot/CORDRobot/rf-resources/Subscriber.resource b/cord-robot/CORDRobot/rf-resources/Subscriber.resource
new file mode 100644
index 0000000..232d87a
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/Subscriber.resource
@@ -0,0 +1,245 @@
+# 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 a subscriber (RG)
+Resource ATTWorkFlowDriver.resource
+Resource DHCP.resource
+Resource Network.resource
+Resource ONOS.resource
+Resource utils.resource
+Resource XOS.resource
+
+*** Keywords ***
+Subscriber Status Check
+ [Documentation] Returns Status from Subscribers List for a particular ONU device
+ [Arguments] ${onu_device}
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list}
+ ... onu_device ${onu_device}
+ ${status}= Get From Dictionary ${getJsonDict} status
+ [Return] ${status}
+
+Validate Subscriber Status
+ [Documentation] Check that a subscriber has the expected 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}
+
+Create Subscriber
+ [Documentation] Sends a POST to create a subscriber in XOS
+ [Arguments] ${subscriber_list} ${list_index}
+ ${slist} = Get Variable Value ${subscriber_list}
+ ${subscriber_dictionary}= CORDRobot.listToDict ${slist} ${list_index}
+ ${api_result}= CORDRobot.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
+ [Documentation] Returns the subscriber id based on the subscriber's C-Tag
+ [Arguments] ${ctag}
+ ${json_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER
+ Log ${json_result}
+ ${json_result_list}= Get From dictionary ${json_result} items
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list}
+ ... c_tag ${ctag}
+ ${id}= Get From Dictionary ${getJsonDict} id
+ [Return] ${id}
+
+Delete Subscriber
+ [Documentation] Deletes a given subscriber based on its c_tag
+ [Arguments] ${ctag}
+ ${id}= Retrieve Subscriber ${ctag}
+ ${api_result}= CORDRobot.ApiChameleonDelete VOLT_SUBSCRIBER ${id}
+ Should Be True ${api_result}
+
+Send EAPOL Message
+ [Documentation] Executes a particular auth request on the RG via wpa_supplicant
+ ... Requested packet should exist on src.
+ [Arguments] ${iface} ${conf_file} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ 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
+ [Documentation] Executes a particular auth request on the RG and verifies if it succeeds
+ ... auth_pass determines if authentication should pass
+ [Arguments] ${auth_pass} ${iface} ${conf_file} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ Send EAPOL Message ${iface} ${conf_file} ${ip} ${user} ${pass}
+ ... ${container_type} ${container_name}
+ # FIXME: Use an If/Else block, not Three separate checks, bools instead of truthy strings
+ 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
+ [Documentation] Executes mcjoin (a simple multicast client) on the RG.
+ [Arguments] ${iface} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ 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
+ [Documentation] Executes a particular auth request on the RG and verifies
+ ... if it succeeds. auth_pass determines if authentication should pass
+ [Arguments] ${auth_pass} ${iface} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ 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}
+
+Validate DHCP and Ping
+ [Documentation] Check that DHCP address has been acquired and Ping works
+ [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}
+
+Validate Subscriber Service Chain
+ [Documentation] Check if serial number is list of subcribed_links_ids
+ [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
+ END
+
+Validate Fabric CrossConnect SI
+ [Documentation] Build list of s_tags in fabric crossconnect
+ [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}
+ END
+
+Validate Subscriber Count
+ [Documentation] Check if subscriber count matches passed value
+ [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
+ [Documentation] Check if subscriber is in awaiting-auth state
+ [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
+ [Documentation] Check if subscriber has successfully authenticated
+ [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
+ [Documentation] Check if subscriber service chain has been 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
diff --git a/cord-robot/CORDRobot/rf-resources/XOS.resource b/cord-robot/CORDRobot/rf-resources/XOS.resource
new file mode 100644
index 0000000..fd03ea9
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/XOS.resource
@@ -0,0 +1,86 @@
+# 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 interacting with XOS
+Library String
+Library RequestsLibrary
+
+*** Keywords ***
+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 From Dictionary ${resp.json()} 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
+ [Documentation] Find the id of owner of an XOS service
+ [Arguments] ${service}
+ ${resp}= CORD Get ${service}
+ ${jsondata}= To Json ${resp.content}
+ log ${jsondata}
+ ${length}= Get Length ${jsondata['items']}
+ # FIXME: should this break after finding the first item?
+ FOR ${INDEX} IN RANGE 0 ${length}
+ ${value}= Get From List ${jsondata['items']} ${INDEX}
+ ${id}= Get From Dictionary ${value} id
+ END
+ [Return] ${id}
+
+Clean Up Objects
+ [Documentation] Delete all objects in XOS data model
+ [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}
+ END
+ FOR ${i} IN @{ids}
+ CORD Delete ${model_api} ${i}
+ END
diff --git a/cord-robot/CORDRobot/rf-resources/utils.resource b/cord-robot/CORDRobot/rf-resources/utils.resource
new file mode 100644
index 0000000..d85fa20
--- /dev/null
+++ b/cord-robot/CORDRobot/rf-resources/utils.resource
@@ -0,0 +1,222 @@
+# 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 To Remote System
+ [Documentation] SSH into a remote host (and into a container on that host if container_type
+ ... and container_name are specified) and returns connection ID
+ [Arguments] ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ ... ${prompt}=~$ ${prompt_timeout}=15s ${container_prompt}=#
+ ${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
+ # FIXME: This fails if /bin/bash isn't installed in the container, run on command
+ 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
+ # FIXME: Is is useful in the LXC/K8S cases?
+ ${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
+ [Documentation] Exit from the SSH session to a remote host
+ [Arguments] ${conn_id}
+ SSHLibrary.Switch Connection ${conn_id}
+ SSHLibrary.Close Connection
+
+Run Command On Remote System
+ [Documentation] Executes a command on remote host and returns output
+ [Arguments] ${cmd} ${conn_id} ${user} ${pass}=${None}
+ ${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}
+
+Login And Run Command On Remote System
+ [Documentation] SSH into a remote host (and into a container on that host if container_type
+ ... and container_name are specified), switch to root user, executes command, return output
+ [Arguments] ${cmd} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ ... ${prompt}=~$ ${prompt_timeout}=50s ${container_prompt}=#
+ ${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}
+ # FIXME: Look into persisting SSH connection rather than tearing it up/down repeatedly
+ Logout From Remote System ${conn_id}
+ [Return] ${output}
+
+Execute Command Locally
+ [Documentation] Superfluous, use the 'Run' keyword instead which this wraps
+ [Arguments] ${cmd}
+ ${output}= Run ${cmd}
+ [Return] ${output}
+
+Get Docker Container ID
+ [Documentation] Retrieves the id of the requested docker container running locally
+ [Arguments] ${container_name}
+ ${container_id}= Run docker ps | grep ${container_name} | awk '{print $1}'
+ Log ${container_id}
+ [Return] ${container_id}
+
+Remove Value From List
+ [Documentation] Removes a value from a dictionary
+ [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
+ END
+
+Test Ping
+ [Documentation] SSH's into src and attempts to ping dest.
+ ... Status determines if ping should pass | fail
+ [Arguments] ${status} ${src} ${user} ${pass}
+ ... ${dest} ${interface} ${prompt}=$ ${prompt_timeout}=60s
+ ${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}
+
+Check Ping Result
+ [Documentation] Check the output of the 'ping' command
+ [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
+
+Check Ping
+ [Documentation] Run 'ping' on remote system and check output
+ [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
+ [Documentation] Check if the specified IP address is reachable or not
+ [Arguments] ${reachable} ${ip}
+ ${result}= Run ping -c 3 ${ip}
+ Check Ping Result ${reachable} ${result}
+
+Kill Linux Process
+ [Documentation] Kill a process on a remote system
+ [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
+ [Documentation] Check if file on remote system matches a `grep` regex
+ [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}
+ # FIXME: Comparison against truthy value
+ Run Keyword If '${file_should_exist}' == 'True'
+ ... Should Contain ${output} ${pattern}
+ ... ELSE
+ ... Should Not Contain ${output} ${pattern}
+
+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}]}
+ END
+ ${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}]}
+ END
diff --git a/cord-robot/CORDRobot/testCaseUtils.py b/cord-robot/CORDRobot/testCaseUtils.py
new file mode 100755
index 0000000..88f1913
--- /dev/null
+++ b/cord-robot/CORDRobot/testCaseUtils.py
@@ -0,0 +1,244 @@
+#
+# 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
+
+
+class TestCaseUtils():
+
+ @staticmethod
+ 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)
+
+ @staticmethod
+ 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()
+
+ @staticmethod
+ def write_log_of_voltha_cli_comand(
+ 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()
+ TestCaseUtils.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()
+ TestCaseUtils.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()
+ TestCaseUtils.remove_leading_line(log_dir, log_file3)
+ child.close()
+
+ @staticmethod
+ def write_log_of_onos_cli_command(log_dir, log_file, cmd, host="localhost", port=30115):
+ output = open(log_dir + "/" + log_file, "wb")
+ child = pexpect.spawn(
+ "ssh -p %s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no karaf@%s"
+ % (port, 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, self.get_dir("log"), log_file)
+ statusLines = subprocess.getstatusoutput(grepCommand)[1]
+ return statusLines
+
+ @staticmethod
+ def parse_fields(status_line, delimiter):
+ statusList = status_line.split(delimiter)
+ return statusList
+
+ def print_log_file(self, log_file):
+ with open(self.get_dir("log") + "/" + log_file, "r+") as FILE:
+ lines = FILE.readlines()
+ print
+ for line in lines:
+ sys.stdout.write(line)
+
+ @staticmethod
+ 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
+
+ @staticmethod
+ 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
+
+ @staticmethod
+ 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, self.get_dir("voltha"))
+ )
+ status = subprocess.getstatusoutput(sedCommand)[0]
+ return status
+
+ @staticmethod
+ def discover_rg_pod_name():
+ return TestCaseUtils.extract_pod_name("rg0").strip()
+
+ @staticmethod
+ def retrieve_authorized_users_device_id_and_port_number(status_line):
+ fields = TestCaseUtils.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):
+ TestCaseUtils.write_log_of_onos_cli_command(
+ self.get_dir("log"),
+ "voltha_add_subscriber_access.log",
+ "volt-add-subscriber-access %s %s" % (device_id, port_number),
+ )
diff --git a/cord-robot/MANIFEST.in b/cord-robot/MANIFEST.in
new file mode 100644
index 0000000..955e985
--- /dev/null
+++ b/cord-robot/MANIFEST.in
@@ -0,0 +1,3 @@
+include requirements.txt
+include CORDRobot/VERSION
+include CORDRobot/rf-resources/*.resource
diff --git a/cord-robot/README.rst b/cord-robot/README.rst
new file mode 100644
index 0000000..4ea4882
--- /dev/null
+++ b/cord-robot/README.rst
@@ -0,0 +1,26 @@
+cord-robot
+----------
+
+This contains both python libraries and resource (Keyword) files for the CORD
+project.
+
+The resource files are imported using:
+https://github.com/rasjani/robotframework-importresource .
+
+To use, import the library and resource files with:
+
+.. code:: robotframework
+
+ Library CORDRobot
+ Library ImportResource resources=CORDRobot
+
+Development notes
+-----------------
+
+Add python libraries to ``src/CORDRobot``, and include them in the
+``__init__.py``.
+
+Add resource files to the ``src/CORDRobot/rf-resources`` with the extension
+``.resource``
+
+Run ``tox`` to test - see list of test commands run in ``tox.ini``.
diff --git a/cord-robot/requirements.txt b/cord-robot/requirements.txt
new file mode 100644
index 0000000..b068f02
--- /dev/null
+++ b/cord-robot/requirements.txt
@@ -0,0 +1,6 @@
+pexpect
+pyyaml
+requests
+robotframework
+robotframework-requests
+robotframework-sshlibrary
diff --git a/cord-robot/setup.py b/cord-robot/setup.py
new file mode 100644
index 0000000..ce710d9
--- /dev/null
+++ b/cord-robot/setup.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+
+# Copyright 2020-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.
+
+import os
+from setuptools import setup
+from shutil import copyfile
+
+LIBRARY_NAME = "CORDRobot"
+
+
+def version():
+ # Copy VERSION file of parent to module directory if not found
+ version_path = os.path.join(LIBRARY_NAME, "VERSION")
+ if not os.path.exists(version_path):
+ copyfile("../VERSION", version_path)
+ with open(version_path) as f:
+ return f.read().strip()
+
+
+def parse_requirements(filename):
+ # parse a requirements.txt file, allowing for blank lines and comments
+ requirements = []
+ for line in open(filename):
+ if line and not line.startswith("#"):
+ requirements.append(line)
+ return requirements
+
+
+setup(
+ name="cord-robot",
+ version=version(),
+ description="CORD Project Robot Libraries and common Resources",
+ author="CORD Developers",
+ include_package_data=True,
+ packages=[LIBRARY_NAME],
+ package_data={
+ LIBRARY_NAME: ["rf-resources/*.resource", "VERSION"]
+ },
+ install_requires=parse_requirements("requirements.txt"),
+)
diff --git a/cord-robot/test/test.json b/cord-robot/test/test.json
new file mode 100644
index 0000000..09518ed
--- /dev/null
+++ b/cord-robot/test/test.json
@@ -0,0 +1,3 @@
+{
+ "test" : [ "json1", "json2", "json3"]
+}
diff --git a/cord-robot/test/test.robot b/cord-robot/test/test.robot
new file mode 100644
index 0000000..f537584
--- /dev/null
+++ b/cord-robot/test/test.robot
@@ -0,0 +1,39 @@
+*** Settings ***
+Documentation Tests for the CORDRobot library
+Library OperatingSystem
+Library CORDRobot
+Library ImportResource resources=CORDRobot
+
+*** Test Cases ***
+Test list resources
+ [Documentation] Lists all resources loaded
+ ${res}= ImportResource.external_resources
+ Log To Console ${res}
+
+Test loading of CORDRobot Python Functions
+ [Documentation] Check if __init__.py function work
+ ${ver}= CR_Version
+ Log To Console ${ver}
+
+Test loading of testCaseUtils
+ [Documentation] Check if testCaseUtils.py functions work
+ ${fields}= CORDRobot.parse_fields foo,bar ,
+ Log To Console ${fields}
+
+Test loading of CORDDictUtils
+ [Documentation] Check if CORDDictUtils functions work
+ ${json}= CORDRobot.jsonToList ${CURDIR}/test.json test
+ Log To Console ${json}
+
+Test loading of restApi
+ [Documentation] Check if restApi functions work
+ ${url1}= CORDRobot.getURL CORE_NODES
+ Log To Console ${url1}
+ Set Environment Variable CORDROBOT_TEST /cord_robot_test/
+ ${url2}= CORDRobot.getURL CORDROBOT_TEST
+ Log To Console ${url2}
+
+Test Validate Loading of CORDRobot Resources
+ [Documentation] Validates that the .resource files distributed by
+ ... CORDRobot can be invoked
+ Execute Command Locally echo "Able to run Execute Commnd Locally"
diff --git a/cord-robot/tox.ini b/cord-robot/tox.ini
new file mode 100644
index 0000000..9955929
--- /dev/null
+++ b/cord-robot/tox.ini
@@ -0,0 +1,42 @@
+; 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.
+
+[tox]
+envlist = py35,py36,py37
+skip_missing_interpreters = true
+
+[testenv]
+# remove the git+https link and add to requirements.txt when upstream fixes the pypi package
+deps =
+ -r requirements.txt
+ flake8
+ pylint
+ robotframework-lint
+ git+https://github.com/zdw/robotframework-importresource@b81b87aabaee0594e966687b41e3674b866f28ee
+
+# LineToLong should be much lower
+commands =
+ flake8
+ pylint --py3k CORDRobot
+ rflint \
+ --configure TooFewKeywordSteps:1 \
+ --configure LineTooLong:160 -e LineTooLong \
+ CORDRobot/rf-resources test
+ robot test/test.robot
+
+[flake8]
+exclude =
+ .tox
+ build
+max-line-length = 119
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..3b51eb8
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,16 @@
+docutils
+flake8
+paramiko
+pexpect
+pylint
+pyyaml
+robotframework
+robotframework-databaselibrary
+robotframework-kafkalibrary
+robotframework-lint
+robotframework-requests
+robotframework-sshlibrary
+tinydb
+yamllint
+# replace when we can use upstream (needs python 3.6)
+git+https://github.com/zdw/robotframework-importresource@b81b87aabaee0594e966687b41e3674b866f28ee
diff --git a/roles/prereq/defaults/main.yml b/roles/prereq/defaults/main.yml
index b5a8c06..5791bc4 100644
--- a/roles/prereq/defaults/main.yml
+++ b/roles/prereq/defaults/main.yml
@@ -1,4 +1,4 @@
-
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,19 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
#
# variables needed to be defined in user's playbook
#
-#
# user-configurable defaults
#
# default install path
+
docker_tools_path: '/usr/local/bin'
docker_tools_pipework_exe_url: https://raw.githubusercontent.com/jpetazzo/pipework/master/pipework
openvswitch_url: http://openvswitch.org/releases
openvswitch_version: '2.5.0'
-#docker variables
+
+# docker variables
docker:
registry: "{{ docker_registry | default('docker-registry:5000') }}"
image_version: "{{ docker_image_version | default('latest') }}"
diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml
index 32ce311..baf0e8e 100644
--- a/roles/prereq/tasks/main.yml
+++ b/roles/prereq/tasks/main.yml
@@ -1,4 +1,4 @@
-
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,11 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
----
- name: Install Cord tester prerequisites
- become: yes
- apt: name={{ item }} state=latest force=yes
+ become: true
+ apt: name={{ item }} state=latest force=true
with_items:
- wget
- python
@@ -31,7 +29,7 @@
- libffi-dev
- name: Install Python Prerequisites for cord tester
- become: yes
+ become: true
pip: name={{ item }} state=latest
with_items:
- nose
@@ -59,20 +57,20 @@
pip: name=paramiko version=1.10.1 state=present
- name: Download Openvswitch {{ openvswitch_version }}
- become: yes
+ become: true
get_url:
url: "{{ openvswitch_url }}/openvswitch-{{ openvswitch_version }}.tar.gz"
dest: "/home/{{ ansible_user }}/openvswitch-{{ openvswitch_version }}.tar.gz"
- force: yes
+ force: true
-- name: Untar Openvswitch {{ openvswitch_version }}
- become: yes
+- name: Untar Openvswitch {{ openvswitch_version }}
+ become: true
unarchive:
src=openvswitch-{{ openvswitch_version }}.tar.gz
dest=/home/{{ ansible_user }}
- name: Build Openvswitch {{ openvswitch_version }}
- become: yes
+ become: true
shell: "{{ item }}"
args:
chdir: "/home/{{ ansible_user }}/openvswitch-{{ openvswitch_version }}"
@@ -90,15 +88,15 @@
- "openvswitch-{{ openvswitch_version }}"
- name: install Pipework
- sudo: True
+ sudo: true
get_url:
url: "{{ docker_tools_pipework_exe_url }}"
dest: "{{ docker_tools_path }}/pipework"
- force: yes
+ force: true
mode: "a+x"
- name: Pull cord test container
- become: yes
+ become: true
docker:
name: cord-test
image: "{{ docker.registry }}/cordtest/nose:{{ docker.image_version }}"
@@ -106,7 +104,7 @@
state: absent
- name: Pull test radius container
- become: yes
+ become: true
docker:
name: cord-radius
image: "{{ docker.registry }}/cordtest/radius:{{ docker.image_version }}"
@@ -114,7 +112,7 @@
state: absent
- name: Pull test quagga container
- become: yes
+ become: true
docker:
name: cord-quagga
image: "{{ docker.registry }}/cordtest/quagga:{{ docker.image_version }}"
@@ -122,7 +120,7 @@
state: absent
- name: Pull onosproject
- become: yes
+ become: true
docker:
name: cord-test-onos
image: "{{ docker.registry }}/onosproject/onos:{{ docker.image_version }}"
diff --git a/scripts/jflint.sh b/scripts/jflint.sh
new file mode 100755
index 0000000..18c5b40
--- /dev/null
+++ b/scripts/jflint.sh
@@ -0,0 +1,62 @@
+#!/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.
+
+# jflint.sh - lint for Jenkins declarative pipeline jobs
+#
+# curl commands from: https://jenkins.io/doc/book/pipeline/development/#linter
+
+set -e -u -o pipefail
+
+JENKINS_URL=https://jenkins.opencord.org/
+JF_LIST=()
+
+JF_FAIL=0
+
+# if no args, and there's a Jenkinsfile in cwd, check it
+if [ ! -n "$1" ] && [ -f "Jenkinsfile" ] ; then
+ JF_LIST+=("Jenkinsfile")
+else
+# iterate over all args, check if they exist, then add to list of jenkinsfiles to check
+ for arg in "$@"; do
+ if [ -f "$arg" ]; then
+ JF_LIST+=($arg)
+ else
+ echo "File does not exist: ${arg}"
+ exit 1;
+ fi
+ done
+fi
+
+# JENKINS_CRUMB is needed if your Jenkins master has CRSF protection enabled as it should
+JENKINS_CRUMB=$(curl -s "$JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)")
+
+for target in "${JF_LIST[@]-}"; do
+ echo "Checking: '${target}'"
+ CURL_OUT=$(curl -s -H "${JENKINS_CRUMB}" -F "jenkinsfile=<${target}" $JENKINS_URL/pipeline-model-converter/validate)
+
+ # Jenkins doesn't set a HTTP failure code when validation fails, so check output
+ if [[ $CURL_OUT =~ Jenkinsfile\ successfully\ validated ]]
+ then
+ echo "Validated successfully: '${target}'"
+ else
+ echo "Failed to validate: '${target}' - errors:"
+ echo "$CURL_OUT"
+ JF_FAIL=1
+ fi
+
+done
+
+exit $JF_FAIL
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/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.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