2 Documentation ODL controller clustering test case using the gherkin syntax.
4 ... This test has a workflow similar to the keyword-driven
5 ... examples. The difference is that the keywords use higher
6 ... abstraction level and their arguments are embedded into
9 ... This kind of _gherkin_ syntax has been made popular by
10 ... [http://cukes.info|Cucumber]. It works well especially when
11 ... tests act as examples that need to be easily understood also
12 ... by the business people.
14 Library Selenium2Library
17 Library RequestsLibrary
18 Library ../../libraries/Common.py
19 Variables ../../variables/Variables.py
23 Two controllers running
24 Given C1 a controller in cluster of two controllers
25 And C2 a controller in cluster of two controllers
26 And all switches are introduced to both controllers
27 When C1 is up and running
28 And C2 is up and running
29 Then the system is working with C1 and C2
35 Open Browser To Login Page 1
39 Welcome Page 1 Should Be Open
40 [Teardown] Close Browser
43 Open Browser To Login Page 2
47 Welcome Page 2 Should Be Open
48 [Teardown] Close Browser
51 Open Browser To Login Page 1
52 Set Selenium Speed ${DELAY2}
53 Open Browser ${LOGIN URL1} ${BROWSER}
54 Maximize Browser Window
55 Login Page Should Be Open
57 Open Browser To Login Page 2
58 Set Selenium Speed ${DELAY2}
59 Open Browser ${LOGIN URL2} ${BROWSER}
60 Maximize Browser Window
61 Login Page Should Be Open
63 Login Page Should Be Open
64 Title Should Be OpenDaylight - Login
67 [Arguments] ${username}
68 Input Text j_username ${username}
71 [Arguments] ${password}
72 Input Text j_password ${password}
77 Welcome Page 1 Should Be Open
78 Location Should Be ${LOGIN URL1}
79 Title Should Be OpenDaylight
81 Welcome Page 2 Should Be Open
82 Location Should Be ${LOGIN URL2}
83 Title Should Be OpenDaylight
85 C1 a controller in cluster of two controllers
86 Open Connection ${Controller1_IP} prompt=>
87 Login ${VM USERNAME} ${VM PASSWORD}
88 Write cd controller-base/opendaylight
89 Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
90 Open Connection ${HOST}
91 Login ${VM USERNAME} ${VM PASSWORD}
92 ${stdout}= Execute Command sudo ovs-vsctl show
93 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
97 C2 a controller in cluster of two controllers
98 Open Connection ${Controller2_IP} prompt=>
99 Login ${VM USERNAME} ${VM PASSWORD}
100 Write cd controller-base/opendaylight
101 Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
102 Open Connection ${HOST}
103 Login ${VM USERNAME} ${VM PASSWORD}
104 ${stdout}= Execute Command sudo ovs-vsctl show
105 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3
108 all switches are introduced to both controllers
109 Open Connection ${HOST}
110 Login ${VM USERNAME} ${VM PASSWORD}
111 # ${stdout1}= Execute Command sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
112 # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
113 # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
114 ${stdout}= Execute Command sudo ovs-vsctl show
115 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
116 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3
117 Should Contain ${stdout} Bridge "s1"
118 Should Contain ${stdout} Bridge "s2"
119 Should Contain ${stdout} Bridge "s3"
120 Should Contain X Times ${stdout} is_connected: true 6
121 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s1"
122 Should Contain ${stdout} ${CONTROLLER1}
123 Should Contain ${stdout} ${CONTROLLER2}
124 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s2"
125 Should Contain ${stdout} ${CONTROLLER1}
126 Should Contain ${stdout} ${CONTROLLER2}
127 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s3"
128 Should Contain ${stdout} ${CONTROLLER1}
129 Should Contain ${stdout} ${CONTROLLER2}
132 the system is working with C1 and C2
133 ${headers} Create Dictionary Content-Type application/json
134 Create Session session http://${Controller1_IP}:8080 headers=${headers} auth=${auth}
135 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}
136 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
138 Should Contain X Times ${resp.content} ${nodeconn1} 2
139 Should Contain X Times ${resp.content} ${nodeconn2} 2
140 Should Contain X Times ${resp.content} ${nodeconn3} 2
141 Should Contain X Times ${resp.content} ${nodeconn4} 2
143 ${headers} Create Dictionary Content-Type application/json
144 Create Session session http://${Controller2_IP}:8080 headers=${headers} auth=${auth}
145 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}
146 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
148 Should Contain X Times ${resp.content} ${nodeconn1} 2
149 Should Contain X Times ${resp.content} ${nodeconn2} 2
150 Should Contain X Times ${resp.content} ${nodeconn3} 2
151 Should Contain X Times ${resp.content} ${nodeconn4} 2