[VOL-2282]
Run robot tests with Python 3
- Remove HTTP and database robot libraries that aren't used
- Make robot lint treat warnings as errors
- Reformat robot tests to pass lint, and other minor fixes
- Lint/reformat of python code
- Add yaml and json linting
- Clean up Makefile
- Assume the KUBECONFIG and VOLTCONFIG env vars are defined
Change-Id: Ibf0a6b525802ed907efc38b34c8e3b99b2044bf1
diff --git a/Makefile b/Makefile
index 0026def..cc0ad1c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,36 +14,37 @@
# use bash for pushd/popd, and to fail quickly. virtualenv's activate
# has undefined variables, so no -u
-SHELL = bash -e -o pipefail
-ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+SHELL := bash -e -o pipefail
-# Variables
-LINT_ARGS ?= --verbose --configure LineTooLong:120 --configure TooManyTestSteps:15 \
- --configure TooFewTestSteps:1 --configure TooFewKeywordSteps:1
-VERSION ?= $(shell cat ./VERSION)
-ROBOT_SANITY_SINGLE_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind.yaml
-ROBOT_FAIL_SINGLE_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind.yaml
-ROBOT_SANITY_MULT_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind-2x2.yaml
-ROBOT_SCALE_SINGLE_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind-16.yaml
-ROBOT_SCALE_MULT_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind-8x2.yaml
-ROBOT_DEBUG_LOG_OPT ?=
+ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-ROBOT_SYSTEM_SETUP_MISC_ARGS ?= -i scaledown -l systemup_log.html -r systemup_report.html -o systemup_output.xml
+# Configuration and lists of files for linting/testing
+VERSION ?= $(shell cat ./VERSION)
+LINT_ARGS ?= --verbose --configure LineTooLong:120 -e LineTooLong \
+ --configure TooManyTestSteps:30 -e TooManyTestSteps \
+ --configure TooManyTestCases:12 -e TooManyTestCases \
+ --configure TooFewTestSteps:1 \
+ --configure TooFewKeywordSteps:1 \
+ --configure FileTooLong:600 -e FileTooLong \
+ -e TrailingWhitespace
+
+PYTHON_FILES := $(wildcard libraries/*.py)
+ROBOT_FILES := $(shell find . -name *.robot -print)
+YAML_FILES := $(shell find ./tests -type f \( -name *.yaml -o -name *.yml \) -print)
+JSON_FILES := $(shell find ./tests -name *.json -print)
+
+# Robot config
+ROBOT_SANITY_SINGLE_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind.yaml
+ROBOT_FAIL_SINGLE_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind.yaml
+ROBOT_SANITY_MULT_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind-2x2.yaml
+ROBOT_SCALE_SINGLE_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind-16.yaml
+ROBOT_SCALE_MULT_PON_FILE ?= $(ROOT_DIR)/tests/data/bbsim-kind-8x2.yaml
+ROBOT_DEBUG_LOG_OPT ?=
+ROBOT_MISC_ARGS ?=
+
+ROBOT_SYSTEM_SETUP_MISC_ARGS ?= -i scaledown -l systemup_log.html -r systemup_report.html -o systemup_output.xml
ROBOT_SYSTEM_TEARDOWN_MISC_ARGS ?= -i scaleup -l systemdown_log.html -r systemdown_report.html -o sysstemdown_output.xml
-ROBOT_SYSTEM_FILE ?= K8S_SystemTest.robot
-
-.PHONY: gendocs
-
-## 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))
-
-ROBOT_MISC_ARGS ?=
+ROBOT_SYSTEM_FILE ?= K8S_SystemTest.robot
# for backwards compatibility
sanity-kind: sanity-single-kind
@@ -90,44 +91,71 @@
voltha-test: ROBOT_MISC_ARGS += -e notready
k8s-system-test: ROBOT_MISC_ARGS += -e notready
-# virtualenv for the robot tools
-vst_venv:
- virtualenv $@ ;\
- source ./$@/bin/activate ;\
- pip install -r requirements.txt
-
-test: lint
-
-lint: vst_venv
- source ./vst_venv/bin/activate ;\
- set -u ;\
- find . -name *.robot -exec rflint $(LINT_ARGS) {} +
-
-# tidy will be more useful once this issue with removing leading comments is
-# resolved: https://github.com/robotframework/robotframework/issues/3263
-tidy:
- source ./vst_venv/bin/activate ;\
- set -u ;\
- find . -name *.robot -exec python -m robot.tidy --inplace {} \;
-
-voltha-test: vst_venv
- source ./vst_venv/bin/activate ;\
- set -u ;\
- cd tests/functional ;\
- robot -V $(ROBOT_CONFIG_FILE) $(ROBOT_MISC_ARGS) $(ROBOT_FILE)
-
#bbsim-only
k8s-system-test: vst_venv
- source ./vst_venv/bin/activate ;\
- set -u ;\
+ source ./$</bin/activate ; set -u ;\
cd tests/functional ;\
robot $(ROBOT_SYSTEM_SETUP_MISC_ARGS) $(ROBOT_MISC_ARGS) $(ROBOT_SYSTEM_FILE) && \
robot -V $(ROBOT_CONFIG_FILE) $(ROBOT_MISC_ARGS) $(ROBOT_FILE) && \
robot $(ROBOT_SYSTEM_TEARDOWN_MISC_ARGS) $(ROBOT_MISC_ARGS) $(ROBOT_SYSTEM_FILE)
+voltha-test: vst_venv
+ source ./$</bin/activate ; set -u ;\
+ cd tests/functional ;\
+ robot -V $(ROBOT_CONFIG_FILE) $(ROBOT_MISC_ARGS) $(ROBOT_FILE)
+
+# self-test, lint, and setup targets
+
+# virtualenv for the robot tools
+vst_venv:
+ virtualenv -p python3 $@ ;\
+ source ./$@/bin/activate ;\
+ pip install -r requirements.txt
+
+test: lint
+
+lint: lint-robot lint-python lint-yaml lint-json
+
+lint-robot: vst_venv
+ source ./$</bin/activate ; set -u ;\
+ rflint $(LINT_ARGS) $(ROBOT_FILES)
+
+# check deps for format and python3 cleanliness
+lint-python: vst_venv
+ source ./$</bin/activate ; set -u ;\
+ pylint --py3k $(PYTHON_FILES) ;\
+ flake8 --max-line-length=99 --count $(PYTHON_FILES)
+
+lint-yaml: vst_venv
+ source ./$</bin/activate ; set -u ;\
+ yamllint -s $(YAML_FILES)
+
+lint-json: vst_venv
+ source ./$</bin/activate ; set -u ;\
+ for jsonfile in $(JSON_FILES); do \
+ echo "Validating json file: $$jsonfile" ;\
+ python -m json.tool $$jsonfile > /dev/null ;\
+ done
+
+# tidy target will be more useful once issue with removing leading comments
+# is resolved: https://github.com/robotframework/robotframework/issues/3263
+tidy-robot: vst_venv
+ 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: vst_venv
- source ./vst_venv/bin/activate ;\
- set -u ;\
+ source ./$</bin/activate ; set -u ;\
mkdir -p $@ ;\
for dir in ${LIB_DIRS}; do mkdir -p $@/$$dir; done;\
for dir in ${LIB_BASENAME}; do\
@@ -138,7 +166,6 @@
python -m robot.testdoc $$dir.robot $@/$$dir.html ;\
done
-# explore use of --docformat REST - integration w/Sphinx?
clean:
find . -name output.xml -print
diff --git a/libraries/DependencyLibrary.py b/libraries/DependencyLibrary.py
index 9d402af..15c1dbc 100644
--- a/libraries/DependencyLibrary.py
+++ b/libraries/DependencyLibrary.py
@@ -11,9 +11,12 @@
# 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
+
from robot.libraries.BuiltIn import BuiltIn
+
class DependencyLibrary(object):
ROBOT_LISTENER_API_VERSION = 2
ROBOT_LIBRARY_SCOPE = "GLOBAL"
@@ -24,10 +27,10 @@
def require_test_case(self, name):
key = name.lower()
- if (key not in self.test_status):
+ if key not in self.test_status:
BuiltIn().fail("required test case can't be found: '%s'" % name)
- if (self.test_status[key] != "PASS"):
+ if self.test_status[key] != "PASS":
BuiltIn().fail("required test case failed: '%s'" % name)
return True
diff --git a/libraries/k8s.robot b/libraries/k8s.robot
index 53cd8b3..246a6a5 100644
--- a/libraries/k8s.robot
+++ b/libraries/k8s.robot
@@ -11,13 +11,11 @@
# 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.
-
# voltctl common functions
*** Settings ***
Documentation Library for various utilities
Library SSHLibrary
-Library HttpLibrary.HTTP
Library String
Library DateTime
Library Process
@@ -49,20 +47,23 @@
... kubectl get pods -n ${namespace} | grep ${name} | awk 'NR==1{print $1}'
Log ${restart_pod_name}
Should Not Be Empty ${restart_pod_name} Unable to parse pod name
- ${rc} ${output}= Run and Return Rc and Output kubectl delete pod ${restart_pod_name} -n ${namespace} --grace-period=0 --force
+ ${rc} ${output}= Run and Return Rc and Output
+ ... kubectl delete pod ${restart_pod_name} -n ${namespace} --grace-period=0 --force
Log ${output}
Validate Pod Status
[Arguments] ${pod_name} ${namespace} ${expectedStatus}
[Documentation] To run the kubectl command and check the status of the given pod matches the expected status
- ${length}= Run ${KUBECTL_CONFIG}; kubectl get pod -n ${namespace} | wc -l
+ ${length}= Run kubectl get pod -n ${namespace} | wc -l
FOR ${index} IN RANGE ${length}-1
- ${currentPodName}= Run ${KUBECTL_CONFIG}; kubectl get pod -n ${namespace} -o jsonpath={.items[${index}].status.containerStatuses[0].name}
+ ${currentPodName}= Run
+ ... kubectl get pod -n ${namespace} -o=jsonpath="{.items[${index}].status.containerStatuses[0].name}"
Log Required Pod : ${pod_name}
Log Current Pod: ${currentPodName}
Run Keyword and Ignore Error Run Keyword If '${currentPodName}'=='${pod_name}' Exit For Loop
END
- ${currentStatusofPod}= Run ${KUBECTL_CONFIG}; kubectl get pod -n ${namespace} -o jsonpath={.items[${index}].status.phase}
+ ${currentStatusofPod}= Run
+ ... kubectl get pod -n ${namespace} -o=jsonpath="{.items[${index}].status.phase}"
Log ${currentStatusofPod}
Should Contain ${currentStatusofPod} ${expectedStatus}
@@ -73,28 +74,42 @@
&{containerDict} Get Container Dictionary
FOR ${podName} IN @{PODLIST1}
${containerName} Get From Dictionary ${containerDict} ${podName}
- ${rc} ${logOutput} Run And Return Rc And Output ${KUBECTL_CONFIG};kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
- Run Keyword And Ignore Error Run Keyword If '${logOutput}'=='${EMPTY}' Run Keywords Log No Log found in pod ${podName}
+ ${rc} ${logOutput} Run And Return Rc And Output
+ ... kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${logOutput}'=='${EMPTY}'
+ ... Run Keywords Log No Log found in pod ${podName}
... AND Continue For Loop
${errorDict} Check For Error Logs in Pod Type1 Given the Log Output ${logOutput}
${returnStatusFlagList} Get Dictionary Keys ${errorDict}
${returnStatusFlag} Get From List ${returnStatusFlagList} 0
- Run Keyword And Ignore Error Run Keyword If '${returnStatusFlag}'=='Nologfound' Run Keywords Log No Error Log found in pod ${podName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${returnStatusFlag}'=='Nologfound'
+ ... Run Keywords Log No Error Log found in pod ${podName}
... AND Continue For Loop
- Run Keyword And Ignore Error Run Keyword If '${returnStatusFlag}'=='UnexpectedErrorfound' Run Keywords Log Unexpected Error Log found in pod ${podName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${returnStatusFlag}'=='UnexpectedErrorfound'
+ ... Run Keywords Log Unexpected Error Log found in pod ${podName}
... AND Set to Dictionary ${errorPodDict} ${podName} ${errorDict}
END
FOR ${podName} IN @{PODLIST2}
${containerName} Get From Dictionary ${containerDict} ${podName}
- ${rc} ${logOutput} Run And Return Rc And Output ${KUBECTL_CONFIG};kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
- Run Keyword And Ignore Error Run Keyword If '${logOutput}'=='${EMPTY}' Run Keywords Log No Log found in pod ${podName}
+ ${rc} ${logOutput} Run And Return Rc And Output
+ ... kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${logOutput}'=='${EMPTY}'
+ ... Run Keywords Log No Log found in pod ${podName}
... AND Continue For Loop
${errorDict} Check For Error Logs in Pod Type2 Given the Log Output ${logOutput}
${returnStatusFlagList} Get Dictionary Keys ${errorDict}
${returnStatusFlag} Get From List ${returnStatusFlagList} 0
- Run Keyword And Ignore Error Run Keyword If '${returnStatusFlag}'=='Nologfound' Run Keywords Log No Error Log found in pod ${podName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${returnStatusFlag}'=='Nologfound'
+ ... Run Keywords Log No Error Log found in pod ${podName}
... AND Continue For Loop
- Run Keyword And Ignore Error Run Keyword If '${returnStatusFlag}'=='UnexpectedErrorfound' Run Keywords Log Unexpected Error Log found in pod ${podName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${returnStatusFlag}'=='UnexpectedErrorfound'
+ ... Run Keywords Log Unexpected Error Log found in pod ${podName}
... AND Set to Dictionary ${errorPodDict} ${podName} ${errorDict}
END
Print to Console Error Statement logged in the following pods : ${errorPodDict}
@@ -106,10 +121,13 @@
Log ${logOutput}
${linesContainingLog} = Get Lines Matching Regexp ${logOutput} .*\s\${logLevel}.* partial_match=true
${is_exec_status} ${output} Run Keyword And Ignore Error Should Be Empty ${linesContainingLog}
- ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS' Nologfound '${is_exec_status}'=='FAIL' Errorlogfound
- ${linesContainingError} = Get Lines Matching Regexp ${logOutput} .*\s\${logLevel}.*${errorMessage} partial_match=true
+ ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS'
+ ... Nologfound '${is_exec_status}'=='FAIL' Errorlogfound
+ ${linesContainingError} = Get Lines Matching Regexp
+ ... ${logOutput} .*\s\${logLevel}.*${errorMessage} partial_match=true
${is_exec_status} ${output} Run Keyword And Ignore Error Should Be Empty ${linesContainingError}
- ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS' UnexpectedErrorfound '${is_exec_status}'=='FAIL' MatchingErrorlogfound
+ ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS'
+ ... UnexpectedErrorfound '${is_exec_status}'=='FAIL' MatchingErrorlogfound
Log {linesContainingError}
&{errorDict} Create Dictionary ${returnStatusFlag} ${linesContainingLog}
[Return] ${errorDict}
@@ -118,12 +136,16 @@
[Arguments] ${logOutput} ${logLevel}=warn ${errorMessage}=${EMPTY}
[Documentation] Checks for error message in the particular set of pods
Log ${logOutput}
- ${linesContainingLog} = Get Lines Matching Regexp ${logOutput} .*?\s.*level.*${logLevel}.* partial_match=true
+ ${linesContainingLog} = Get Lines Matching Regexp
+ ... ${logOutput} .*?\s.*level.*${logLevel}.* partial_match=true
${is_exec_status} ${output} Run Keyword And Ignore Error Should Be Empty ${linesContainingLog}
- ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS' Nologfound '${is_exec_status}'=='FAIL' Errorlogfound
- ${linesContainingError} = Get Lines Matching Regexp ${logOutput} .*?\s.*level.*${logLevel}.*msg.*${errorMessage} partial_match=true
+ ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS'
+ ... Nologfound '${is_exec_status}'=='FAIL' Errorlogfound
+ ${linesContainingError} = Get Lines Matching Regexp
+ ... ${logOutput} .*?\s.*level.*${logLevel}.*msg.*${errorMessage} partial_match=true
${is_exec_status} ${output} Run Keyword And Ignore Error Should Be Empty ${linesContainingError}
- ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS' UnexpectedErrorfound '${is_exec_status}'=='FAIL' MatchingErrorlogfound
+ ${returnStatusFlag} Set Variable If '${is_exec_status}'=='PASS'
+ ... UnexpectedErrorfound '${is_exec_status}'=='FAIL' MatchingErrorlogfound
Log {linesContainingError}
&{errorDict} Create Dictionary ${returnStatusFlag} ${linesContainingLog}
[Return] ${errorDict}
@@ -132,13 +154,13 @@
[Documentation] Creates a mapping for pod name and container name and returns the same
&{containerDict} Create Dictionary
${containerName} Set Variable ${EMPTY}
- ${podName} Run ${KUBECTL_CONFIG};kubectl get deployment -n voltha | awk 'NR>1 {print $1}'
+ ${podName} Run kubectl get deployment -n voltha | awk 'NR>1 {print $1}'
@{podNameList}= Split To Lines ${podName}
Append To List ${podNameList} voltha-etcd-cluster voltha-kafka voltha-ro-core voltha-zookeeper
Log ${podNameList}
#Creatiing dictionary to correspond pod name and container name
FOR ${pod} IN @{podNameList}
- ${containerName} Run ${KUBECTL_CONFIG};kubectl get pod -n voltha | grep ${pod} | awk '{print $1}'
+ ${containerName} Run kubectl get pod -n voltha | grep ${pod} | awk '{print $1}'
&{containerDict} Set To Dictionary ${containerDict} ${pod} ${containerName}
END
Log ${containerDict}
@@ -146,25 +168,41 @@
Validate Error For Given Pods
[Arguments] ${datetime} ${podDict}
- [Documentation] This keyword is used to get the list of pods if there is any unexpected error in a particular pod(s) given the time-${datetime} from which the log needs to be analysed and the dictionary of pods and the error in the dictionary format ${podDict] .
+ [Documentation]
+ ... This keyword is used to get the list of pods if there is any unexpected error
+ ... in a particular pod(s) given the time-${datetime} from which the log needs to
+ ... be analysed and the dictionary of pods and the error in the dictionary format
+ ... ${podDict] .
...
- ... Usage : ${returnStatusFlag} Validate Error For Given Pods ${datetime} ${podDict}
- ... where,
+ ... Usage: ${returnStatusFlag} Validate Error For Given Pods ${datetime} ${podDict}
+ ...
+ ... Arguments:
+ ...
... ${datetime} = time from which the log needs to be taken
- ... ${podDict} = Key-value pair of the pod name and the error msg expected like ${podDict} = Set Dictionary ${podDict} radius sample error message.
+ ... ${podDict} = Key-value pair of the pod name and the error msg
...
- ... In case the radius pod log has any other error than the expected error, then the podname will be returned
+ ... Example: ${podDict} = Set Dictionary ${podDict} radius sample error message.
+ ...
+ ... In case the radius pod log has any other error than the expected
+ ... error, then the podname will be returned
${podList} = Get Dictionary Keys ${podDict}
FOR ${podName} IN @{podList}
${containerName} Get From Dictionary ${containerDict} ${podName}
${expectedError} Get From Dictionary ${podDict} ${podName}
- ${rc} ${logOutput} Run And Return Rc And Output ${KUBECTL_CONFIG};kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
- Run Keyword And Ignore Error Run Keyword If '${logOutput}'=='${EMPTY}' Run Keywords Log No Log found in pod ${podName}
+ ${rc} ${logOutput} Run And Return Rc And Output
+ ... kubectl logs --timestamps -n voltha --since-time=${datetime} ${containerName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${logOutput}'=='${EMPTY}'
+ ... Run Keywords Log No Log found in pod ${podName}
... AND Continue For Loop
${returnStatusFlag} Check For Error Logs in Pod Type1 Given the Log Output ${logOutput}
- Run Keyword And Ignore Error Run Keyword If '${returnStatusFlag}'=='Nologfound' Run Keywords Log No Error Log found in pod ${podName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${returnStatusFlag}'=='Nologfound'
+ ... Run Keywords Log No Error Log found in pod ${podName}
... AND Continue For Loop
- Run Keyword And Ignore Error Run Keyword If '${returnStatusFlag}'=='UnexpectedErrorfound' Run Keywords Log Unexpected Error Log found in pod ${podName}
+ Run Keyword And Ignore Error
+ ... Run Keyword If '${returnStatusFlag}'=='UnexpectedErrorfound'
+ ... Run Keywords Log Unexpected Error Log found in pod ${podName}
... AND Append To List ${errorPodList} ${podName}
END
[Return] ${errorPodList}
@@ -178,7 +216,7 @@
Delete K8s Pods By Label
[Arguments] ${namespace} ${key} ${value}
- [Documentation] Uses kubectl to delete a PODs, filtering by label
+ [Documentation] Uses kubectl to delete a PODs, filtering by label
${rc}= Run and Return Rc
... kubectl -n ${namespace} delete pods -l${key}=${value}
Should Be Equal as Integers ${rc} 0
@@ -193,7 +231,8 @@
Pod Exists
[Arguments] ${namespace} ${name}
[Documentation] Succeeds it the named POD exists
- ${rc} ${count} Run and Return Rc kubectl get -n ${namespace} pod -o json | jq -r ".items[].metadata.name" | grep ${name}
+ ${rc} ${count} Run and Return Rc
+ ... kubectl get -n ${namespace} pod -o json | jq -r ".items[].metadata.name" | grep ${name}
Should Be True ${count}>0
Pod Does Not Exist
@@ -204,7 +243,7 @@
Should Be Equal As Integers ${count} 0
Should Be True ${count}==0
-Pods Does Not Exist By Label
+Pods Do Not Exist By Label
[Arguments] ${namespace} ${key} ${value}
[Documentation] Succeeds if the named POD does not exist
${rc} ${count} Run and Return Rc And Output
@@ -215,7 +254,8 @@
Get Available Deployment Replicas
[Arguments] ${namespace} ${name}
[Documentation] Succeeds if the named POD exists and has a ready count > 0
- ${rc} ${count} Run and Return Rc and Output ${KUBECTL_CONFIG};kubectl get -n ${namespace} deploy/${name} -o jsonpath='{.status.availableReplicas}'
+ ${rc} ${count} Run and Return Rc and Output
+ ... kubectl get -n ${namespace} deploy/${name} -o jsonpath='{.status.availableReplicas}'
${result}= Run Keyword If '${count}' == '' Set Variable 0
... ELSE Set Variable ${count}
[Return] ${result}
@@ -234,7 +274,7 @@
Should Be Equal as Integers ${rc} 0
${replicas}= Run Keyword If '${value}' == '' Set Variable 0
... ELSE Set Variable ${value}
- [Return] ${replicas}
+ [Return] ${replicas}
Does Deployment Have Replicas
[Arguments] ${namespace} ${name} ${expected_count}
@@ -246,12 +286,12 @@
... ELSE Set Variable ${value}
Should be Equal as Integers ${replicas} ${expected_count}
-Pods Does Not Ready By Label
+Pods Are Ready By Label
[Arguments] ${namespace} ${key} ${value}
- [Documentation] Check PODs Ready Status
- ${rc} ${count} Run and Return Rc and Output
- ... kubectl -n ${namespace} get pods -l ${key}=${value} -o json | jq -r ".items[].status.containerStatuses[].ready" | grep -c false
- Should Be Equal as Integers ${rc} 0
+ [Documentation] Check that all pods with a label are ready
+ ${output}= Run
+ ... kubectl -n ${namespace} get pods -l ${key}=${value} -o=jsonpath="{.items[].status.containerStatuses[].ready}"
+ Should Not Contain ${output} "false"
Check Expected Running Pods Number By Label
[Arguments] ${namespace} ${key} ${value} ${number}
diff --git a/libraries/onos.robot b/libraries/onos.robot
index 5c3dd0a..9ebcbc2 100644
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -11,13 +11,11 @@
# 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 various utilities
Library SSHLibrary
-Library HttpLibrary.HTTP
Library String
Library DateTime
Library Process
@@ -37,7 +35,7 @@
[Return] ${output}
Validate OLT Device in ONOS
-# FIXME use volt-olts to check that the OLT is ONOS
+ # FIXME use volt-olts to check that the OLT is ONOS
[Arguments] ${serial_number}
[Documentation] Checks if olt has been connected to ONOS
${resp}= Get Request ONOS onos/v1/devices
@@ -141,9 +139,13 @@
Remove All Devices From ONOS
[Arguments] ${url}
[Documentation] Executes the device-remove command on each device in ONOS
- ${rc} @{dpids} Run And Return Rc And Output curl --fail -sSL ${url}/onos/v1/devices | jq -r '.devices[].id'
+ ${rc} @{dpids} Run And Return Rc And Output
+ ... curl --fail -sSL ${url}/onos/v1/devices | jq -r '.devices[].id'
Should Be Equal As Integers ${rc} 0
${count}= Get length ${dpids}
- :FOR ${dpid} IN @{dpids}
- \ ${rc}= Run Keyword If '${dpid}' != '' Run And Return Rc curl -XDELETE --fail -sSL ${url}/onos/v1/devices/${dpid}
- \ Run Keyword If '${dpid}' != '' Should Be Equal As Integers ${rc} 0
+ FOR ${dpid} IN @{dpids}
+ ${rc}= Run Keyword If '${dpid}' != ''
+ ... Run And Return Rc curl -XDELETE --fail -sSL ${url}/onos/v1/devices/${dpid}
+ Run Keyword If '${dpid}' != ''
+ ... Should Be Equal As Integers ${rc} 0
+ END
diff --git a/libraries/utils.robot b/libraries/utils.robot
index c235383..a4ad0f4 100644
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -11,13 +11,11 @@
# 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.
-
# robot test functions
*** Settings ***
Documentation Library for various utilities
Library SSHLibrary
-Library HttpLibrary.HTTP
Library String
Library DateTime
Library Process
@@ -29,26 +27,26 @@
Check CLI Tools Configured
[Documentation] Tests that use 'voltctl' and 'kubectl' should execute this keyword in suite setup
# check voltctl and kubectl configured
- ${voltctl_rc}= Run And Return RC ${VOLTCTL_CONFIG}; voltctl device list
- ${kubectl_rc}= Run And Return RC ${KUBECTL_CONFIG}; kubectl get pods
+ ${voltctl_rc}= Run And Return RC voltctl device list
+ ${kubectl_rc}= Run And Return RC kubectl get pods
Run Keyword If ${voltctl_rc} != 0 or ${kubectl_rc} != 0 FATAL ERROR
... VOLTCTL and KUBECTL not configured. Please configure before executing tests.
Send File To Onos
- [Documentation] Send the content of the file to Onos to selected section of configuration using Post Request
- [Arguments] ${CONFIG_FILE} ${section}
- ${Headers}= Create Dictionary Content-Type application/json
- ${File_Data}= Get Binary File ${CONFIG_FILE}
- Log ${Headers}
- Log ${File_Data}
- ${resp}= Post Request ONOS /onos/v1/network/configuration/${section} headers=${Headers} data=${File_Data}
- Should Be Equal As Strings ${resp.status_code} 200
+ [Documentation] Send the content of the file to Onos to selected section of configuration
+ ... using Post Request
+ [Arguments] ${CONFIG_FILE} ${section}
+ ${Headers}= Create Dictionary Content-Type application/json
+ ${File_Data}= OperatingSystem.Get File ${CONFIG_FILE}
+ Log ${Headers}
+ Log ${File_Data}
+ ${resp}= Post Request ONOS
+ ... /onos/v1/network/configuration/${section} headers=${Headers} data=${File_Data}
+ Should Be Equal As Strings ${resp.status_code} 200
Common Test Suite Setup
[Documentation] Setup the test suite
# BBSim sanity test doesn't need these imports from other repositories
- Run Keyword If ${external_libs} Import Library
- ... ${CURDIR}/../../voltha/tests/atests/common/testCaseUtils.py
Run Keyword If ${external_libs} Import Resource
... ${CURDIR}/../../cord-tester/src/test/cord-api/Framework/Subscriber.robot
Run Keyword If ${external_libs} Import Resource
@@ -59,7 +57,6 @@
... ${CURDIR}/../../cord-tester/src/test/cord-api/Framework/Kubernetes.robot
Set Global Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG}
Set Global Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG}
- Set Global Variable ${export_kubeconfig} export KUBECONFIG=%{KUBECONFIG}
${k8s_node_ip}= Evaluate ${nodes}[0].get("ip")
${k8s_node_user}= Evaluate ${nodes}[0].get("user")
${k8s_node_pass}= Evaluate ${nodes}[0].get("pass")
@@ -75,7 +72,7 @@
${num_onus}= Convert to String ${num_onus}
#send sadis file to onos
${sadis_file}= Get Variable Value ${sadis.file}
- Log To Console \nSadis File:${sadis_file}
+ Log To Console \nSadis File:${sadis_file}
Run Keyword Unless '${sadis_file}' is '${None}' Send File To Onos ${sadis_file} apps/
Set Suite Variable ${num_onus}
Set Suite Variable ${olt_serial_number}
@@ -92,45 +89,56 @@
Set Suite Variable ${datetime}
WPA Reassociate
- [Arguments] ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
[Documentation] Executes a particular wpa_cli reassociate, which performs force reassociation
+ [Arguments] ${iface} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
#Below for loops are used instead of sleep time, to execute reassociate command and check status
- : FOR ${i} IN RANGE 70
- \ ${output}= Login And Run Command On Remote System wpa_cli -i ${iface} reassociate ${ip} ${user}
- ... ${pass} ${container_type} ${container_name}
- \ ${passed}= Run Keyword And Return Status Should Contain ${output} OK
- \ Run Keyword If ${passed} Exit For Loop
- : FOR ${i} IN RANGE 70
- \ ${output}= Login And Run Command On Remote System wpa_cli status | grep SUCCESS ${ip} ${user}
- ... ${pass} ${container_type} ${container_name}
- \ ${passed}= Run Keyword And Return Status Should Contain ${output} SUCCESS
- \ Run Keyword If ${passed} Exit For Loop
-
+ FOR ${i} IN RANGE 70
+ ${output}= Login And Run Command On Remote System
+ ... wpa_cli -i ${iface} reassociate ${ip} ${user}
+ ... ${pass} ${container_type} ${container_name}
+ ${passed}= Run Keyword And Return Status Should Contain ${output} OK
+ Run Keyword If ${passed} Exit For Loop
+ END
+ FOR ${i} IN RANGE 70
+ ${output}= Login And Run Command On Remote System
+ ... wpa_cli status | grep SUCCESS ${ip} ${user}
+ ... ${pass} ${container_type} ${container_name}
+ ${passed}= Run Keyword And Return Status Should Contain ${output} SUCCESS
+ Run Keyword If ${passed} Exit For Loop
+ END
+
Validate Authentication After Reassociate
- [Arguments] ${auth_pass} ${iface} ${ip} ${user} ${pass}=${None} ${container_type}=${None} ${container_name}=${None}
- [Documentation] Executes a particular reassociate request on the RG using wpa_cli. auth_pass determines if authentication should pass
+ [Arguments] ${auth_pass} ${iface} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
+ [Documentation]
+ ... Executes a particular reassociate request on the RG using wpa_cli.
+ ... auth_pass determines if authentication should pass
WPA Reassociate ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name}
- Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds ${timeout} 2s Check Remote File Contents
- ... True /tmp/wpa.log authentication completed successfully ${ip} ${user} ${pass}
- ... ${container_type} ${container_name}
+ Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds ${timeout} 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 Keyword If '${auth_pass}' == 'False' Check Remote File Contents False /tmp/wpa.log
+ ... authentication completed successfully ${ip} ${user} ${pass}
+ ... ${container_type} ${container_name}
Send Dhclient Request To Release Assigned IP
- [Arguments] ${iface} ${ip} ${user} ${path_dhcpleasefile} ${pass}=${None} ${container_type}=${None}
- ... ${container_name}=${None}
+ [Arguments] ${iface} ${ip} ${user} ${path_dhcpleasefile} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None}
[Documentation] Executes a dhclient with option to release ip against a particular interface on the RG (src)
- ${result}= Login And Run Command On Remote System dhclient -nw -r ${iface} && rm ${path_dhcpleasefile}/dhclient.* ${ip} ${user}
+ ${result}= Login And Run Command On Remote System
+ ... dhclient -nw -r ${iface} && rm ${path_dhcpleasefile}/dhclient.* ${ip} ${user}
... ${pass} ${container_type} ${container_name}
Log ${result}
#Should Contain ${result} DHCPRELEASE
[Return] ${result}
Check Remote File Contents For WPA Logs
- [Arguments] ${file_should_exist} ${file} ${pattern} ${ip} ${user} ${pass}=${None} ${container_type}=${None}
- ... ${container_name}=${None} ${prompt}=~$
+ [Arguments] ${file_should_exist} ${file} ${pattern} ${ip} ${user} ${pass}=${None}
+ ... ${container_type}=${None} ${container_name}=${None} ${prompt}=~$
[Documentation] Checks for particular pattern count in a file
- ${result}= Login And Run Command On Remote System cat ${file} | grep '${pattern}' | wc -l ${ip} ${user} ${pass}
+ ${result}= Login And Run Command On Remote System
+ ... cat ${file} | grep '${pattern}' | wc -l ${ip} ${user} ${pass}
... ${container_type} ${container_name} ${prompt}
[Return] ${result}
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 8e624c7..dcd2b12 100644
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -11,13 +11,11 @@
# 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.
-
# voltctl common functions
*** Settings ***
Documentation Library for various utilities
Library SSHLibrary
-Library HttpLibrary.HTTP
Library String
Library DateTime
Library Process
@@ -27,8 +25,8 @@
*** Keywords ***
Test Empty Device List
- [Documentation] Verify that there are no devices in the system
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
+ [Documentation] Verify that there are no devices in the system
+ ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
Log ${jsondata}
@@ -47,13 +45,15 @@
Enable Device
[Arguments] ${device_id}
[Documentation] Enables a device in VOLTHA
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device enable ${device_id}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device enable ${device_id}
Should Be Equal As Integers ${rc} 0
Disable Device
[Arguments] ${device_id}
[Documentation] Enables a device in VOLTHA
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${device_id}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device disable ${device_id}
Should Be Equal As Integers ${rc} 0
Disable Devices In Voltha
@@ -61,15 +61,18 @@
[Arguments] ${filter}
${arg}= Set Variable ${EMPTY}
${arg}= Run Keyword If len('${filter}'.strip()) != 0 Set Variable --filter ${filter}
- ${rc} ${devices}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list ${arg} --orderby Root -q | xargs echo -n
+ ${rc} ${devices}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device list ${arg} --orderby Root -q | xargs echo -n
Should Be Equal As Integers ${rc} 0
- ${rc} ${output}= Run Keyword If len('${devices}') != 0 Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${devices}
+ ${rc} ${output}= Run Keyword If len('${devices}') != 0 Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device disable ${devices}
Run Keyword If len('${devices}') != 0 Should Be Equal As Integers ${rc} 0
Test Devices Disabled In Voltha
[Documentation] Tests to verify that all devices in VOLTHA are disabled
[Arguments] ${filter}
- ${rc} ${count}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list --filter '${filter},AdminState!=DISABLED' -q | wc -l
+ ${rc} ${count}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device list --filter '${filter},AdminState!=DISABLED' -q | wc -l
Should Be Equal As Integers ${rc} 0
Should Be Equal As Integers ${count} 0
@@ -78,23 +81,28 @@
[Arguments] ${filter}
${arg}= Set Variable ${EMPTY}
${arg}= Run Keyword If len('${filter}'.strip()) != 0 Set Variable --filter ${filter}
- ${rc} ${devices}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list ${arg} --orderby Root -q | xargs echo -n
+ ${rc} ${devices}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device list ${arg} --orderby Root -q | xargs echo -n
Should Be Equal As Integers ${rc} 0
- ${rc} ${output}= Run Keyword If len('${devices}') != 0 Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${devices}
+ ${rc} ${output}= Run Keyword If len('${devices}') != 0 Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device delete ${devices}
Run Keyword If len('${devices}') != 0 Should Be Equal As Integers ${rc} 0
Get Device Flows from Voltha
[Arguments] ${device_id}
[Documentation] Gets device flows from VOLTHA
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device flows ${device_id}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device flows ${device_id}
Should Be Equal As Integers ${rc} 0
[Return] ${output}
Get Logical Device Output from Voltha
[Arguments] ${device_id}
[Documentation] Gets logicaldevice flows and ports from VOLTHA
- ${rc1} ${flows}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl logicaldevice flows ${device_id}
- ${rc2} ${ports}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl logicaldevice ports ${device_id}
+ ${rc1} ${flows}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl logicaldevice flows ${device_id}
+ ${rc2} ${ports}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl logicaldevice ports ${device_id}
Log ${flows}
Log ${ports}
Should Be Equal As Integers ${rc1} 0
@@ -103,8 +111,10 @@
Get Device Output from Voltha
[Arguments] ${device_id}
[Documentation] Gets device flows and ports from VOLTHA
- ${rc1} ${flows}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device flows ${device_id}
- ${rc2} ${ports}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device ports ${device_id}
+ ${rc1} ${flows}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device flows ${device_id}
+ ${rc2} ${ports}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device ports ${device_id}
Log ${flows}
Log ${ports}
Should Be Equal As Integers ${rc1} 0
@@ -117,10 +127,11 @@
Should Be Equal As Integers ${rc1} 0
Validate Device
- [Arguments] ${admin_state} ${oper_status} ${connect_status} ${serial_number}=${EMPTY} ${device_id}=${EMPTY}
- ... ${onu_reason}=${EMPTY} ${onu}=False
- [Documentation] Parses the output of "voltctl device list" and inspects device ${serial_number} and ${device_id}
+ [Documentation]
+ ... Parses the output of "voltctl device list" and inspects device ${serial_number} and ${device_id}
... Arguments are matched for device states of: "admin_state", "oper_status", and "connect_status"
+ [Arguments] ${admin_state} ${oper_status} ${connect_status} ${serial_number}=${EMPTY}
+ ... ${device_id}=${EMPTY} ${onu_reason}=${EMPTY} ${onu}=False
${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
@@ -138,34 +149,36 @@
Log ${value}
Should Be Equal '${astate}' '${admin_state}' Device ${serial_number} admin_state != ${admin_state}
... values=False
- Should Be Equal '${opstatus}' '${oper_status}' Device ${serial_number} oper_status != ${oper_status}
+ Should Be Equal '${opstatus}' '${oper_status}' Device ${serial_number} oper_status != ${oper_status}
... values=False
Should Be Equal '${cstatus}' '${connect_status}' Device ${serial_number} conn_status != ${connect_status}
... values=False
Run Keyword If '${onu}' == 'True' Should Be Equal '${mib_state}' '${onu_reason}'
- ... Device ${serial_number} mib_state incorrect (${mib_state}) values=False
+ ... Device ${serial_number} mib_state incorrect (${mib_state}) values=False
Validate OLT Device
- [Arguments] ${admin_state} ${oper_status} ${connect_status} ${serial_number}=${EMPTY}
+ [Arguments] ${admin_state} ${oper_status} ${connect_status} ${serial_number}=${EMPTY}
... ${device_id}=${EMPTY}
[Documentation] Parses the output of "voltctl device list" and inspects device ${serial_number} and/or
- ... ${device_id} Match on OLT Serial number or Device Id and inspect states
- Validate Device ${admin_state} ${oper_status} ${connect_status} ${serial_number} ${device_id}
+ ... ${device_id} Match on OLT Serial number or Device Id and inspect states
+ Validate Device ${admin_state} ${oper_status} ${connect_status} ${serial_number} ${device_id}
Validate ONU Devices
[Arguments] ${admin_state} ${oper_status} ${connect_status} ${List_ONU_Serial}
- [Documentation] Parses the output of "voltctl device list" and inspects device ${List_ONU_Serial}
+ [Documentation] Parses the output of "voltctl device list" and inspects device ${List_ONU_Serial}
... Iteratively match on each Serial number contained in ${List_ONU_Serial} and inspect
... states including MIB state
- FOR ${serial_number} IN @{List_ONU_Serial}
+ FOR ${serial_number} IN @{List_ONU_Serial}
Validate Device ${admin_state} ${oper_status} ${connect_status} ${serial_number}
- ... onu_reason=omci-flows-pushed onu=True
+ ... onu_reason=omci-flows-pushed onu=True
END
Validate Device Port Types
+ [Documentation]
+ ... Parses the output of voltctl device ports <device_id> and matches the port types listed
[Arguments] ${device_id} ${pon_type} ${ethernet_type}
- [Documentation] Parses the output of voltctl device ports <device_id> and matches the port types listed
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device ports ${device_id} -o json
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device ports ${device_id} -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
Log ${jsondata}
@@ -178,27 +191,27 @@
Should Be Equal '${astate}' 'ENABLED' Device ${device_id} port admin_state != ENABLED values=False
Should Be Equal '${opstatus}' 'ACTIVE' Device ${device_id} port oper_status != ACTIVE values=False
Should Be True '${type}' == '${pon_type}' or '${type}' == '${ethernet_type}'
- ... Device ${device_id} port type is neither ${pon_type} or ${ethernet_type}
+ ... Device ${device_id} port type is neither ${pon_type} or ${ethernet_type}
END
Validate OLT Port Types
- [Documentation] Parses the output of voltctl device ports ${olt_device_id} and matches the port types listed
- [Arguments] ${pon_type} ${ethernet_type}
- Validate Device Port Types ${olt_device_id} ${pon_type} ${ethernet_type}
+ [Documentation] Parses the output of voltctl device ports ${olt_device_id} and matches the port types listed
+ [Arguments] ${pon_type} ${ethernet_type}
+ Validate Device Port Types ${olt_device_id} ${pon_type} ${ethernet_type}
Validate ONU Port Types
- [Arguments] ${List_ONU_Serial} ${pon_type} ${ethernet_type}
- [Documentation] Parses the output of voltctl device ports for each ONU SN listed in ${List_ONU_Serial}
- ... and matches the port types listed
+ [Arguments] ${List_ONU_Serial} ${pon_type} ${ethernet_type}
+ [Documentation] Parses the output of voltctl device ports for each ONU SN listed in ${List_ONU_Serial}
+ ... and matches the port types listed
FOR ${serial_number} IN @{List_ONU_Serial}
${onu_dev_id}= Get Device ID From SN ${serial_number}
- Validate Device Port Types ${onu_dev_id} ${pon_type} ${ethernet_type}
+ Validate Device Port Types ${onu_dev_id} ${pon_type} ${ethernet_type}
END
Validate Device Flows
[Arguments] ${device_id} ${test}=${EMPTY}
[Documentation] Parses the output of voltctl device flows <device_id> and expects flow count > 0
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device flows ${device_id} -o json
+ ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device flows ${device_id} -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
Log ${jsondata}
@@ -206,7 +219,7 @@
Log 'Number of flows = ' ${length}
Run Keyword If '${test}' == '${EMPTY}' Should Be True ${length} > 0
... Number of flows for ${device_id} was 0
- ... ELSE Should Be True ${length} == ${test}
+ ... ELSE Should Be True ${length} == ${test}
... Number of flows for ${device_id} was not ${test}
Validate OLT Flows
@@ -217,7 +230,7 @@
[Arguments] ${List_ONU_Serial} ${test}
[Documentation] Parses the output of voltctl device flows for each ONU SN listed in ${List_ONU_Serial}
... and expects flow count == 0
- FOR ${serial_number} IN @{List_ONU_Serial}
+ FOR ${serial_number} IN @{List_ONU_Serial}
${onu_dev_id}= Get Device ID From SN ${serial_number}
Validate Device Flows ${onu_dev_id} ${test}
END
@@ -239,7 +252,7 @@
Should Be Equal '${rootdev}' '${olt_device_id}' Root Device does not match ${olt_device_id} values=False
Should Be Equal '${sn}' '${BBSIM_OLT_SN}' Logical Device ${sn} does not match ${BBSIM_OLT_SN}
... values=False
- [Return] ${devid}
+ [Return] ${devid}
Validate Logical Device Ports
[Arguments] ${logical_device_id}
@@ -261,12 +274,12 @@
${jsondata}= To Json ${output}
Log ${jsondata}
${length}= Get Length ${jsondata}
- Should Be True ${length} > 0 Number of flows for ${logical_device_id} was 0
+ Should Be True ${length} > 0 Number of flows for ${logical_device_id} was 0
Retrieve Peer List From OLT
- [Arguments] ${olt_peer_list}
+ [Arguments] ${olt_peer_list}
[Documentation] Retrieve the list of peer device id list from port list
- ${rc} ${output}= Run and Return Rc and Output
+ ${rc} ${output}= Run and Return Rc and Output
... ${VOLTCTL_CONFIG}; voltctl device ports ${olt_device_id} -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
@@ -295,12 +308,12 @@
Match OLT Peer Id
[Arguments] ${olt_peer_id}
[Documentation] Lookup the OLT Peer Id in against the list of ONU device Ids
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
+ ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
Log ${jsondata}
${length}= Get Length ${jsondata}
- FOR ${INDEX} IN RANGE 0 ${length}
+ FOR ${INDEX} IN RANGE 0 ${length}
${value}= Get From List ${jsondata} ${INDEX}
${devid}= Get From Dictionary ${value} id
Run Keyword If '${devid}' == '${olt_peer_id}' Exit For Loop
@@ -340,7 +353,7 @@
Get Device ID From SN
[Arguments] ${serial_number}
[Documentation] Gets the device id by matching for ${serial_number}
- ${rc} ${id}= Run and Return Rc and Output
+ ${rc} ${id}= Run and Return Rc and Output
... ${VOLTCTL_CONFIG}; voltctl device list --filter=SerialNumber=${serial_number} --format='{{.Id}}'
Should Be Equal As Integers ${rc} 0
Log ${id}
@@ -349,7 +362,7 @@
Get Logical Device ID From SN
[Arguments] ${serial_number}
[Documentation] Gets the device id by matching for ${serial_number}
- ${rc} ${id}= Run and Return Rc and Output
+ ${rc} ${id}= Run and Return Rc and Output
... ${VOLTCTL_CONFIG}; voltctl logicaldevice list --filter=SerialNumber=${serial_number} --format='{{.Id}}'
Should Be Equal As Integers ${rc} 0
Log ${id}
@@ -365,7 +378,7 @@
Get SN From Device ID
[Arguments] ${device_id}
[Documentation] Gets the device id by matching for ${device_id}
- ${rc} ${sn}= Run and Return Rc and Output
+ ${rc} ${sn}= Run and Return Rc and Output
... ${VOLTCTL_CONFIG}; voltctl device list --filter=Id=${device_id} --format='{{.SerialNumber}}'
Should Be Equal As Integers ${rc} 0
Log ${sn}
@@ -374,7 +387,7 @@
Validate Device Removed
[Arguments] ${id}
[Documentation] Verifys that device, ${serial_number}, has been removed
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
+ ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device list -o json
Should Be Equal As Integers ${rc} 0
${jsondata}= To Json ${output}
Log ${jsondata}
diff --git a/libraries/voltha.robot b/libraries/voltha.robot
index 1009eda..f1f47aa 100644
--- a/libraries/voltha.robot
+++ b/libraries/voltha.robot
@@ -11,13 +11,11 @@
# 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.
-
# voltha common functions
*** Settings ***
Documentation Library for various utilities
Library SSHLibrary
-Library HttpLibrary.HTTP
Library String
Library DateTime
Library Process
@@ -46,7 +44,7 @@
[Arguments] ${name}
[Documentation] Uses a script to restart a kubectl port-forward
${rc} ${pid} Run And Return Rc And Output
- ... ps e -ww | grep _TAG=${name} | grep -v grep | awk '{printf(\"%s %s\\n\",$1,$5)}' | grep -v bash | awk '{print $1}'
+ ... ps e -ww | grep _TAG=${name} | awk '{printf(\"%s %s\\n\",$1,$5)}' | grep kubectl | awk '{print $1}'
Should Be Equal as Integers ${rc} 0
Run Keyword If '${pid}' != '' Run And Return Rc kill -9 ${pid}
Should Be Equal as Integers ${rc} 0
diff --git a/requirements.txt b/requirements.txt
index 924f78b..52e1d59 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,14 +1,10 @@
-cryptography==2.4.2
-docutils
-paramiko==2.4.2
+flake8
pexpect
-psycopg2==2.7.7
-pygments
+pylint
pyyaml
robotframework
-robotframework-databaselibrary
-robotframework-httplibrary
robotframework-kafkalibrary
robotframework-lint
robotframework-requests
robotframework-sshlibrary
+yamllint
diff --git a/tests/data/bbsim-kind-16.yaml b/tests/data/bbsim-kind-16.yaml
index 6da4224..c493c11 100644
--- a/tests/data/bbsim-kind-16.yaml
+++ b/tests/data/bbsim-kind-16.yaml
@@ -17,9 +17,9 @@
# Automated deployment configuration for kind-voltha running BBSim
# Change default values in tests
-has_dataplane: False
-external_libs: False
-teardown_device: True
+has_dataplane: false
+external_libs: false
+teardown_device: true
ONOS_REST_PORT: 8181
ONOS_SSH_PORT: 8101
OLT_PORT: 50060
diff --git a/tests/data/bbsim-kind-2x2.yaml b/tests/data/bbsim-kind-2x2.yaml
index f0a7977..2ab5b8c 100644
--- a/tests/data/bbsim-kind-2x2.yaml
+++ b/tests/data/bbsim-kind-2x2.yaml
@@ -17,9 +17,9 @@
# Automated deployment configuration for kind-voltha running BBSim
# Change default values in tests
-has_dataplane: False
-external_libs: False
-teardown_device: True
+has_dataplane: false
+external_libs: false
+teardown_device: true
ONOS_REST_PORT: 8181
ONOS_SSH_PORT: 8101
OLT_PORT: 50060
diff --git a/tests/data/bbsim-kind-8x2.yaml b/tests/data/bbsim-kind-8x2.yaml
index 1ab2959..71ab65a 100644
--- a/tests/data/bbsim-kind-8x2.yaml
+++ b/tests/data/bbsim-kind-8x2.yaml
@@ -17,9 +17,9 @@
# Automated deployment configuration for kind-voltha running BBSim
# Change default values in tests
-has_dataplane: False
-external_libs: False
-teardown_device: True
+has_dataplane: false
+external_libs: false
+teardown_device: true
ONOS_REST_PORT: 8181
ONOS_SSH_PORT: 8101
OLT_PORT: 50060
diff --git a/tests/data/bbsim-kind.yaml b/tests/data/bbsim-kind.yaml
index d8b1234..021f313 100644
--- a/tests/data/bbsim-kind.yaml
+++ b/tests/data/bbsim-kind.yaml
@@ -17,9 +17,9 @@
# Automated deployment configuration for kind-voltha running BBSim
# Change default values in tests
-has_dataplane: False
-external_libs: False
-teardown_device: True
+has_dataplane: false
+external_libs: false
+teardown_device: true
ONOS_REST_PORT: 8181
ONOS_SSH_PORT: 8101
OLT_PORT: 50060
diff --git a/tests/functional/K8S_SystemTest.robot b/tests/functional/K8S_SystemTest.robot
index dcf47c5..ce0de14 100644
--- a/tests/functional/K8S_SystemTest.robot
+++ b/tests/functional/K8S_SystemTest.robot
@@ -19,11 +19,11 @@
*** Variables ***
${timeout} 120s
-${desired_ETCD_cluster_size} 3
-${minimal_ETCD_cluster_size} 2
-${namespace} voltha
-${ETCD_resources} etcdclusters.etcd.database.coreos.com
-${ETCD_name} voltha-etcd-cluster
+${desired_ETCD_cluster_size} 3
+${minimal_ETCD_cluster_size} 2
+${namespace} voltha
+${ETCD_resources} etcdclusters.etcd.database.coreos.com
+${ETCD_name} voltha-etcd-cluster
${ETCD_pod_label_key} etcd_cluster
${common_pod_label_key} app
${rwcore_pod_label_value} rw-core
@@ -34,38 +34,41 @@
Scale Down ETCD Cluster
[Documentation] Scale Down the ETCD cluster to minimal size, skip test if current cluster size < 3
[Tags] scaledown ETCDdown
- ${current_size}= Get ETCD Running Size voltha
+ ${current_size}= Get ETCD Running Size voltha
Pass Execution If '${current_size}' != '${desired_ETCD_cluster_size}'
... 'Skip the test if the cluster size smaller than minimal size 3'
# The minimal cluster size after scale down
# based on https://github.com/ETCD-io/ETCD/blob/master/Documentation/faq.md#what-is-failure-tolerance
Scale ETCD ${namespace} ${minimal_ETCD_cluster_size}
- Wait Until Keyword Succeeds ${timeout} 2s Validate ETCD Size ${namespace} ${minimal_ETCD_cluster_size}
Wait Until Keyword Succeeds ${timeout} 2s
- ... Check Expected Running Pods Number By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name} 2
+ ... Validate ETCD Size ${namespace} ${minimal_ETCD_cluster_size}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Check Expected Running Pods Number By Label ${namespace}
+ ... ${ETCD_pod_label_key} ${ETCD_name} 2
Scale Up ETCD Cluster
[Documentation] Recover the ETCD cluster by scaling up its size
[Tags] scaleup ETCDup
- ${current_size}= Get ETCD Running Size voltha
+ ${current_size}= Get ETCD Running Size voltha
Pass Execution If '${current_size}' != '${minimal_ETCD_cluster_size}'
... 'Skip the test if the cluster size smaller than minimal size 3'
Scale ETCD ${namespace} ${desired_ETCD_cluster_size}
# We scale up the size to 3, the recommended size of ETCD cluster.
- Wait Until Keyword Succeeds ${timeout} 2s Validate ETCD Size ${namespace} ${desired_ETCD_cluster_size}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Validate ETCD Size ${namespace} ${desired_ETCD_cluster_size}
ETCD Failure Test
[Documentation] Failure Scenario Test: ETCD Crash
[Tags] FailureTest
Delete K8s Pods By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Exist By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Ready By Label ${namespace} ${common_pod_label_key} ${rwcore_pod_label_value}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Ready By Label ${namespace} ${common_pod_label_key} ${ofagent_pod_label_value}
- Wait Until Keyword Succeeds ${timeout} 2s
- ... Pods Does Not Ready By Label ${namespace} ${common_pod_label_key} ${adapter_openolt_pod_label_value}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Do Not Exist By Label ${namespace} ${ETCD_pod_label_key} ${ETCD_name}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Are Ready By Label ${namespace} ${common_pod_label_key} ${rwcore_pod_label_value}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Are Ready By Label ${namespace} ${common_pod_label_key} ${ofagent_pod_label_value}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Pods Are Ready By Label ${namespace} ${common_pod_label_key} ${adapter_openolt_pod_label_value}
*** Keywords ***
Get ETCD Running Size
diff --git a/tests/functional/Voltha_PODTests.robot b/tests/functional/Voltha_PODTests.robot
index 737cc39..49e9edb 100644
--- a/tests/functional/Voltha_PODTests.robot
+++ b/tests/functional/Voltha_PODTests.robot
@@ -11,7 +11,6 @@
# 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.
-
# FIXME Can we use the same test against BBSim and Hardware?
*** Settings ***
@@ -41,17 +40,17 @@
${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
${HELM_CHARTS_DIR} ~/helm-charts
${VOLTHA_POD_NUM} 8
-${NAMESPACE} voltha
+${NAMESPACE} voltha
# For below variable value, using deployment name as using grep for
# parsing radius pod name, we can also use full radius pod name
-${RESTART_POD_NAME} radius
+${RESTART_POD_NAME} radius
${timeout} 60s
${of_id} 0
${logical_id} 0
${has_dataplane} True
${external_libs} True
${teardown_device} False
-${scripts} ../../scripts
+${scripts} ../../scripts
*** Test Cases ***
Sanity E2E Test for OLT/ONU on POD
@@ -60,7 +59,7 @@
[Tags] sanity test1
[Teardown] NONE
Run Keyword If ${has_dataplane} Clean Up Linux
- Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
+ Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Run Keyword and Ignore Error Collect Logs
Test Disable and Enable ONU
@@ -71,59 +70,59 @@
[Tags] functional DisableEnableONU released
[Setup] None
[Teardown] None
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
-
${onu_device_id}= Get Device ID From SN ${src['onu']}
${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
... ${of_id}
Disable Device ${onu_device_id}
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']}
- ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
+ ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Enable Device ${onu_device_id}
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst['dp_iface_ip_qinq']}
- ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
- Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
+ ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
+ Run Keyword and Ignore Error Collect Logs
END
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword and Ignore Error Collect Logs
Test Subscriber Delete and Add
[Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
... Assuming that all the ONUs are authenticated/DHCP/pingable
- ... Delete a subscriber and validate that the pings do not succeed
+ ... Delete a subscriber and validate that the pings do not succeed
... Re-add the subscriber and validate that the pings are successful
[Tags] functional SubAddDelete released
[Setup] None
[Teardown] None
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
-
${onu_device_id}= Get Device ID From SN ${src['onu']}
${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
... ${of_id}
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
Sleep 10s
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']}
- ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
+ ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Sleep 10s
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping True ${dst['dp_iface_ip_qinq']}
- ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
- Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s
+ ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
+ Run Keyword and Ignore Error Collect Logs
END
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword and Ignore Error Collect Logs
Check OLT/ONU Authentication After Radius Pod Restart
[Documentation] After radius restart, triggers reassociation, checks status and
@@ -132,50 +131,48 @@
... teardown from previous test or uncomment 'Teardown None'.
... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
[Tags] functional RadiusRestart released
- [Setup] None
- [Teardown] None
+ [Setup] None
+ [Teardown] None
Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} ${RESTART_POD_NAME}
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
-
-
${onu_device_id}= Get Device ID From SN ${src['onu']}
- ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
- ... ${of_id}
- Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate
- ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
+ ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
+ ... Get ONU Port in ONOS ${src['onu']} ${of_id}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Validate Authentication After Reassociate True ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
- ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
- ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
- ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
- ... ${dst['container_name']}
+ ... ${ONOS_SSH_PORT} ${onu_port}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Validate DHCP and Ping True True ${src['dp_iface_name']}
+ ... ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
+ ... ${src['ip']} ${src['user']} ${src['pass']}
+ ... ${src['container_type']} ${src['container_name']}
+ ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']}
+ ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure
... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
+ Run Keyword and Ignore Error Collect Logs
END
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword and Ignore Error Collect Logs
Check DHCP attempt fails when subscriber is not added
[Documentation] Validates when removed subscriber access, DHCP attempt, ping fails and
... when again added subscriber access, DHCP attempt, ping succeeds
- ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
+ ... Assuming that test1 or sanity test was executed where all the ONUs are authenticated/DHCP/pingable
[Tags] functional SubsRemoveDHCP released
[Setup] None
[Teardown] None
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
-
- ${onu_device_id}= Get Device ID From SN ${src['onu']}
+ ${onu_device_id}= Get Device ID From SN ${src['onu']}
${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
... ${of_id}
Run Keyword And Ignore Error Login And Run Command On Remote System killall dhclient ${src['ip']}
@@ -184,13 +181,14 @@
... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
- Sleep 5s
+ Sleep 5s
Run Keyword And Ignore Error Login And Run Command On Remote System ps -ef | grep dhclient ${src['ip']}
... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
- Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
- ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
- ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
- Run Keyword And Ignore Error Login And Run Command On Remote System ifconfig | grep -A 10 ens ${src['ip']}
+ Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds ${timeout} 2s
+ ... Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
+ ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword And Ignore Error Login And Run Command On Remote System
+ ... ifconfig | grep -A 10 ens ${src['ip']}
... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping False
... False ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
@@ -210,11 +208,11 @@
Check ONU adapter crash not forcing authentication again
[Documentation] After ONU adapter restart, checks wpa log for 'authentication started'
- ... message count to make sure auth not started again and validates EAP status and ping.
+ ... message count to make sure auth not started again and validates EAP status and ping.
... Assuming that test1 or sanity was executed where all the ONUs are authenticated/DHCP/pingable
[Tags] functional ONUAdaptCrash notready
- [Setup] None
- [Teardown] None
+ [Setup] None
+ [Teardown] None
@{before_list}= Create List
@{after_list}= Create List
FOR ${I} IN RANGE 0 ${num_onus}
@@ -226,7 +224,7 @@
${before}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs
... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
- Append To List ${before_list} ${before}
+ Append To List ${before_list} ${before}
END
Wait Until Keyword Succeeds ${timeout} 15s Restart Pod ${NAMESPACE} adapter-open-onu
Wait Until Keyword Succeeds ${timeout} 2s Validate Pod Status ${podName} ${NAMESPACE}
@@ -240,34 +238,34 @@
${after}= Run Keyword If ${has_dataplane} Check Remote File Contents For WPA Logs
... True /tmp/wpa.log authentication started ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
- Append To List ${after_list} ${after}
- ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
- ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
- ... ${src['container_type']} ${src['container_name']}
- Should Contain ${output} SUCCESS
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping
+ Append To List ${after_list} ${after}
+ ${output}= Run Keyword If ${has_dataplane} Login And Run Command On Remote System
+ ... wpa_cli status | grep SUCCESS ${src['ip']} ${src['user']} ${src['pass']}
+ ... ${src['container_type']} ${src['container_name']}
+ Should Contain ${output} SUCCESS
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Wait Until Keyword Succeeds 60s 2s Check Ping
... True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} ${src['user']}
- ... ${src['pass']} ${src['container_type']} ${src['container_name']}
+ ... ${src['pass']} ${src['container_type']} ${src['container_name']}
END
Lists Should Be Equal ${after_list} ${before_list}
Log ${after_list}
Log ${before_list}
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword and Ignore Error Collect Logs
Test Disable and Enable ONU scenario for ATT workflow
[Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
... Assuming that test1 was executed where all the ONUs are authenticated/DHCP/pingable
... Perform disable on the ONUs, call volt-remove-subscriber and validate that the pings do not succeed
- ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and validate that the pings are successful
+ ... Perform enable on the ONUs, authentication check, volt-add-subscriber-access and
+ ... validate that the pings are successful
... VOL-2284
[Tags] functional ATT_DisableEnableONU
[Setup] None
#[Teardown] None
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
-
${onu_device_id}= Get Device ID From SN ${src['onu']}
${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
... ${of_id}
@@ -275,17 +273,20 @@
Sleep 5s
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Wait Until Keyword Succeeds 60s 2s Check Ping False ${dst['dp_iface_ip_qinq']}
- ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Wait Until Keyword Succeeds 60s 2s Check Ping
+ ... False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
... ELSE sleep 60s
Enable Device ${onu_device_id}
Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
... ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate
- ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Validate Authentication After Reassociate True
+ ... ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} ${onu_port}
+ ... ${ONOS_SSH_PORT} ${onu_port}
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
Sleep 10s
@@ -307,17 +308,17 @@
[Setup] NONE
[Teardown] NONE
${waitforRestart} Set Variable 120s
- ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE}
+ ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Log ${podStatusOutput}
- ${countBforRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
+ ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
${podName} Set Variable adapter-open-olt
Restart Pod ${NAMESPACE} ${podName}
Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE}
... Running
Repeat Sanity Test
- ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE}
+ ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
Log ${podStatusOutput}
- ${countAfterRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
+ ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
Log to console Pod ${podName} restarted and sanity checks passed successfully
@@ -365,22 +366,20 @@
[Documentation] Deploys an device instance and waits for it to authenticate. After
... authentication is successful the rw-core deployment is scaled to 0 instances to
... simulate a POD crash. The test then scales the rw-core back to a single instance
- ... and configures ONOS for access. The test succeeds if the device is able to
+ ... and configures ONOS for access. The test succeeds if the device is able to
... complete the DHCP sequence.
[Tags] bbsim rwcore-restart
[Setup] Clear All Devices Then Create New Device
${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Set Global Variable ${of_id}
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
${onu_device_id}= Get Device ID From SN ${src['onu']}
${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
... ${of_id}
-
# Bring up the device and verify it authenticates
- Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
+ Wait Until Keyword Succeeds ${timeout} 5s Validate Device ENABLED ACTIVE REACHABLE
... ${onu_device_id} onu=True onu_reason=omci-flows-pushed
Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
... ${ONOS_SSH_PORT} ${onu_port}
@@ -388,27 +387,26 @@
... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} ${onu_port}
-
+ ... ${ONOS_SSH_PORT} ${onu_port}
# Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1
Scale K8s Deployment voltha voltha-rw-core 0
Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-rw-core
# Ensure the ofagent POD goes "not-ready" as expected
- Wait Until keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 0
+ Wait Until keyword Succeeds ${timeout} 2s
+ ... Check Expected Available Deployment Replicas voltha voltha-ofagent 0
# Scale up the core deployment and make sure both it and the ofagent deployment are back
Scale K8s Deployment voltha voltha-rw-core 1
- Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-rw-core 1
- Wait Until Keyword Succeeds ${timeout} 2s Check Expected Available Deployment Replicas voltha voltha-ofagent 1
-
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Check Expected Available Deployment Replicas voltha voltha-rw-core 1
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Check Expected Available Deployment Replicas voltha voltha-ofagent 1
# For some reason scaling down and up the POD behind a service causes the port forward to stop working,
# so restart the port forwarding for the API service
Restart VOLTHA Port Foward voltha-api-minimal
-
# Ensure that the ofagent pod is up and ready and the device is available in ONOS, this
# represents system connectivity being restored
Wait Until Keyword Succeeds ${timeout} 2s Device Is Available In ONOS
... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT} ${of_id}
-
# Add subscriber access and verify that DHCP completes to ensure system is still functioning properly
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
@@ -437,40 +435,37 @@
${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
Set Suite Variable ${olt_device_id}
#validate olt states
- Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN
- ... ${EMPTY} ${olt_device_id}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${EMPTY} ${olt_device_id}
Enable Device ${olt_device_id}
- Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE
- ... ${olt_serial_number}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate OLT Device ENABLED ACTIVE REACHABLE ${olt_serial_number}
${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
Set Suite Variable ${logical_id}
Delete All Devices and Verify
[Documentation] Remove any devices from VOLTHA and ONOS
-
# Clear devices from VOLTHA
Disable Devices In Voltha Root=true
Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true
Delete Devices In Voltha Root=true
Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List
-
# Clear devices from ONOS
Remove All Devices From ONOS
... http://karaf:karaf@${k8s_node_ip}:${ONOS_REST_PORT}
Clear All Devices Then Create New Device
[Documentation] Remove any devices from VOLTHA and ONOS
-
# Remove all devices from voltha and nos
Delete All Devices and Verify
-
# Execute normal test Setup Keyword
Setup
Teardown
[Documentation] kills processes and cleans up interfaces on src+dst servers
Run Keyword If ${has_dataplane} Clean Up Linux
- Run Keyword If ${external_libs} Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
+ Run Keyword If ${external_libs} Log Kubernetes Containers
+ ... Logs Since Time ${datetime} ${container_list}
Collect Logs
[Documentation] Collect Logs from voltha and onos cli for various commands
@@ -504,12 +499,14 @@
Delete Device and Verify
[Documentation] Disable -> Delete devices via voltctl and verify its removed
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
Should Be Equal As Integers ${rc} 0
Sleep 5s
- Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
- ... ${olt_serial_number}
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}
@@ -518,30 +515,27 @@
... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD
... This keyword can be used to call in any other tests where sanity check is required
... and avoids duplication of code.
-
${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number}
Set Global Variable ${of_id}
-
FOR ${I} IN RANGE 0 ${num_onus}
${src}= Set Variable ${hosts.src[${I}]}
${dst}= Set Variable ${hosts.dst[${I}]}
-
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
... ENABLED ACTIVE REACHABLE
... ${src['onu']} onu=True onu_reason=omci-flows-pushed
-
${onu_device_id}= Get Device ID From SN ${src['onu']}
- ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
- ... ${of_id}
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU
- ... ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
+ ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
+ ... Get ONU Port in ONOS ${src['onu']} ${of_id}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True
... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users
- ... ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
+ ... Verify ONU in AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2
+ ... Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT}
+ ... volt-add-subscriber-access ${of_id} ${onu_port}
Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
@@ -549,8 +543,8 @@
... ${dst['container_name']}
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
... Validate Subscriber DHCP Allocation ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
- Run Keyword and Ignore Error Collect Logs
+ Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
+ Run Keyword and Ignore Error Collect Logs
END
Repeat Sanity Test
@@ -568,19 +562,22 @@
${onu_device_id}= Get Device ID From SN ${src['onu']}
- ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
- ... ${of_id}
- Wait Until Keyword Succeeds ${timeout} 2s Verify Eapol Flows Added For ONU ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication After Reassociate
+ ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s
+ ... Get ONU Port in ONOS ${src['onu']} ${of_id}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify Eapol Flows Added For ONU ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Validate Authentication After Reassociate
... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']}
... ${src['container_type']} ${src['container_name']}
- Wait Until Keyword Succeeds ${timeout} 2s Verify ONU in AAA-Users ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} ${onu_port}
- Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
- ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
- Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True
- ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify ONU in AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${onu_port}
+ Wait Until Keyword Succeeds ${timeout} 2s
+ ... Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT}
+ ... volt-add-subscriber-access ${of_id} ${onu_port}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Validate DHCP and Ping True True
+ ... ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']}
... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']}
... ${dst['container_name']}
diff --git a/tests/functional/Voltha_ScaleFunctionalTests.robot b/tests/functional/Voltha_ScaleFunctionalTests.robot
index f60b4dd..1bda666 100644
--- a/tests/functional/Voltha_ScaleFunctionalTests.robot
+++ b/tests/functional/Voltha_ScaleFunctionalTests.robot
@@ -13,8 +13,8 @@
# limitations under the License.
*** Settings ***
-Documentation Test suite that engages a larger number of ONU at the same which makes it a more realistic test
-... It is addaptable to either BBSim or Real H/W using a configuration file
+Documentation Test suite that engages a larger number of ONU at the same time to test scale
+... It is compatible with either BBSim or real H/W using a configuration file
Suite Setup Setup Suite
Suite Teardown Teardown Suite
Library Collections
@@ -30,10 +30,10 @@
Resource ../../variables/variables.robot
*** Variables ***
-${timeout} 60s
+${timeout} 60s
${long_timeout} 420
-${of_id} 0
-${logical_id} 0
+${of_id} 0
+${logical_id} 0
${has_dataplane} True
${external_libs} True
${teardown_device} False
@@ -50,13 +50,13 @@
${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
Set Global Variable ${olt_device_id}
#validate olt states
- Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${EMPTY}
- ... ${olt_device_id}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${EMPTY} ${olt_device_id}
#enable device
Enable Device ${olt_device_id}
#validate olt states
- Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE ${EMPTY}
- ... ${olt_device_id}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate OLT Device ENABLED ACTIVE REACHABLE ${EMPTY} ${olt_device_id}
ONU Discovery
[Documentation] Discover lists of ONUS, their Serial Numbers and device id
@@ -67,12 +67,13 @@
Build ONU SN List ${List_ONU_Serial}
Log ${List_ONU_Serial}
#validate onu states
- Wait Until Keyword Succeeds ${long_timeout} 20s Validate ONU Devices ENABLED ACTIVE REACHABLE
- ... ${List_ONU_Serial}
+ Wait Until Keyword Succeeds ${long_timeout} 20s
+ ... Validate ONU Devices ENABLED ACTIVE REACHABLE ${List_ONU_Serial}
Validate Device's Ports and Flows
[Documentation] Verify Ports and Flows listed for OLT and ONUs
- ... For OLT we validate the port types and numbers and for flows we simply verify that their numbers > 0
+ ... For OLT we validate the port types and numbers and for flows we simply
+ ... verify that their numbers > 0
... For each ONU, we validate the port types and numbers for each and for flows.
... For flows they should be == 0 at this stage
[Tags] active
@@ -83,7 +84,8 @@
#validate onu port types
Validate ONU Port Types ${List_ONU_Serial} PON_ONU ETHERNET_UNI
#validate onu flows
- Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows ${List_ONU_Serial} ${num_onu_flows}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate ONU Flows ${List_ONU_Serial} ${num_onu_flows}
Validate Logical Device
[Documentation] Verify that logical device exists and then verify its ports and flows
@@ -118,7 +120,8 @@
... kills processes and cleans up interfaces on src+dst servers
Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip}
Run Keyword If ${has_dataplane} Clean Up Linux
- Run Keyword If ${external_libs} Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
+ Run Keyword If ${external_libs}
+ ... Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Run Keyword If ${teardown_device} Delete Device and Verify
Run Keyword If ${teardown_device} Test Empty Device List
Run Keyword If ${teardown_device} Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT}
@@ -145,10 +148,12 @@
Delete Device and Verify
[Documentation] Disable -> Delete devices via voltctl and verify its removed
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
Should Be Equal As Integers ${rc} 0
- Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device DISABLED UNKNOWN REACHABLE
- ... ${olt_serial_number}
- ${rc} ${output}= Run and Return Rc and Output ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
+ Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number}
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}
diff --git a/variables/variables.robot b/variables/variables.robot
index 4415d23..1fb3327 100644
--- a/variables/variables.robot
+++ b/variables/variables.robot
@@ -18,6 +18,6 @@
${ONOS_REST_PORT} 30120
${ONOS_SSH_PORT} 30115
${OLT_PORT} 9191
-@{PODLIST1} voltha-kafka voltha-ofagent
-@{PODLIST2} bbsim etcd-operator-etcd-operator-etcd-operator radius voltha-api-server voltha-cli-server voltha-ro-core voltha-rw-core-11
-
+@{PODLIST1} voltha-kafka voltha-ofagent
+@{PODLIST2} bbsim etcd-operator-etcd-operator-etcd-operator radius voltha-api-server
+... voltha-cli-server voltha-ro-core voltha-rw-core-11