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 The installed flow remains in the bridge after the controller failure
24 Given C1 a controller in cluster of two controllers
25 And C2 a controller in cluster of two controllers
26 And both controllers get provisioned on all OVS bridges
27 And a flow is installed in a bridge
37 C1 a controller in cluster of two controllers
38 # Open Connection ${Controller1_IP} prompt=>
39 # Login ${VM USERNAME} ${VM PASSWORD}
40 # Write cd controller-base/opendaylight
41 # Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
42 Open Connection ${HOST}
43 Login ${VM USERNAME} ${VM PASSWORD}
44 ${stdout}= Execute Command sudo ovs-vsctl show
45 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
49 C2 a controller in cluster of two controllers
50 # Open Connection ${Controller2_IP} prompt=>
51 # Login ${VM USERNAME} ${VM PASSWORD}
52 # Write cd controller-base/opendaylight
53 # Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
54 Open Connection ${HOST}
55 Login ${VM USERNAME} ${VM PASSWORD}
56 ${stdout}= Execute Command sudo ovs-vsctl show
57 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3
60 both controllers get provisioned on all OVS bridges
61 Open Connection ${HOST}
62 Login ${VM USERNAME} ${VM PASSWORD}
63 # ${stdout1}= Execute Command sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
64 # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
65 # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
66 ${stdout}= Execute Command sudo ovs-vsctl show
67 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3
68 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3
69 Should Contain ${stdout} Bridge "s1"
70 Should Contain ${stdout} Bridge "s2"
71 Should Contain ${stdout} Bridge "s3"
72 Should Contain X Times ${stdout} is_connected: true 6
73 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s1"
74 Should Contain ${stdout} ${CONTROLLER1}
75 Should Contain ${stdout} ${CONTROLLER2}
76 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s2"
77 Should Contain ${stdout} ${CONTROLLER1}
78 Should Contain ${stdout} ${CONTROLLER2}
79 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s3"
80 Should Contain ${stdout} ${CONTROLLER1}
81 Should Contain ${stdout} ${CONTROLLER2}
84 a flow is installed in a bridge
85 ${node} Create Dictionary type=OF id=${node_id}
86 ${actions} Create List OUTPUT=1
87 ${body} Create Dictionary name=${name} installInHw=true node=${node}
88 ... priority=999 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
89 ${headers} Create Dictionary Content-Type=application/json
90 Create Session session http://${Controller1_IP}:8080 headers=${headers} auth=${auth}
91 ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name} data=${body}
92 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
93 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}
94 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
95 ${result} To JSON ${resp.content}
96 ${content} Get From Dictionary ${result} ${key}
97 List Should Contain Value ${content} ${body}
101 Open Connection ${Controller1_IP} prompt=>
102 Login ${VM USERNAME} ${VM PASSWORD}
103 Write cd controller-base/opendaylight
104 Write sudo ./run.sh -stop
105 Set Selenium Speed ${DELAY2}
106 Open Browser ${LOGIN URL1} ${BROWSER}
107 Maximize Browser Window
108 Set Selenium Speed ${DELAY}
109 Location Should Be ${ERROR URL1}
110 Title Should Be Problem loading page
111 [Teardown] Close Browser
115 Open Connection ${Controller1_IP} prompt=>
116 Login ${VM USERNAME} ${VM PASSWORD}
117 Write cd controller-base/opendaylight
118 Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
123 ${headers} Create Dictionary Content-Type application/json
124 Create Session session http://${Controller1_IP}:8080 headers=${headers} auth=${auth}
125 ${resp} Get session ${REST_CONTEXT_2}
126 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
127 ${result} To JSON ${resp.content}
128 ${content} Get From Dictionary ${result} actions
129 List Should Contain Value ${content} OUTPUT=1
134 ${headers} Create Dictionary Content-Type application/json
135 Create Session session http://${Controller2_IP}:8080 headers=${headers} auth=${auth}
136 ${resp} Get session ${REST_CONTEXT_2}
137 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
138 ${result} To JSON ${resp.content}
139 ${content} Get From Dictionary ${result} actions
140 List Should Contain Value ${content} OUTPUT=1