X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Fcsit%2Flibraries%2FScalability.txt;h=08029e2d13b5a4570704a3259b52b5dfb75cf163;hb=9837313bc5d261f3baea9e72e6608d260e4ce105;hp=68f18d89c5696ffb95b4cf478135942a116748a0;hpb=b4cbd98741d70883304979dc097494a30b498418;p=integration%2Ftest.git diff --git a/test/csit/libraries/Scalability.txt b/test/csit/libraries/Scalability.txt index 68f18d89c5..08029e2d13 100644 --- a/test/csit/libraries/Scalability.txt +++ b/test/csit/libraries/Scalability.txt @@ -1,5 +1,10 @@ *** Settings *** Library SSHLibrary +Resource Utils.txt +Library String +Library Collections +Variables ../variables/Variables.py +Library RequestsLibrary *** Variables *** ${linux_prompt} > @@ -8,33 +13,121 @@ ${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 60s 2s + \ ${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 60s 2s + \ 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 60s 2s + \ ${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 60s 2s + \ 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} +Find Max Hosts + [Arguments] ${begin} ${stop} ${step} + [Documentation] Will find out max hosts starting from ${begin} till reaching ${stop} and in steps defined by ${step} + ${max-hosts} Set Variable ${0} + ${stop} Convert to Integer ${stop} + ${step} Convert to Integer ${step} + : FOR ${hosts} IN RANGE ${begin} ${stop+1} ${step} + \ Start Mininet With One Switch And ${hosts} hosts + \ ${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds 120s 30s + \ ... Check Every Switch ${1} + \ Exit For Loop If '${status}' == 'FAIL' + \ @{host_list}= Get Mininet Hosts + \ ${status}= Ping All Hosts @{host_list} + \ Exit For Loop If ${status} != ${0} + \ ${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 120s 30s + \ ... Check Number Of Hosts ${hosts} + \ Exit For Loop If '${status}' == 'FAIL' + \ Stop Mininet + \ ${status} ${result} Run Keyword And Ignore Error Check No Switches ${1} + \ Exit For Loop If '${status}' == 'FAIL' + \ ${status} ${result} Run Keyword And Ignore Error Check No Hosts + \ Exit For Loop If '${status}' == 'FAIL' + \ ${max-hosts} Convert To String ${hosts} + [Return] ${max-hosts} + +Get Mininet Hosts + [Documentation] Get all the hosts from mininet + ${host_list}= Create List + Write nodes + ${out}= Read Until mininet> + @{words}= Split String ${out} ${SPACE} + :FOR ${item} IN @{words} + \ ${h}= Get Lines Matching Regexp ${item.rstrip()} .*h[0-9]*s. + \ Run Keyword If '${h}' != '${EMPTY}' Append To List ${host_list} ${h} + [Return] ${host_list} + +Ping All Hosts + [Arguments] @{host_list} + [Documentation] Do one round of ping from one host to all other hosts in mininet + ${source}= Get From List ${host_list} ${0} + : FOR ${h} IN @{host_list} + \ ${status}= Ping Two Hosts ${source} ${h} 1 + \ Exit For Loop If ${status}!=${0} + [Return] ${status} + +Start Mininet With One Switch And ${hosts} hosts + [Documentation] Start mininet with one switch and ${hosts} hosts + Log Starting mininet with one switch and ${hosts} hosts + Log To Console Starting mininet with one switch and ${hosts} hosts + ${mininet_conn_id}= Open Connection ${MININET} prompt=${linux_prompt} timeout=${hosts*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,1,${hosts} --switch ovsk,protocols=OpenFlow13 + Read Until mininet> + +Check Number Of Hosts + [Arguments] ${hosts} + [Documentation] Check number of hosts in inventory + ${resp} RequestsLibrary.Get session ${OPERATIONAL_TOPO_API} + Log Check number of hosts in inventory + Log To Console Check number of hosts in inventory + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Get Count ${resp.content} "node-id":"host: + Should Be Equal As Integers ${count} ${hosts} + +Ping Two Hosts + [Arguments] ${host1} ${host2} ${pingcount}=2 ${connection_index}=${EMPTY} ${connection_alias}=${EMPTY} + [Documentation] Ping between mininet hosts. Must be used only after a mininet session is in place.Returns non zero value if there is 100% packet loss. + Run Keyword If '${connection_index}' != '${EMPTY}' Switch Connection ${connection_index} + Run Keyword If '${connection_alias}' != '${EMPTY}' Switch Connection ${connection_alias} + Write ${host1} ping -c ${pingcount} ${host2} + ${out}= Read Until mininet> + ${ret}= Get Lines Matching Regexp ${out} .*100% packet loss.* + ${len}= Get Length ${ret} + [Return] ${len} + +Check No Hosts + [Documentation] Check if all hosts are deleted from inventory + ${resp} RequestsLibrary.Get session ${OPERATIONAL_TOPO_API} + Log To Console Checking no hosts are present in operational database + Log Checking no hosts are present in operational database + Should Be Equal As Strings ${resp.status_code} 200 + Should Not Contain ${resp.content} "node-id":"host: + 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 +139,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 +148,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}" @@ -71,8 +164,8 @@ Check Linear Topology Check No Switches [Arguments] ${switches} [Documentation] Check no switch is in inventory - ${resp} RequestsLibrary.Get session /restconf/operational/opendaylight-inventory:nodes - Log ${resp.content} + ${resp} RequestsLibrary.Get session ${OPERATIONAL_NODES_API} + 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} @@ -80,17 +173,21 @@ Check No Switches 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} + ${resp} RequestsLibrary.Get session ${OPERATIONAL_TOPO_API} + 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 Read Until ${linux_prompt} Close Connection + +Scalability Suite Teardown + Delete All Sessions + Clean Mininet System \ No newline at end of file