Update Robot Framework format - step 12
[integration/test.git] / csit / suites / openflowplugin / Clustering / 020__Cluster_HA_Owner_Restart.robot
1 *** Settings ***
2 Documentation       Test suite for Cluster HA - Device Owner Stop and Start
3
4 Library             RequestsLibrary
5 Resource            ../../../libraries/SetupUtils.robot
6 Resource            ../../../libraries/ClusterOpenFlow.robot
7 Resource            ../../../libraries/MininetKeywords.robot
8 Resource            ../../../libraries/ClusterManagement.robot
9 Variables           ../../../variables/Variables.py
10
11 Suite Setup         SetupUtils.Setup_Utils_For_Setup_And_Teardown
12 Suite Teardown      Delete All Sessions
13
14
15 *** Test Cases ***
16 Check Shards Status Before Stop
17     [Documentation]    Check Status for all shards in OpenFlow application.
18     ClusterOpenFlow.Check OpenFlow Shards Status
19
20 Start Mininet Multiple Connections
21     [Documentation]    Start mininet tree,2 with connection to all cluster instances.
22     ${mininet_conn_id}=    MininetKeywords.Start Mininet Multiple Controllers
23     ...    ${TOOLS_SYSTEM_IP}
24     ...    ${ClusterManagement__member_index_list}
25     ...    --topo tree,2
26     BuiltIn.Set Suite Variable    ${mininet_conn_id}
27     BuiltIn.Wait Until Keyword Succeeds    10s    1s    OVSDB.Check OVS OpenFlow Connections    ${TOOLS_SYSTEM_IP}    9
28
29 Check Entity Owner Status And Find Owner and Successor Before Stop
30     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
31     ${original_owner}    ${original_successor_list}=    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device
32     ...    openflow:1
33     ...    1
34     ${original_successor}=    Collections.Get From List    ${original_successor_list}    0
35     BuiltIn.Set Suite Variable    ${original_owner}
36     BuiltIn.Set Suite Variable    ${original_successor_list}
37     BuiltIn.Set Suite Variable    ${original_successor}
38
39 Reconnect Extra Switches To Successors And Check OVS Connections
40     [Documentation]    Connect switches s2 and s3 to successor instances.
41     ${controller_opt}=    BuiltIn.Set Variable
42     FOR    ${index}    IN    @{original_successor_list}
43         ${controller_opt}=    BuiltIn.Catenate
44         ...    ${controller_opt}
45         ...    ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ODL_OF_PORT}
46         Log    ${controller_opt}
47     END
48     OVSDB.Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    s2    ${controller_opt}
49     OVSDB.Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    s3    ${controller_opt}
50     BuiltIn.Wait Until Keyword Succeeds    10s    1s    OVSDB.Check OVS OpenFlow Connections    ${TOOLS_SYSTEM_IP}    7
51
52 Check Network Operational Information Before Stop
53     [Documentation]    Check devices in operational inventory and topology in all cluster instances.
54     ClusterOpenFlow.Check OpenFlow Network Operational Information For Sample Topology
55
56 Add Configuration In Owner and Verify Before Stop
57     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
58     ClusterOpenFlow.Add Sample Flow and Verify    ${original_owner}
59
60 Modify Configuration In Owner and Verify Before Stop
61     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
62     ClusterOpenFlow.Modify Sample Flow and Verify    ${original_owner}
63
64 Delete Configuration In Owner and Verify Before Stop
65     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
66     ClusterOpenFlow.Delete Sample Flow and Verify    ${original_owner}
67
68 Add Configuration In Successor and Verify Before Stop
69     [Documentation]    Add Flow in Successor and verify it gets applied from all instances.
70     ClusterOpenFlow.Add Sample Flow and Verify    ${original_successor}
71
72 Modify Configuration In Successor and Verify Before Stop
73     [Documentation]    Modify Flow in successor and verify it gets applied from all instances.
74     ClusterOpenFlow.Modify Sample Flow and Verify    ${original_successor}
75
76 Delete Configuration In Successor and Verify Before Stop
77     [Documentation]    Delete Flow in Successor and verify it gets removed from all instances.
78     ClusterOpenFlow.Delete Sample Flow and Verify    ${original_successor}
79
80 Send RPC Add to Owner and Verify Before Stop
81     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
82     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${original_owner}
83
84 Send RPC Delete to Owner and Verify Before Stop
85     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
86     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${original_owner}
87
88 Send RPC Add to Successor and Verify Before Stop
89     [Documentation]    Add Flow in Successor and verify it gets applied from all instances.
90     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${original_successor}
91
92 Send RPC Delete to Successor and Verify Before Stop
93     [Documentation]    Delete Flow in Successor and verify it gets removed from all instances.
94     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${original_successor}
95
96 Modify Network And Verify Before Stop
97     [Documentation]    Take a link down and verify port status in all instances.
98     ClusterOpenFlow.Take OpenFlow Device Link Down and Verify
99
100 Restore Network And Verify Before Stop
101     [Documentation]    Take the link up and verify port status in all instances.
102     ClusterOpenFlow.Take OpenFlow Device Link Up and Verify
103
104 Stop Owner Instance
105     [Documentation]    Stop Owner Instance and verify it is dead
106     ClusterManagement.Stop Single Member    ${original_owner}
107     BuiltIn.Set Suite Variable    ${new_cluster_list}    ${original_successor_list}
108
109 Check Shards Status After Stop
110     [Documentation]    Create original cluster list and check Status for all shards in OpenFlow application.
111     ClusterOpenFlow.Check OpenFlow Shards Status After Cluster Event    ${new_cluster_list}
112
113 Check Entity Owner Status And Find Owner and Successor After Stop
114     [Documentation]    Check Entity Owner Status and identify owner and successor.
115     ${new_owner}    ${new_successor_list}=    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device
116     ...    openflow:1
117     ...    ${original_successor}
118     ...    ${new_cluster_list}
119     ...    after_stop=True
120     ${new_successor}=    Collections.Get From List    ${new_successor_list}    0
121     BuiltIn.Set Suite Variable    ${new_owner}
122     BuiltIn.Set Suite Variable    ${new_successor}
123
124 Check Network Operational Information After Stop
125     [Documentation]    Check devices in operational inventory and topology in all cluster instances.
126     ClusterOpenFlow.Check OpenFlow Network Operational Information For Sample Topology    ${new_cluster_list}
127
128 Add Configuration In Owner and Verify After Stop
129     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
130     ClusterOpenFlow.Add Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
131
132 Modify Configuration In Owner and Verify After Stop
133     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
134     ClusterOpenFlow.Modify Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
135
136 Delete Configuration In Owner and Verify After Stop
137     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
138     ClusterOpenFlow.Delete Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
139
140 Add Configuration In Successor and Verify After Stop
141     [Documentation]    Add Flow in Successor and verify it gets applied from all instances.
142     ClusterOpenFlow.Add Sample Flow and Verify    ${new_successor}    ${new_cluster_list}
143
144 Modify Configuration In Successor and Verify After Stop
145     [Documentation]    Modify Flow in Successor and verify it gets applied from all instances.
146     ClusterOpenFlow.Modify Sample Flow and Verify    ${new_successor}    ${new_cluster_list}
147
148 Delete Configuration In Successor and Verify After Stop
149     [Documentation]    Delete Flow in Successor and verify it gets applied from all instances.
150     ClusterOpenFlow.Delete Sample Flow and Verify    ${new_successor}    ${new_cluster_list}
151
152 Send RPC Add to Owner and Verify After Stop
153     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
154     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
155
156 Send RPC Delete to Owner and Verify After Stop
157     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
158     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
159
160 Send RPC Add to Successor and Verify After Stop
161     [Documentation]    Add Flow in Successor and verify it gets applied from all instances.
162     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${new_successor}    ${new_cluster_list}
163
164 Send RPC Delete to Successor and Verify After Stop
165     [Documentation]    Delete Flow in Successor and verify it gets removed from all instances.
166     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${new_successor}    ${new_cluster_list}
167
168 Modify Network and Verify After Stop
169     [Documentation]    Take a link down and verify port status in all instances.
170     ClusterOpenFlow.Take OpenFlow Device Link Down and Verify    ${new_cluster_list}
171
172 Restore Network and Verify After Stop
173     [Documentation]    Take the link up and verify port status in all instances.
174     ClusterOpenFlow.Take OpenFlow Device Link Up and Verify    ${new_cluster_list}
175
176 Start Old Owner Instance
177     [Documentation]    Start old Owner Instance and verify it is up
178     ClusterManagement.Start Single Member    ${original_owner}
179
180 Check Shards Status After Start
181     [Documentation]    Create original cluster list and check Status for all shards in OpenFlow application.
182     ClusterOpenFlow.Check OpenFlow Shards Status After Cluster Event
183
184 Check Entity Owner Status After Start
185     [Documentation]    Check Entity Owner Status and identify owner and successor.
186     ${new_owner}    ${new_successors_list}=    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device
187     ...    openflow:1
188     ...    1
189     BuiltIn.Set Suite Variable    ${new_owner}
190
191 Check Network Operational Information After Start
192     [Documentation]    Check devices in operational inventory and topology in all cluster instances.
193     ClusterOpenFlow.Check OpenFlow Network Operational Information For Sample Topology
194
195 Add Configuration In Owner and Verify After Start
196     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
197     ClusterOpenFlow.Add Sample Flow and Verify    ${new_owner}
198
199 Modify Configuration In Owner and Verify After Start
200     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
201     ClusterOpenFlow.Modify Sample Flow and Verify    ${new_owner}
202
203 Delete Configuration In Owner and Verify After Start
204     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
205     ClusterOpenFlow.Delete Sample Flow and Verify    ${new_owner}
206
207 Add Configuration In Old Owner and Verify After Start
208     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
209     ClusterOpenFlow.Add Sample Flow and Verify    ${original_owner}
210
211 Modify Configuration In Old Owner and Verify After Start
212     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
213     ClusterOpenFlow.Modify Sample Flow and Verify    ${original_owner}
214
215 Delete Configuration In Old Owner and Verify After Start
216     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
217     ClusterOpenFlow.Delete Sample Flow and Verify    ${original_owner}
218
219 Send RPC Add to Owner and Verify After Start
220     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
221     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${new_owner}
222
223 Send RPC Delete to Owner and Verify After Start
224     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
225     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${new_owner}
226
227 Send RPC Add to Old Owner and Verify After Start
228     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
229     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${original_owner}
230
231 Send RPC Delete to Old Owner and Verify After Start
232     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
233     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${original_owner}
234
235 Modify Network and Verify After Start
236     [Documentation]    Take a link down and verify port status in all instances.
237     ClusterOpenFlow.Take OpenFlow Device Link Down and Verify
238
239 Restore Network and Verify After Start
240     [Documentation]    Take the link up and verify port status in all instances.
241     ClusterOpenFlow.Take OpenFlow Device Link Up and Verify
242
243 Stop Mininet and Exit
244     [Documentation]    Stop mininet and exit connection.
245     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
246     Utils.Clean Mininet System
247
248 Check No Network Operational Information
249     [Documentation]    Check device is not in operational inventory or topology in all cluster instances.
250     ClusterOpenFlow.Check No OpenFlow Network Operational Information