Adding verify controller log to scalability test.
[integration/test.git] / test / csit / libraries / Scalability.txt
index 7569550d9ceef6de5a15bf64a77dfbde237a3f57..066a2a70f1db90be6c6ed0e067e3e87d9f4927fd 100644 (file)
@@ -1,5 +1,6 @@
 *** Settings ***
 Library           SSHLibrary
+Resource          Utils.txt
 
 *** Variables ***
 ${linux_prompt}    >
@@ -8,33 +9,35 @@ ${linux_prompt}    >
 Find Max Switches
     [Arguments]    ${start}    ${stop}    ${step}
     [Documentation]    Will find out max switches starting from ${start} till reaching ${stop} and in steps defined by ${step}
-    ${max-switches}    Set Variable    ${1}
+    ${max-switches}    Set Variable    ${0}
     ${start}    Convert to Integer    ${start}
     ${stop}    Convert to Integer    ${stop}
     ${step}    Convert to Integer    ${step}
     : FOR    ${switches}    IN RANGE    ${start}    ${stop+1}    ${step}
     \    Start Mininet Linear    ${switches}
-    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    5s
+    \    ${status}    ${result}    Run Keyword And Ignore Error    Verify Controller Is Not Dead    ${CONTROLLER}
+    \    Exit For Loop If    '${status}' == 'FAIL'
+    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    10s
     \    ...    Check Every Switch    ${switches}
-    \    Return From Keyword If    '${status}' == 'FAIL'
-    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    5s
+    \    Exit For Loop If    '${status}' == 'FAIL'
+    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    10s
     \    ...    Check Linear Topology    ${switches}
-    \    Return From Keyword If    '${status}' == 'FAIL'
+    \    Exit For Loop If    '${status}' == 'FAIL'
     \    Stop Mininet
-    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    5s
+    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    10s
     \    ...    Check No Switches    ${switches}
-    \    Return From Keyword If    '${status}' == 'FAIL'
-    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    5s
+    \    Exit For Loop If    '${status}' == 'FAIL'
+    \    ${status}    ${result}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    ${switches*2}    10s
     \    ...    Check No Topology    ${switches}
-    \    Return From Keyword If    '${status}' == 'FAIL'
+    \    Exit For Loop If    '${status}' == 'FAIL'
     \    ${max-switches}    Convert To String    ${switches}
     [Return]    ${max-switches}
 
 Start Mininet Linear
     [Arguments]    ${switches}
     [Documentation]    Start mininet linear topology with ${switches} nodes
-    Log    Start mininet linear ${switches}
-    ${mininet_conn_id}=    Open Connection    ${MININET}    prompt=${linux_prompt}    timeout=${switches*2}
+    Log To Console    Starting mininet linear ${switches}
+    ${mininet_conn_id}=    Open Connection    ${MININET}    prompt=${linux_prompt}    timeout=${switches*3}
     Set Suite Variable    ${mininet_conn_id}
     Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
     Write    sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${switches} --switch ovsk,protocols=OpenFlow13
@@ -46,7 +49,7 @@ Check Every Switch
     [Documentation]    Check all switches and stats in operational inventory
     : FOR    ${switch}    IN RANGE    1    ${switches+1}
     \    ${resp}    RequestsLibrary.Get    session    /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch}
-    \    Log    ${resp.content}
+    \    Log To Console    Checking Switch ${switch}
     \    Should Be Equal As Strings    ${resp.status_code}    200
     \    Should Contain    ${resp.content}    flow-capable-node-connector-statistics
     \    Should Contain    ${resp.content}    flow-table-statistics
@@ -55,7 +58,7 @@ Check Linear Topology
     [Arguments]    ${switches}
     [Documentation]    Check Linear topology given ${switches}
     ${resp}    RequestsLibrary.Get    session    /restconf/operational/network-topology:network-topology/
-    Log    ${resp.content}
+    Log To Console    Checking Topology
     Should Be Equal As Strings    ${resp.status_code}    200
     : FOR    ${switch}    IN RANGE    1    ${switches+1}
     \    Should Contain    ${resp.content}    "node-id":"openflow:${switch}"
@@ -72,7 +75,7 @@ Check No Switches
     [Arguments]    ${switches}
     [Documentation]    Check no switch is in inventory
     ${resp}    RequestsLibrary.Get    session    /restconf/operational/opendaylight-inventory:nodes
-    Log    ${resp.content}
+    Log To Console    Checking No Switches
     Should Be Equal As Strings    ${resp.status_code}    200
     : FOR    ${switch}    IN RANGE    1    ${switches+1}
     \    Should Not Contain    ${resp.content}    openflow:${switch}
@@ -81,14 +84,14 @@ Check No Topology
     [Arguments]    ${switches}
     [Documentation]    Check no switch is in topology
     ${resp}    RequestsLibrary.Get    session    /restconf/operational/network-topology:network-topology/
-    Log    ${resp.content}
+    Log To Console    Checking No Topology
     Should Be Equal As Strings    ${resp.status_code}    200
     : FOR    ${switch}    IN RANGE    1    ${switches+1}
     \    Should Not Contain    ${resp.content}    openflow:${switch}
 
 Stop Mininet
     [Documentation]    Stop mininet
-    Log    Stop Mininet
+    Log To Console    Stopping Mininet
     Switch Connection    ${mininet_conn_id}
     Read
     Write    exit