adding ping check for subscriber status changes
Change-Id: I3b033242dfbe0b5658275fc1b271ac3bab6ffc55
diff --git a/src/test/cord-api/Framework/utils/utils.robot b/src/test/cord-api/Framework/utils/utils.robot
index db559e5..31f2f4f 100644
--- a/src/test/cord-api/Framework/utils/utils.robot
+++ b/src/test/cord-api/Framework/utils/utils.robot
@@ -129,9 +129,19 @@
\ Run Keyword If '${value[0]}' == '${val}' Remove From List ${list} ${INDEX}
\ Run Keyword If '${value[0]}' == '${val}' Exit For Loop
+
Test Ping
- [Arguments] ${interface} ${host}
- [Documentation] Ping hosts to check connectivity
- ${result}= Run ping -I ${interface} -c 5 ${host}
- Should Contain ${result} 64 bytes
- Should Not Contain ${result} Destination Host Unreachable
\ No newline at end of file
+ [Arguments] ${status} ${user} ${pass} ${dest} ${prompt}=$ ${prompt_timeout}=60s
+ [Documentation] SSH's into src and attempts to ping dest. Status determines if ping should pass | fail
+ ${conn_id}= SSHLibrary.Open Connection ${src} prompt=${prompt} timeout=${prompt_timeout}
+ SSHLibrary.Login ${user} ${pass}
+ ${result}= SSHLibrary.Execute Command ping -c 5 ${dest}
+ SSHLibrary.Close Connection
+ Log ${result}
+ Run Keyword If '${status}' == 'PASS' Should Contain ${result} 64 bytes
+ Run Keyword If '${status}' == 'PASS' Should Contain ${result} 0% packet loss
+ Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} 100% packet loss
+ Run Keyword If '${status}' == 'PASS' Should Not Contain ${result} Destination Host Unreachable
+ Run Keyword If '${status}' == 'FAIL' Should Not Contain ${result} 64 bytes
+ Run Keyword If '${status}' == 'FAIL' Should Contain ${result} 100% packet loss
+ Run Keyword If '${status}' == 'FAIL' Should Contain ${result} Destination Host Unreachable
diff --git a/src/test/cord-api/Tests/Subscriber_StatusChecks.txt b/src/test/cord-api/Tests/Subscriber_StatusChecks.txt
index 0743414..6b691ec 100644
--- a/src/test/cord-api/Tests/Subscriber_StatusChecks.txt
+++ b/src/test/cord-api/Tests/Subscriber_StatusChecks.txt
@@ -8,12 +8,20 @@
Library XML
Library RequestsLibrary
Library ../Framework/utils/utils.py
+Library ../Framework/utils/utils.robot
Library ../Framework/restApi.py
*** Variables ***
${PATHFILE} ${CURDIR}/data/Subscriber_TopDown.json
&{input_dict} mac_address=test ip_address=test2
&{status} status=test
+${src_ip} X.X.X.X
+${src_gateway} X.X.X.X
+${src_user} user
+${src_pass} pass
+${dst_ip} X.X.X.X
+${dst_gateway} X.X.X.X
+${dst_host_ip} X.X.X.X
*** Test Cases *** TYPE LISTINDEX
Test Status Subscriber-1
@@ -39,7 +47,7 @@
Subscriber Status Test
[Arguments] ${type} ${listIndex}
Run Keyword If "${type}" == "PUSH" Push MAC and IP For Subscriber ${listIndex}
- Run Keyword If "${type}" == "STATUS" Subscriber Status Check ${listIndex}
+ Run Keyword If "${type}" == "STATUS" Wait Until Keyword Succeeds 60s 5s Subscriber Status Check ${listIndex}
Run Keyword If "${type}" == "STATUSCHANGE" Subscriber Status Change ${listIndex}
Subscriber Status Check
@@ -58,6 +66,7 @@
${Subscriber_Id}= Get From Dictionary ${getJsonDict} id
Set Global Variable ${Subscriber_Id}
Should Be Equal ${status} awaiting_auth
+ Wait Until Keyword Succeeds 300s 5s Test Ping FAIL
#Set Global Variable ${Subscriber_Id}
Subscriber Status Change
@@ -65,6 +74,7 @@
${status}= Create Dictionary status=enabled
${api_result_status}= restApi.ApiChameleonPut VOLT_SUBSCRIBER ${status} ${Subscriber_Id}
Should Be True ${api_result_status}
+ Wait Until Keyword Succeeds 300s 5s Test Ping PASS
Push MAC and IP For Subscriber
[Arguments] ${listIndex}