[SEBA-285] Run ATT workflow tests on ONF POD
Change-Id: I071e0f29435c23fa702e69fe5fc9bbc9fe1908bd
diff --git a/src/test/cord-api/Framework/DHCP.robot b/src/test/cord-api/Framework/DHCP.robot
index 979048e..8af8ada 100644
--- a/src/test/cord-api/Framework/DHCP.robot
+++ b/src/test/cord-api/Framework/DHCP.robot
@@ -20,32 +20,20 @@
*** Keywords ***
Send Dhclient Request
- [Arguments] ${ip} ${user} ${pass} ${iface} ${prompt}=$ ${prompt_timeout}=60s
- [Documentation] SSH's into the RG (src) and executes a dhclient against a particular interface
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo dhclient -nw ${iface}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- ${result}= Read Until ${prompt}
- SSHLibrary.Close Connection
+ [Arguments] ${iface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ [Documentation] Executes a dhclient against a particular interface on the RG (src)
+ ${result}= Login And Run Command On Remote System sudo dhclient -nw ${iface} ${ip} ${user} ${pass} ${key} ${container_name}
[Return] ${result}
Add Default Route to Dst Gateway
- [Arguments] ${ip} ${user} ${pass} ${src_gateway} ${dst_subnet} ${iface} ${prompt}=$ ${prompt_timeout}=60s
- [Documentation] SSH's into the RG (src) and adds an entry to the routing table
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo ip route add ${dst_subnet} via ${src_gateway} dev ${iface}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- ${result}= Read Until ${prompt}
- SSHLibrary.Close Connection
+ [Arguments] ${src_gateway} ${dst_subnet} ${iface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ [Documentation] Adds an entry to the routing table on the RG (src)
+ ${result}= Login And Run Command On Remote System sudo ip route add ${dst_subnet} via ${src_gateway} dev ${iface} ${ip} ${user} ${pass} ${key} ${container_name}
[Return] ${result}
Check IPv4 Address on DHCP Client
- [Arguments] ${ip_should_exist} ${ip} ${user} ${pass} ${iface}
+ [Arguments] ${ip_should_exist} ${iface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
[Documentation] Check if the sepcified interface has an IPv4 address assigned
- ${output}= Run Command On Remote System ${ip} ifconfig ${iface} ${user} ${pass}
+ ${output}= Login And Run Command On Remote System ifconfig ${iface} ${ip} ${user} ${pass} ${key} ${container_name}
Run Keyword If '${ip_should_exist}' == 'True' Should Match Regexp ${output} \\b([0-9]{1,3}\\.){3}[0-9]{1,3}\\b
Run Keyword If '${ip_should_exist}' == 'False' Should Not Match Regexp ${output} \\b([0-9]{1,3}\\.){3}[0-9]{1,3}\\b
diff --git a/src/test/cord-api/Framework/Kubernetes.robot b/src/test/cord-api/Framework/Kubernetes.robot
index 41af2c5..d284a77 100644
--- a/src/test/cord-api/Framework/Kubernetes.robot
+++ b/src/test/cord-api/Framework/Kubernetes.robot
@@ -24,22 +24,19 @@
*** Keywords ***
Helm Chart is Removed
- [Arguments] ${kubernetes_conf} ${helm_chart}
+ [Arguments] ${helm_chart}
[Documentation] Verify the specified helm chart has been removed
- Run export KUBECONFIG=${kubernetes_conf}
- ${rc}= Run And Return Rc helm ls -q | grep ${helm_chart}
+ ${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] ${kubernetes_conf} ${namespace}
+ [Arguments] ${namespace}
[Documentation] Verify all Kubernetes pods in specified namespace have been removed
- Run export KUBECONFIG=${kubernetes_conf}
- ${rc} ${output}= Run And Return Rc And Output kubectl get pods --no-headers -n ${namespace}
+ ${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] ${kubernetes_conf} ${namespace} ${pod_num}
+ [Arguments] ${namespace} ${pod_num}
[Documentation] Verify the number of Kubernetes pods that are running in specified namespace is as expected
- Run export KUBECONFIG=${kubernetes_conf}
- ${rc} ${output}= Run And Return Rc And Output kubectl get pods -n ${namespace} | grep -i running | grep 1/1 | wc -l
+ ${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}
diff --git a/src/test/cord-api/Framework/OLT.robot b/src/test/cord-api/Framework/OLT.robot
index 394b4a2..0e208b0 100644
--- a/src/test/cord-api/Framework/OLT.robot
+++ b/src/test/cord-api/Framework/OLT.robot
@@ -24,9 +24,6 @@
*** Keywords ***
Openolt is Up
- [Arguments] ${ip} ${user} ${pass} ${prompt}=\# ${prompt_timeout}=60s
+ [Arguments] ${ip} ${user} ${pass} ${prompt}=~#
[Documentation] Verify that openolt process is started and ready to connect to voltha
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- Check Remote File Contents True ${conn_id} /var/log/ openolt.log oper_state: up
- SSHLibrary.Close Connection
+ Check Remote File Contents True /var/log/openolt.log oper_state: up ${ip} ${user} ${pass} prompt=${prompt}
diff --git a/src/test/cord-api/Framework/Subscriber.robot b/src/test/cord-api/Framework/Subscriber.robot
index b884075..91aff61 100644
--- a/src/test/cord-api/Framework/Subscriber.robot
+++ b/src/test/cord-api/Framework/Subscriber.robot
@@ -20,29 +20,6 @@
Resource ../../Framework/utils/utils.robot
*** Keywords ***
-Send EAPOL Message
- [Arguments] ${auth_pass} ${ip} ${user} ${pass} ${iface} ${conf_file} ${prompt}=$ ${prompt_timeout}=60s
- [Documentation] SSH's into the RG (src) and executes a particular auth request via wpa_supplicant client. Requested packet should exist on src.
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo rm -f /tmp/wpa.log; sudo wpa_supplicant -B -i ${iface} -Dwired -c /etc/wpa_supplicant/${conf_file} -f /tmp/wpa.log
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds 30s 2s Check Remote File Contents True ${conn_id} /tmp/ wpa.log authentication completed successfully
- Run Keyword If '${auth_pass}' == 'False' Sleep 10s
- Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents False ${conn_id} /tmp/ wpa.log authentication completed successfully
- SSHLibrary.Close Connection
-
-Delete IP Addresses from Interface on Remote Host
- [Arguments] ${ip} ${user} ${pass} ${interface} ${prompt}=$ ${prompt_timeout}=60s
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo ip addr flush dev ${interface}; echo $?
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- ${result}= Read Until ${prompt}
- SSHLibrary.Close Connection
-
Subscriber Status Check
[Arguments] ${onu_device}
[Documentation] Returns Status from Subscribers List for a particular ONU device
@@ -81,60 +58,39 @@
${api_result}= restApi.ApiChameleonDelete VOLT_SUBSCRIBER ${id}
Should Be True ${api_result}
-Add Double Vlan Interface on Host
- [Arguments] ${ip} ${user} ${pass} ${interface} ${stag} ${ctag} ${prompt}=$ ${prompt_timeout}=60s
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo ip link add link ${interface} name ${interface}.${stag} type vlan id ${stag}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- SSHLibrary.Write sudo ip link set ${interface}.${stag} up
- ${result}= Read Until ${prompt}
- SSHLibrary.Write sudo ip link add link ${interface}.${stag} name ${interface}.${stag}.${ctag} type vlan id ${ctag}
- ${result}= Read Until ${prompt}
- SSHLibrary.Write sudo ip link set ${interface}.${stag}.${ctag} up
- ${result}= Read Until ${prompt}
- SSHLibrary.Write ifconfig ${interface}.${stag}.${ctag}
- ${result}= Read Until ${prompt}
- SSHLibrary.Close Connection
-
-Delete Interface on Remote Host
- [Arguments] ${ip} ${user} ${pass} ${interface} ${prompt}=$ ${prompt_timeout}=60s
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo ip link del ${interface}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- Read Until ${prompt}
- SSHLibrary.Close Connection
-
-Add Ip Address on Interface on Host
- [Arguments] ${ip} ${user} ${pass} ${ip_address} ${interface} ${prompt}=$ ${prompt_timeout}=60s
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo ip addr add ${ip_address} dev ${interface}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- Read Until ${prompt}
- SSHLibrary.Close Connection
+Send EAPOL Message
+ [Arguments] ${auth_pass} ${iface} ${conf_file} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ [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 sudo rm -f /tmp/wpa.log; sudo wpa_supplicant -B -i ${iface} -Dwired -c /etc/wpa_supplicant/${conf_file} -f /tmp/wpa.log ${ip} ${user} ${pass} ${key} ${container_name}
+ Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds 30s 2s Check Remote File Contents True /tmp/wpa.log authentication completed successfully ${ip} ${user} ${pass} ${key} ${container_name}
+ Run Keyword If '${auth_pass}' == 'False' Sleep 10s
+ Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents False /tmp/wpa.log authentication completed successfully ${ip} ${user} ${pass} ${key} ${container_name}
Start DHCP Server on Remote Host
- [Arguments] ${ip} ${user} ${pass} ${interface} ${prompt}=$ ${prompt_timeout}=60s
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo dhcpd -cf /etc/dhcp/dhcpd.conf ${interface}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- ${result}= Read Until ${prompt}
+ [Arguments] ${interface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ ${result}= Login And Run Command On Remote System sudo dhcpd -cf /etc/dhcp/dhcpd.conf ${interface} ${ip} ${user} ${pass} ${key} ${container_name}
Should Contain ${result} Listening on LPF/${interface}
- SSHLibrary.Close Connection
+
+Delete IP Addresses from Interface on Remote Host
+ [Arguments] ${interface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ Login And Run Command On Remote System sudo ip addr flush dev ${interface} ${ip} ${user} ${pass} ${key} ${container_name}
+
+Add Double Vlan Interface on Host
+ [Arguments] ${interface} ${stag} ${ctag} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ Login And Run Command On Remote System sudo ip link add link ${interface} name ${interface}.${stag} type vlan id ${stag} ${ip} ${user} ${pass} ${key} ${container_name}
+ Login And Run Command On Remote System sudo ip link set ${interface}.${stag} up ${ip} ${user} ${pass} ${key} ${container_name}
+ Login And Run Command On Remote System sudo ip link add link ${interface}.${stag} name ${interface}.${stag}.${ctag} type vlan id ${ctag} ${ip} ${user} ${pass} ${key} ${container_name}
+ Login And Run Command On Remote System sudo ip link set ${interface}.${stag}.${ctag} up ${ip} ${user} ${pass} ${key} ${container_name}
+ Login And Run Command On Remote System ifconfig ${interface}.${stag}.${ctag} ${ip} ${user} ${pass} ${key} ${container_name}
+
+Delete Interface on Remote Host
+ [Arguments] ${interface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ Login And Run Command On Remote System sudo ip link del ${interface} ${ip} ${user} ${pass} ${key} ${container_name}
+
+Add Ip Address on Interface on Host
+ [Arguments] ${ip_address} ${interface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ Login And Run Command On Remote System sudo ip addr add ${ip_address} dev ${interface} ${ip} ${user} ${pass} ${key} ${container_name}
Add Route to Remote Host
- [Arguments] ${ip} ${user} ${pass} ${subnet} ${gateway} ${interface} ${prompt}=$ ${prompt_timeout}=60s
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write sudo ip route add ${subnet} via ${gateway} dev ${interface}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- ${result}= Read Until ${prompt}
- SSHLibrary.Close Connection
+ [Arguments] ${subnet} ${gateway} ${interface} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ Login And Run Command On Remote System sudo ip route add ${subnet} via ${gateway} dev ${interface} ${ip} ${user} ${pass} ${key} ${container_name}
diff --git a/src/test/cord-api/Framework/utils/utils.robot b/src/test/cord-api/Framework/utils/utils.robot
index cf8a771..5bd801a 100644
--- a/src/test/cord-api/Framework/utils/utils.robot
+++ b/src/test/cord-api/Framework/utils/utils.robot
@@ -23,27 +23,44 @@
Library RequestsLibrary
*** Keywords ***
-Run Command On Remote System
- [Arguments] ${ip} ${cmd} ${user} ${pass} ${prompt}=$ ${prompt_timeout}=60s
- [Documentation] SSH's into a remote host, executes command, and logs+returns output
- ${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- ${output}= SSHLibrary.Execute Command ${cmd}
- SSHLibrary.Close Connection
- Log ${output}
+Login And Run Command On Remote System
+ [Arguments] ${cmd} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY} ${prompt}=~$ ${prompt_timeout}=15s ${container_prompt}=~#
+ [Documentation] SSH's into a remote host and executes a command and returns output. If container_name is specified, login to the container before executing the command
+ ${conn_id} ${prompt}= Login To Remote System ${ip} ${user} ${pass} ${key} ${container_name} ${prompt} ${prompt_timeout} ${container_prompt}
+ ${output}= Run Command On Remote System ${cmd} ${conn_id} ${user} ${prompt} ${pass}
+ Logout From Remote System ${conn_id}
[Return] ${output}
-Run Sudo Command On Remote System
- [Arguments] ${ip} ${cmd} ${user} ${pass} ${prompt}=$ ${prompt_timeout}=60s
+Login To Remote System
+ [Arguments] ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY} ${prompt}=~$ ${prompt_timeout}=15s ${container_prompt}=~#
+ [Documentation] SSH's into a remote host and returns connection ID. If container_name is specified, login to the container before returning
${conn_id}= SSHLibrary.Open Connection ${ip} prompt=${prompt} timeout=${prompt_timeout}
- SSHLibrary.Login ${user} ${pass}
- SSHLibrary.Write ${cmd}
- Read Until [sudo] password for ${user}:
- SSHLibrary.Write ${pass}
- ${result}= Read Until ${prompt}
+ Run Keyword If '${key}' != '${EMPTY}' SSHLibrary.Login With Public Key ${user} ${key}
+ ... ELSE SSHLibrary.Login ${user} ${pass}
+ # Login to the lxc container
+ Run Keyword If '${container_name}' != '${EMPTY}' Run Keywords
+ ... SSHLibrary.Write lxc exec ${container_name} /bin/bash AND
+ ... SSHLibrary.Read Until ${container_prompt} AND
+ ... SSHLibrary.Set Client Configuration prompt=${container_prompt}
+ ${prompt}= Set Variable If '${container_name}' != '${EMPTY}' ${container_prompt} ${prompt}
+ [Return] ${conn_id} ${prompt}
+
+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
- Log ${result}
- [Return] ${result}
+
+Run Command On Remote System
+ [Arguments] ${cmd} ${conn_id} ${user} ${prompt} ${pass}=${EMPTY}
+ [Documentation] Executes a command on remote host and returns output
+ SSHLibrary.Switch Connection ${conn_id}
+ SSHLibrary.Write ${cmd}
+ ${output}= SSHLibrary.Read Until Regexp ${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
@@ -200,23 +217,29 @@
[Return] ${id}
Kill Linux Process
- [Arguments] ${ip} ${user} ${pass} ${process}
- ${rc}= Run Sudo Command On Remote System ${ip} sudo kill $(ps aux | grep '${process}' | awk '{print $2}'); echo $? ${user} ${pass}
- Should Contain ${rc} 0
+ [Arguments] ${process} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ ${rc}= Login And Run Command On Remote System sudo kill $(ps aux | grep '${process}' | awk '{print $2}'); echo $? ${ip} ${user} ${pass} ${key} ${container_name}
+ Should Be Equal As Integers ${rc} 0
Check Remote File Contents
- [Arguments] ${file_should_exist} ${conn_id} ${file_path} ${file_name} ${pattern}
- SSHLibrary.Switch Connection ${conn_id}
- SSHLibrary.Get File ${file_path}${file_name} /tmp/
- ${content}= OperatingSystem.Get File /tmp/${file_name} encoding_errors=ignore
- Run Keyword If '${file_should_exist}' == 'True' Should Contain ${content} ${pattern}
- Run Keyword If '${file_should_exist}' == 'False' Should Not Contain ${content} ${pattern}
+ [Arguments] ${file_should_exist} ${file} ${pattern} ${ip} ${user} ${pass}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY} ${prompt}=~$
+ ${output}= Login And Run Command On Remote System cat ${file} | grep '${pattern}' ${ip} ${user} ${pass} ${key} ${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}=${EMPTY} ${key}=${EMPTY} ${container_name}=${EMPTY}
+ ${result}= Login And Run Command On Remote System ping -I ${iface} -c 3 ${dst_ip} ${ip} ${user} ${pass} ${key} ${container_name}
+ Check Ping Result ${ping_should_pass} ${result}
Check Remote System Reachability
- [Arguments] ${reachable} ${ip} ${prompt}=$ ${prompt_timeout}=60s
+ [Arguments] ${reachable} ${ip}
[Documentation] Check if the specified IP address is reachable or not
${result}= Run ping -c 3 -t 3 ${ip}
- Log ${result}
+ 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
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
index 2aaba08..59c6e56 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
@@ -41,17 +41,21 @@
${src_ip} X.X.X.X
${src_gateway} X.X.X.X
${src_user} user
-${src_pass} pass
+${src_pass} ${EMPTY}
+${src_key} ${EMPTY}
+${src_container_name} ${EMPTY}
${src_iface} eth0
-${dst_ip} X.X.X.X
+${dst_ip} ${EMPTY}
${dst_dp_iface} eth0
${dst_dp_ip} X.X.X.X
${dst_user} user
-${dst_pass} pass
+${dst_pass} ${EMPTY}
+${dst_key} ${EMPTY}
+${dst_container_name} ${EMPTY}
${dst_gateway} X.X.X.X
${olt_ip} X.X.X.X
${olt_user} user
-${olt_pass} pass
+${olt_pass} ${EMPTY}
${kubernetes_conf} x.conf
${kubernetes_yml} x.yml
${helm_dir} ~/helm-charts
@@ -66,10 +70,10 @@
... Configuration of source server interface and execute dhclient on interface
... Validate successful pings from src to dst
[Setup] None
- Wait Until Keyword Succeeds 180s 10s Validate ONU States ACTIVE ENABLED
+ Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
- Send EAPOL Message True ${src_ip} ${src_user} ${src_pass} ${src_iface} wpa_supplicant.conf
+ Send EAPOL Message True ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED APPROVED
Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status enabled
Validate DHCP and Ping True True
@@ -80,7 +84,7 @@
... Configuration of the destination servers interface and start dhcpd
... Configuration of source server interface and execute dhclient on interface
... Validate failed DHCP and pings from src to dst
- Wait Until Keyword Succeeds 180s 10s Validate ONU States ACTIVE ENABLED
+ Wait Until Keyword Succeeds 300s 15s Validate ONU States ACTIVE ENABLED
Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI ENABLED AWAITING
Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
Validate DHCP and Ping False False
@@ -99,10 +103,10 @@
${VoltDeviceList} = Get Variable Value ${vlist}
${VoltDeviceDict}= utils.listToDict ${VoltDeviceList} 0
CORD Post ${VOLT_DEVICE} ${VoltDeviceDict}
- Wait Until Keyword Succeeds 180s 10s Validate ONU States UNKNOWN DISABLED
+ Wait Until Keyword Succeeds 300s 15s Validate ONU States UNKNOWN DISABLED
Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
- Send EAPOL Message False ${src_ip} ${src_user} ${src_pass} ${src_iface} wpa_supplicant.conf
+ Send EAPOL Message False ${src_iface} wpa_supplicant.conf ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
Wait Until Keyword Succeeds 60s 2s Validate ATT Workflow Driver SI DISABLED AWAITING
Wait Until Keyword Succeeds 60s 2s Validate Subscriber Status awaiting-auth
Validate DHCP and Ping False False
@@ -132,6 +136,7 @@
Set Global Variable ${vlist} ${VoltDeviceList}
Set Suite Variable ${s_tag}
Set Suite Variable ${c_tag}
+ Set Global Variable ${export_kubeconfig} export KUBECONFIG=${kubernetes_conf}
Teardown
[Documentation] Performs any additional cleanup required
@@ -156,14 +161,14 @@
Clean Test Environment
[Documentation] Delete xos objects, kills processes and cleans up interfaces on src+dst servers
- Run Keyword And Ignore Error Kill Linux Process ${src_ip} ${src_user} ${src_pass} [w]pa_supplicant
- Run Keyword And Ignore Error Kill Linux Process ${src_ip} ${src_user} ${src_pass} [d]hclient
- Run Keyword And Ignore Error Kill Linux Process ${dst_ip} ${dst_user} ${dst_pass} [d]hcpd
- Delete IP Addresses from Interface on Remote Host ${src_ip} ${src_user} ${src_pass} ${src_iface}
- Delete Interface on Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface}.${s_tag}
- Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
- Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE}
- Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
+ Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ Run Keyword If '${dst_ip}' != '${EMPTY}' Run Keyword And Ignore Error Kill Linux Process [d]hcpd ${dst_ip} ${dst_user} ${dst_pass} ${dst_key} ${dst_container_name}
+ Delete IP Addresses from Interface on Remote Host ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ Run Keyword If '${dst_ip}' != '${EMPTY}' Delete Interface on Remote Host ${dst_dp_iface}.${s_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_key} ${dst_container_name}
+ Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_SUBSCRIBER}
+ Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${VOLT_DEVICE}
+ Wait Until Keyword Succeeds 60s 2s Clean Up Objects ${ATT_WHITELIST}
Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability False ${olt_ip}
Wait Until Keyword Succeeds 120s 10s Check Remote System Reachability True ${olt_ip}
Wait Until Keyword Succeeds 120s 10s Openolt is Up ${olt_ip} ${olt_user} ${olt_pass}
@@ -187,23 +192,23 @@
Should Be Equal ${status} ${exepected_status}
Validate DHCP and Ping
- [Arguments] ${dhcp_pass} ${ping_pass}
- Add Double Vlan Interface on Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface} ${s_tag} ${c_tag}
- Add IP Address on Interface on Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_ip}/24 ${dst_dp_iface}.${s_tag}.${c_tag}
- Start DHCP Server on Remote Host ${dst_ip} ${dst_user} ${dst_pass} ${dst_dp_iface}.${s_tag}.${c_tag}
- Send Dhclient Request ${src_ip} ${src_user} ${src_pass} ${src_iface}
- Run Keyword If '${dhcp_pass}' == 'True' Wait Until Keyword Succeeds 60s 5s Check IPv4 Address on DHCP Client True ${src_ip} ${src_user} ${src_pass} ${src_iface}
- Run Keyword If '${dhcp_pass}' == 'False' Sleep 10s
- Run Keyword If '${dhcp_pass}' == 'False' Check IPv4 Address on DHCP Client False ${src_ip} ${src_user} ${src_pass} ${src_iface}
- Run Keyword If '${ping_pass}' == 'True' Wait Until Keyword Succeeds 60s 5s Test Ping PASS ${src_ip} ${src_user} ${src_pass} ${dst_dp_ip} ${src_iface}
- Run Keyword If '${ping_pass}' == 'False' Wait Until Keyword Succeeds 60s 5s Test Ping FAIL ${src_ip} ${src_user} ${src_pass} ${dst_dp_ip} ${src_iface}
+ [Arguments] ${dhcp_should_pass} ${ping_should_pass}
+ Run Keyword If '${dst_ip}' != '${EMPTY}' Run Keywords
+ ... Add Double Vlan Interface on Host ${dst_dp_iface} ${s_tag} ${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_key} ${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_key} ${dst_container_name} AND
+ ... Start DHCP Server on Remote Host ${dst_dp_iface}.${s_tag}.${c_tag} ${dst_ip} ${dst_user} ${dst_pass} ${dst_key} ${dst_container_name}
+ Send Dhclient Request ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ Run Keyword If '${dhcp_should_pass}' == 'True' Wait Until Keyword Succeeds 60s 5s Check IPv4 Address on DHCP Client True ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ Run Keyword If '${dhcp_should_pass}' == 'False' Sleep 10s
+ Run Keyword If '${dhcp_should_pass}' == 'False' Check IPv4 Address on DHCP Client False ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ Run Keyword If '${ping_should_pass}' == 'True' Wait Until Keyword Succeeds 60s 5s Check Ping True ${dst_dp_ip} ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
+ ... ELSE Wait Until Keyword Succeeds 60s 5s Check Ping False ${dst_dp_ip} ${src_iface} ${src_ip} ${src_user} ${src_pass} ${src_key} ${src_container_name}
Reinstall Voltha
- Run export KUBECONFIG=${kubernetes_conf}
- Run helm delete --purge voltha
- Wait Until Keyword Succeeds 60s 10s Helm Chart is Removed ${kubernetes_conf} voltha
- Wait Until Keyword Succeeds 120s 10s Kubernetes PODs in Namespace are Removed ${kubernetes_conf} voltha
- ${rc} ${output}= Run And Return Rc And Output helm install -n voltha -f ${kubernetes_yml} --set etcd-operator.customResources.createEtcdClusterCRD=false ${helm_dir}/voltha
- ${rc} ${output}= Run And Return Rc And Output helm upgrade -f ${kubernetes_yml} --set etcd-operator.customResources.createEtcdClusterCRD=true voltha ${helm_dir}/voltha
- Wait Until Keyword Succeeds 30s 5s Kubernetes PODs in Namespace are Running ${kubernetes_conf} voltha ${voltha_pod_num}
+ 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
+ ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; helm install -n voltha -f ${kubernetes_yml} --set etcd-operator.customResources.createEtcdClusterCRD=false ${helm_dir}/voltha
+ ${rc} ${output}= Run And Return Rc And Output ${export_kubeconfig}; helm upgrade -f ${kubernetes_yml} --set etcd-operator.customResources.createEtcdClusterCRD=true voltha ${helm_dir}/voltha
+ Wait Until Keyword Succeeds 60s 10s Kubernetes PODs in Namespace are Running voltha ${voltha_pod_num}
Sleep 10s
diff --git a/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber-ONF.json b/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber-ONF.json
new file mode 100644
index 0000000..321bc63
--- /dev/null
+++ b/src/test/cord-api/Tests/WorkflowValidations/data/ATTSubscriber-ONF.json
@@ -0,0 +1,14 @@
+{
+ "SubscriberInfo" : [
+ {
+ "name": "Sub_ALPHe3d1cfde",
+ "s_tag": 112,
+ "c_tag": 111,
+ "onu_device": "ALPHe3d1cfde",
+ "nas_port_id": "PON 1/1/04/1:1.1.1",
+ "circuit_id": "foo2",
+ "status": "pre-provisioned",
+ "remote_id": "bar2"
+ }
+ ]
+}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/data/ATTWhiteList-ONF.json b/src/test/cord-api/Tests/WorkflowValidations/data/ATTWhiteList-ONF.json
new file mode 100644
index 0000000..207c1b5
--- /dev/null
+++ b/src/test/cord-api/Tests/WorkflowValidations/data/ATTWhiteList-ONF.json
@@ -0,0 +1,10 @@
+{
+ "AttWhiteListInfo" : [
+ {
+ "serial_number": "ALPHe3d1cfde",
+ "device_id" : "of:000000000a5a0072",
+ "pon_port_id" : 536870912,
+ "owner_id" : "1"
+ }
+ ]
+}
diff --git a/src/test/cord-api/Tests/WorkflowValidations/data/RealOLTDevice-ONF.json b/src/test/cord-api/Tests/WorkflowValidations/data/RealOLTDevice-ONF.json
new file mode 100644
index 0000000..5b49c7b
--- /dev/null
+++ b/src/test/cord-api/Tests/WorkflowValidations/data/RealOLTDevice-ONF.json
@@ -0,0 +1,16 @@
+{
+ "VOLTDeviceInfo" : [
+ {
+ "device_type": "openolt",
+ "host": "10.90.0.114",
+ "port": 9191,
+ "switch_datapath_id": "of:0000000000000001",
+ "switch_port": "1",
+ "outer_tpid": "0x8100",
+ "name": "ONF OLT",
+ "uplink": "65536",
+ "volt_service_id": 2,
+ "nas_id": "NAS_ID"
+ }
+ ]
+}