Add Tap Device to the bridge in OVS
[integration/test.git] / csit / suites / ovsdb / Southbound_Cluster / 010__Ovsdb_Southbound_Cluster.robot
1 *** Settings ***
2 Documentation     Test suite for Ovsdb Southbound Cluster - Owner failover and recover
3 Suite Setup       Create Controller Sessions
4 Suite Teardown    Delete All Sessions
5 Library           RequestsLibrary
6 Resource          ../../../libraries/ClusterOvsdb.robot
7 Resource          ../../../libraries/ClusterKeywords.robot
8 Variables         ../../../variables/Variables.py
9
10 *** Test Cases ***
11 Create Original Cluster List
12     [Documentation]    Create original cluster list.
13     ${original_cluster_list}    ClusterKeywords.Create Controller Index List
14     Set Suite Variable    ${original_cluster_list}
15     Log    ${original_cluster_list}
16
17 Check Shards Status Before Fail
18     [Documentation]    Check Status for all shards in Ovsdb application.
19     ClusterOvsdb.Check Ovsdb Shards Status    ${original_cluster_list}
20
21 Start OVS Multiple Connections
22     [Documentation]    Connect OVS to all cluster instances.
23     ${ovsdb_uuid}    Ovsdb.Add Multiple Managers to OVS    ${TOOLS_SYSTEM_IP}    ${original_cluster_list}
24     Set Suite Variable    ${ovsdb_uuid}
25
26 Check Entity Owner Status And Find Owner and Candidate Before Fail
27     [Documentation]    Check Entity Owner Status and identify owner and candidate.
28     ${original_owner}    ${original_candidates_list}    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device    ${original_cluster_list}    ovsdb://uuid/${ovsdb_uuid}
29     ${original_candidate}=    Get From List    ${original_candidates_list}    0
30     Set Suite Variable    ${original_owner}
31     Set Suite Variable    ${original_candidate}
32
33 Create Bridge Manually and Verify Before Fail
34     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
35     ClusterOvsdb.Create Sample Bridge Manually And Verify    ${original_cluster_list}
36
37 Add Port Manually and Verify Before Fail
38     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
39     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify    ${original_cluster_list}
40
41 Create Tap Device Before Fail
42     [Documentation]    Create tap devices to add to the bridge in ovs
43     ClusterOvsdb.Create Sample Tap Device
44
45 Add Tap Device Manually and Verify Before Fail
46     [Documentation]    Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
47     ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify    ${original_cluster_list}
48
49 Delete the Bridge Manually and Verify Before Fail
50     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
51     ClusterOvsdb.Delete Sample Bridge Manually And Verify    ${original_cluster_list}
52
53 Create Bridge In Owner and Verify Before Fail
54     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
55     ClusterOvsdb.Create Sample Bridge And Verify    ${original_cluster_list}    ${original_owner}
56
57 Create Port In Owner and Verify Before Fail
58     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
59     ClusterOvsdb.Create Sample Port And Verify    ${original_cluster_list}    ${original_owner}
60
61 Modify the destination IP of Port In Owner Before Fail
62     [Documentation]    Modify the dst ip of existing port in Owner.
63     ClusterOvsdb.Modify the destination IP of Sample Port    ${original_cluster_list}    ${original_owner}
64
65 Verify Port Is Modified Before Fail
66     [Documentation]    Verify port is modified in all instances.
67     ClusterOvsdb.Verify Sample Port Is Modified    ${original_cluster_list}
68
69 Delete Port In Owner Before Fail
70     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
71     ClusterOvsdb.Delete Sample Port And Verify    ${original_cluster_list}    ${original_owner}
72
73 Delete Bridge In Owner And Verify Before Fail
74     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
75     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_cluster_list}    ${original_owner}
76
77 Kill Owner Instance
78     [Documentation]    Kill Owner Instance and verify it is dead
79     ClusterKeywords.Kill Multiple Controllers    ${original_owner}
80     ${new_cluster_list}    ClusterKeywords.Create Controller Index List
81     Remove Values From List    ${new_cluster_list}    ${original_owner}
82     Set Suite Variable    ${new_cluster_list}
83
84 Check Shards Status After Fail
85     [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
86     ClusterOvsdb.Check Ovsdb Shards Status After Cluster Event    ${new_cluster_list}
87
88 Check Entity Owner Status And Find Owner and Candidate After Fail
89     [Documentation]    Check Entity Owner Status and identify owner and candidate.
90     ${new_owner}    ${new_candidates_list}    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device    ${new_cluster_list}    ovsdb://uuid/${ovsdb_uuid}
91     Run Keyword And Continue On Failure    List Should Not Contain Value    ${new_candidates_list}    ${original_owner}    Original owner ${original_owner} still in candidate list.
92     Remove Values From List    ${new_candidates_list}    ${original_owner}
93     ${new_candidate}=    Get From List    ${new_candidates_list}    0
94     Set Suite Variable    ${new_owner}
95     Set Suite Variable    ${new_candidate}
96
97 Create Bridge Manually and Verify After Fail
98     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
99     ClusterOvsdb.Create Sample Bridge Manually And Verify    ${new_cluster_list}
100
101 Add Port Manually and Verify After Fail
102     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
103     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify    ${new_cluster_list}
104
105 Create Tap Device After Fail
106     [Documentation]    Create tap devices to add to the bridge in ovs
107     ClusterOvsdb.Create Sample Tap Device
108
109 Add Tap Device Manually and Verify After Fail
110     [Documentation]    Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
111     ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify    ${new_cluster_list}
112
113 Delete the Bridge Manually and Verify After Fail
114     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
115     ClusterOvsdb.Delete Sample Bridge Manually And Verify    ${new_cluster_list}
116
117 Create Bridge In Owner and Verify After Fail
118     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
119     ClusterOvsdb.Create Sample Bridge And Verify    ${new_cluster_list}    ${new_owner}
120
121 Create Port In Owner and Verify After Fail
122     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
123     ClusterOvsdb.Create Sample Port And Verify    ${new_cluster_list}    ${new_owner}
124
125 Modify the destination IP of Port In Owner After Fail
126     [Documentation]    Modify the dst ip of existing port in Owner.
127     ClusterOvsdb.Modify the destination IP of Sample Port    ${new_cluster_list}    ${new_owner}
128
129 Verify Port Is Modified After Fail
130     [Documentation]    Verify port is modified in all instances.
131     ClusterOvsdb.Verify Sample Port Is Modified    ${new_cluster_list}
132
133 Start Old Owner Instance
134     [Documentation]    Start Owner Instance and verify it is active
135     ClusterKeywords.Start Multiple Controllers    300s    ${original_owner}
136
137 Check Shards Status After Recover
138     [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
139     ClusterOvsdb.Check Ovsdb Shards Status After Cluster Event    ${original_cluster_list}
140
141 Check Entity Owner Status After Recover
142     [Documentation]    Check Entity Owner Status and identify owner and candidate.
143     ${new_owner}    ${new_candidates_list}    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device    ${original_cluster_list}    ovsdb://uuid/${ovsdb_uuid}
144     Set Suite Variable    ${new_owner}
145
146 Create Bridge Manually and Verify After Recover
147     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
148     ClusterOvsdb.Create Sample Bridge Manually And Verify    ${original_cluster_list}
149
150 Add Port Manually and Verify After Recover
151     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
152     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify    ${original_cluster_list}
153
154 Create Tap Device After Recover
155     [Documentation]    Create tap devices to add to the bridge in ovs
156     ClusterOvsdb.Create Sample Tap Device
157
158 Add Tap Device Manually and Verify After Recover
159     [Documentation]    Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
160     ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify    ${original_cluster_list}
161
162 Delete the Bridge Manually and Verify After Recover
163     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
164     ClusterOvsdb.Delete Sample Bridge Manually And Verify    ${original_cluster_list}
165
166 Verify Modified Port After Recover
167     [Documentation]    Verify modified port exists in all instances.
168     ClusterOvsdb.Verify Sample Port Is Modified    ${original_cluster_list}
169
170 Delete Port In New Owner After Recover
171     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
172     ClusterOvsdb.Delete Sample Port And Verify    ${original_cluster_list}    ${new_owner}
173
174 Delete Bridge In New Owner And Verify After Recover
175     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
176     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_cluster_list}    ${new_owner}
177
178 Create Bridge In Old Owner and Verify After Recover
179     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
180     ClusterOvsdb.Create Sample Bridge And Verify    ${original_cluster_list}    ${original_owner}
181
182 Create Port In Old Owner and Verify After Recover
183     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
184     ClusterOvsdb.Create Sample Port And Verify    ${original_cluster_list}    ${original_owner}
185
186 Modify the destination IP of Port In Old Owner After Recover
187     [Documentation]    Modify the dst ip of existing port in Owner.
188     ClusterOvsdb.Modify the destination IP of Sample Port    ${original_cluster_list}    ${original_owner}
189
190 Verify Port Is Modified After Recover
191     [Documentation]    Verify port is modified in all instances.
192     ClusterOvsdb.Verify Sample Port Is Modified    ${original_cluster_list}
193
194 Delete Port In Old Owner After Recover
195     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
196     ClusterOvsdb.Delete Sample Port And Verify    ${original_cluster_list}    ${original_owner}
197
198 Delete Bridge In Old Owner And Verify After Recover
199     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
200     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_cluster_list}    ${original_owner}
201
202 Cleans Up Test Environment For Next Suite
203     [Documentation]    Cleans up test environment, close existing sessions in teardown.
204     ClusterOvsdb.Configure Exit OVSDB Connection    ${original_cluster_list}