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
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
29 And the system is working with C1
35 Open Connection ${Controller2_IP} prompt=>
36 Login ${VM USERNAME} ${VM PASSWORD}
37 Write cd controller-base/opendaylight
38 Write sudo ./run.sh -stop
39 Set Selenium Speed ${DELAY2}
40 Open Browser ${LOGIN URL2} ${BROWSER}
41 Maximize Browser Window
42 Set Selenium Speed ${DELAY}
43 Location Should Be ${ERROR URL2}
44 Title Should Be Problem loading page
45 [Teardown] Close Browser
48 C1 a controller in cluster of two controllers
49 # Open Connection ${Controller1_IP} prompt=>
50 # Login ${VM USERNAME} ${VM PASSWORD}
51 # Write cd controller-base/opendaylight
52 # Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
53 Open Connection ${HOST}
54 Login ${VM USERNAME} ${VM PASSWORD}
55 ${stdout}= Execute Command sudo ovs-vsctl show
56 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
60 C2 a controller in cluster of two controllers
61 # Open Connection ${Controller2_IP} prompt=>
62 # Login ${VM USERNAME} ${VM PASSWORD}
63 # Write cd controller-base/opendaylight
64 # Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
65 Open Connection ${HOST}
66 Login ${VM USERNAME} ${VM PASSWORD}
67 ${stdout}= Execute Command sudo ovs-vsctl show
68 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3
71 all switches are introduced to both controllers
72 Open Connection ${HOST}
73 Login ${VM USERNAME} ${VM PASSWORD}
74 # ${stdout1}= Execute Command sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
75 # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
76 # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
77 ${stdout}= Execute Command sudo ovs-vsctl show
78 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
79 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3
80 Should Contain ${stdout} Bridge "s1"
81 Should Contain ${stdout} Bridge "s2"
82 Should Contain ${stdout} Bridge "s3"
83 Should Contain X Times ${stdout} is_connected: true 6
84 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s1"
85 Should Contain ${stdout} ${CONTROLLER1}
86 Should Contain ${stdout} ${CONTROLLER2}
87 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s2"
88 Should Contain ${stdout} ${CONTROLLER1}
89 Should Contain ${stdout} ${CONTROLLER2}
90 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s3"
91 Should Contain ${stdout} ${CONTROLLER1}
92 Should Contain ${stdout} ${CONTROLLER2}
95 the system is working with C1
96 ${headers} Create Dictionary Content-Type application/json
97 Create Session session http://${Controller1_IP}:8080 headers=${headers} auth=${auth}
98 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}
99 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
101 Should Contain X Times ${resp.content} ${nodeconn1} 2
102 Should Contain X Times ${resp.content} ${nodeconn2} 2
103 Should Contain X Times ${resp.content} ${nodeconn3} 2
104 Should Contain X Times ${resp.content} ${nodeconn4} 2
108 Open Connection ${HOST}
109 Login ${VM USERNAME} ${VM PASSWORD}
110 ${stdout}= Execute Command sudo ovs-vsctl show
111 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
112 Should Contain X Times ${stdout} is_connected: true 3