9 [Arguments] ${start} ${stop} ${step}
10 [Documentation] Will find out max switches starting from ${start} till reaching ${stop} and in steps defined by ${step}
11 ${max-switches} Set Variable ${1}
12 ${start} Convert to Integer ${start}
13 ${stop} Convert to Integer ${stop}
14 ${step} Convert to Integer ${step}
15 : FOR ${switches} IN RANGE ${start} ${stop+1} ${step}
16 \ Start Mininet Linear ${switches}
17 \ ${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds 60s 2s
18 \ ... Check Every Switch ${switches}
19 \ Return From Keyword If '${status}' == 'FAIL'
20 \ ${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds 60s 2s
21 \ ... Check Linear Topology ${switches}
22 \ Return From Keyword If '${status}' == 'FAIL'
24 \ ${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds 60s 2s
25 \ ... Check No Switches ${switches}
26 \ Return From Keyword If '${status}' == 'FAIL'
27 \ ${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds 60s 2s
28 \ ... Check No Topology ${switches}
29 \ Return From Keyword If '${status}' == 'FAIL'
30 \ ${max-switches} Convert To String ${switches}
31 [Return] ${max-switches}
34 [Arguments] ${switches}
35 [Documentation] Start mininet linear topology with ${switches} nodes
36 Log Start mininet linear ${switches}
37 ${mininet_conn_id}= Open Connection ${MININET} prompt=${linux_prompt} timeout=${switches*2}
38 Set Suite Variable ${mininet_conn_id}
39 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
40 Write sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${switches} --switch ovsk,protocols=OpenFlow13
45 [Arguments] ${switches}
46 [Documentation] Check all switches and stats in operational inventory
47 : FOR ${switch} IN RANGE 1 ${switches+1}
48 \ ${resp} RequestsLibrary.Get session /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch}
50 \ Should Be Equal As Strings ${resp.status_code} 200
51 \ Should Contain ${resp.content} flow-capable-node-connector-statistics
52 \ Should Contain ${resp.content} flow-table-statistics
55 [Arguments] ${switches}
56 [Documentation] Check Linear topology given ${switches}
57 ${resp} RequestsLibrary.Get session /restconf/operational/network-topology:network-topology/
59 Should Be Equal As Strings ${resp.status_code} 200
60 : FOR ${switch} IN RANGE 1 ${switches+1}
61 \ Should Contain ${resp.content} "node-id":"openflow:${switch}"
62 \ Should Contain ${resp.content} "tp-id":"openflow:${switch}:1"
63 \ Should Contain ${resp.content} "tp-id":"openflow:${switch}:2"
64 \ Should Contain ${resp.content} "source-tp":"openflow:${switch}:2"
65 \ Should Contain ${resp.content} "dest-tp":"openflow:${switch}:2"
66 \ ${edge} Evaluate ${switch}==1 or ${switch}==${switches}
67 \ Run Keyword Unless ${edge} Should Contain ${resp.content} "tp-id":"openflow:${switch}:3"
68 \ Run Keyword Unless ${edge} Should Contain ${resp.content} "source-tp":"openflow:${switch}:3"
69 \ Run Keyword Unless ${edge} Should Contain ${resp.content} "dest-tp":"openflow:${switch}:3"
72 [Arguments] ${switches}
73 [Documentation] Check no switch is in inventory
74 ${resp} RequestsLibrary.Get session /restconf/operational/opendaylight-inventory:nodes
76 Should Be Equal As Strings ${resp.status_code} 200
77 : FOR ${switch} IN RANGE 1 ${switches+1}
78 \ Should Not Contain ${resp.content} openflow:${switch}
81 [Arguments] ${switches}
82 [Documentation] Check no switch is in topology
83 ${resp} RequestsLibrary.Get session /restconf/operational/network-topology:network-topology/
85 Should Be Equal As Strings ${resp.status_code} 200
86 : FOR ${switch} IN RANGE 1 ${switches+1}
87 \ Should Not Contain ${resp.content} openflow:${switch}
90 [Documentation] Stop mininet
92 Switch Connection ${mininet_conn_id}
95 Read Until ${linux_prompt}