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