Update Robot Framework format - step 16
[integration/test.git] / csit / suites / vtn / VTN_Mgr_OF10 / 010__vtn_manager_flowfilter.robot
1 *** Settings ***
2 Documentation       Test suite for VTN Manager using OF10
3
4 Resource            ../../../libraries/VtnMaKeywords.robot
5
6 Suite Setup         Start SuiteVtnMaTest
7 Suite Teardown      Stop SuiteVtnMaTest
8
9
10 *** Variables ***
11 ${flowconditiondata}
12 ...                             "vtn-flow-match":[{"vtn-inet-match":{"source-network":"10.0.0.1/32","destination-network":"10.0.0.3/32"},"index":"1"}]
13 ${flowfilterInetdata}
14 ...                             "vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"192.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"192.0.0.2/32"}}],"index": "1"}]
15 ${flowfilterInetdropdata}
16 ...                             "vtn-flow-filter":[{"condition":"cond_1","vtn-drop-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.2/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.4/32"}}],"index": "1"}]
17 ${flowfilterIcmpCodedata}
18 ...                             "vtn-flow-filter": [{"condition": "cond_1","index": "1", "vtn-pass-filter": {}, "vtn-flow-action": [{ "order": "1", "vtn-set-icmp-code-action":{"code": "1"}},{"order": "2","vtn-set-icmp-type-action": {"type": "3"}}]}]
19 ${flowfilterTpsrcTpdstdata}
20 ...                             "vtn-flow-filter": [{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action": [{"order": "1","vtn-set-port-src-action": {"port": "5"}},{"order": "2","vtn-set-port-dst-action": {"port": "10"}}],"index": "1"}]
21 ${flowfilterDscpdata}
22 ...                             "vtn-flow-filter":[{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action": [{"order": "1","vtn-set-inet-dscp-action": {"dscp":"32"}}],"index":"1"}]
23 ${flowfilterdlsrc}
24 ...                             "vtn-flow-filter":[{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action": [{"order": "1","vtn-set-dl-src-action": {"address":"00:00:00:00:00:11"}}],"index":"1"}]
25 ${flowfiltervlanpcp}
26 ...                             "vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order":"3","vtn-set-icmp-code-action":{"code":"1"}},{"order":"4","vtn-set-vlan-pcp-action":{"vlan-pcp":"3"}}],"index":"1"}]
27
28
29 *** Test Cases ***
30 Check if switch1 detected
31     [Documentation]    Check if openflow:1 is detected
32     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
33
34 Check if switch2 detected
35     [Documentation]    Check if openflow:2 is detected
36     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
37
38 Check if switch3 detected
39     [Documentation]    Check if openflow:3 is detected
40     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
41
42 Add a vtn Tenant1
43     [Documentation]    Add a vtn Tenant1
44     Add a vtn    Tenant1
45
46 Add a vBridge vBridge1
47     [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
48     Add a vBridge    Tenant1    vBridge1
49
50 Add a interface If1
51     [Documentation]    Add a interface if1 into vBridge vBridge1
52     Add a interface    Tenant1    vBridge1    if1
53
54 Add a interface if2
55     [Documentation]    Add a interface if2 into vBridge vBridge1
56     Add a interface    Tenant1    vBridge1    if2
57
58 Add a portmap for interface if1
59     [Documentation]    Create a portmap on Interface if1 of vBridge1
60     Add a portmap    Tenant1    vBridge1    if1    openflow:2    s2-eth1
61
62 Add a portmap for interface if2
63     [Documentation]    Create a portmap on Interface if2 of vBridge1
64     Add a portmap    Tenant1    vBridge1    if2    openflow:3    s3-eth1
65
66 Ping h1 to h3
67     [Documentation]    Ping h1 to h3, verify no packet loss
68     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
69
70 Add a vBridge vBridge2
71     [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
72     Add a vBridge    Tenant1    vBridge2
73
74 Add a interface If3
75     [Documentation]    Add a interface if3 into vBrdige vBridge2
76     Add a interface    Tenant1    vBridge2    if3
77
78 Add a interface if4
79     [Documentation]    Add a interface if4 into vBrdige vBridge2
80     Add a interface    Tenant1    vBridge2    if4
81
82 Add a portmap for interface if3
83     [Documentation]    Create a portmap on Interface if3 of vBridge2
84     Add a portmap    Tenant1    vBridge2    if3    openflow:2    s2-eth2
85
86 Add a portmap for interface if4
87     [Documentation]    Create a portmap on Interface if4 of vBridge2
88     Add a portmap    Tenant1    vBridge2    if4    openflow:3    s3-eth2
89
90 Ping h2 to h4
91     [Documentation]    Ping h2 to h4, verify no packet loss
92     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h2    h4
93
94 Add a flowcondition
95     [Documentation]    Create a flowcondition cond_1 using restconfig api
96     Add a flowcondition    cond_1    ${flowconditiondata}
97
98 Add a vtn flowfilter with inet4src and inet4dst
99     [Documentation]    Create a flowfilter with inet4 and Verify ping
100     Add a vtn flowfilter    Tenant1    ${flowfilterInetdata}
101     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
102
103 Verify inet4src and inet4dst of vtn flowfilter
104     [Documentation]    Verify vtn flowfilter actions in Flow Enties for inet4src and inet4dst
105     Wait_Until_Keyword_Succeeds
106     ...    20s
107     ...    1s
108     ...    Verify Flow Entries for Flowfilter
109     ...    ${FF_DUMPFLOWS_OF10}
110     ...    @{inet_actions}
111
112 Remove vtn Flowfilter index
113     [Documentation]    Remove a index of vtn flowfilter
114     Remove a vtn flowfilter    Tenant1    ${filter_index}
115
116 Add a vbr flowfilter with inet4src and inet4dst
117     [Documentation]    Create a flowfilter with inet4 and Verify ping
118     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterInetdata}
119     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
120
121 Verify inet4src and inet4dst of vbr flowfilter
122     [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
123     Wait_Until_Keyword_Succeeds
124     ...    20s
125     ...    1s
126     ...    Verify Flow Entries for Flowfilter
127     ...    ${FF_DUMPFLOWS_OF10}
128     ...    @{inet_actions}
129
130 Remove vbr Flowfilter index
131     [Documentation]    Remove a index of vbr flowfilter
132     Remove a vbr flowfilter    Tenant1    vBridge1    ${filter_index}
133
134 Add a vbrif flowfilter with inet4src and inet4dst
135     [Documentation]    Create a flowfilter with inet4 and Verify ping
136     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}
137     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
138
139 Verify inet4src and inet4dst of vbrif flowfilter
140     [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
141     Wait_Until_Keyword_Succeeds
142     ...    20s
143     ...    1s
144     ...    Verify Flow Entries for Flowfilter
145     ...    ${FF_DUMPFLOWS_OF10}
146     ...    @{inet_actions}
147
148 Remove vbrif Flowfilter index
149     [Documentation]    Remove a index of vbrif flowfilter
150     Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
151
152 Add a vtn flowfilter with Icmp code
153     [Documentation]    Create a flowfilter with icmp code and Verify ping
154     [Tags]    exclude
155     Add a vtn flowfilter    Tenant1    ${flowfilterIcmpCodedata}
156     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
157
158 Verify icmp action for vtn flowfilter
159     [Documentation]    Verify actions in Flow Enties for icmp code and type
160     [Tags]    exclude
161     Wait_Until_Keyword_Succeeds
162     ...    20s
163     ...    1s
164     ...    Verify Flow Entries for Flowfilter
165     ...    ${FF_DUMPFLOWS_OF10}
166     ...    @{icmp_action}
167
168 Remove vtn Flowfilter index which has ICMP
169     [Documentation]    Remove a index of vtn flowfilter which have ICMP
170     [Tags]    exclude
171     Remove a vtn flowfilter    Tenant1    ${filter_index}
172
173 Add a vbr flowfilter with Icmp code
174     [Documentation]    Create a flowfilter with icmp code and Verify ping
175     [Tags]    exclude
176     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterIcmpCodedata}
177     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
178
179 Verify icmp action for vbr flowfilter
180     [Documentation]    Verify actions in Flow Enties for icmp code and type
181     [Tags]    exclude
182     Wait_Until_Keyword_Succeeds
183     ...    20s
184     ...    1s
185     ...    Verify Flow Entries for Flowfilter
186     ...    ${FF_DUMPFLOWS_OF10}
187     ...    @{icmp_action}
188
189 Remove vbr Flowfilter index which has ICMP
190     [Documentation]    Remove a index of vbr flowfilter which have ICMP
191     [Tags]    exclude
192     Remove a vbr flowfilter    Tenant1    vBridge1    ${filter_index}
193
194 Add a vbrif flowfilter with Icmp code
195     [Documentation]    Create a flowfilter with icmp code and Verify ping
196     [Tags]    exclude
197     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterIcmpCodedata}
198     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
199
200 Verify icmp action for vbrif flowfilter
201     [Documentation]    Verify actions in Flow Enties for icmp code and type
202     [Tags]    exclude
203     Wait_Until_Keyword_Succeeds
204     ...    20s
205     ...    1s
206     ...    Verify Flow Entries for Flowfilter
207     ...    ${FF_DUMPFLOWS_OF10}
208     ...    @{icmp_action}
209
210 Remove vbrif Flowfilter index which has ICMP
211     [Documentation]    Remove a index of vbrif flowfilter which have ICMP
212     [Tags]    exclude
213     Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
214
215 Add a vtn flowfilter with dscp
216     [Documentation]    Create a flowfilter with dscp and Verify ping
217     Add a vtn flowfilter    Tenant1    ${flowfilterDscpdata}
218     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
219
220 Verify dscp action for vtn flowfilter
221     [Documentation]    Verify actions in Flow Enties for dscp
222     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dscp_flow}    ${FF_DUMPFLOWS_OF10}
223
224 Remove vtn Flowfilter index which have dscp
225     [Documentation]    Remove a index of vtn flowfilter which have DSCP
226     Remove a vtn flowfilter    Tenant1    ${filter_index}
227
228 Add a vbr flowfilter with dscp
229     [Documentation]    Create a flowfilter with dscp and Verify ping
230     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterDscpdata}
231     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
232
233 Verify dscp action for vbr flowfilter
234     [Documentation]    Verify actions in Flow Enties for dscp
235     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dscp_flow}    ${FF_DUMPFLOWS_OF10}
236
237 Remove vbr Flowfilter index which have dscp
238     [Documentation]    Remove a index of vbr flowfilter which have DSCP
239     Remove a vbr flowfilter    Tenant1    vBridge1    ${filter_index}
240
241 Add a vbrif flowfilter with dscp
242     [Documentation]    Create a flowfilter with dscp and Verify ping
243     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}
244     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
245
246 Verify dscp action for vbrif flowfilter
247     [Documentation]    Verify actions in Flow Enties for dscp
248     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dscp_flow}    ${FF_DUMPFLOWS_OF10}
249
250 Remove vbrif Flowfilter index which have dscp
251     [Documentation]    Remove a index of vbrif flowfilter which have DSCP
252     Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
253
254 Add a vtn flowfilter with dl-src
255     [Documentation]    Create a flowfilter with dl-src and Verify ping
256     Add a vtn flowfilter    Tenant1    ${flowfilterdlsrc}
257     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
258
259 Verify dl-src action for vtn flowfilter
260     [Documentation]    Verify actions in Flow Enties for dl-src
261     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dlsrc_action}    ${FF_DUMPFLOWS_OF10}
262
263 Remove vtn Flowfilter index which have dl-src
264     [Documentation]    Remove a index of vtn flowfilter which have DL_SRC
265     Remove a vtn flowfilter    Tenant1    ${filter_index}
266
267 Add a vbr flowfilter with dl-src
268     [Documentation]    Create a flowfilter with dl-src and Verify ping
269     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterdlsrc}
270     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
271
272 Verify dl-src action for vbr flowfilter
273     [Documentation]    Verify actions in Flow Enties for dl-src
274     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dlsrc_action}    ${FF_DUMPFLOWS_OF10}
275
276 Remove vbr Flowfilter index which have dl-src
277     [Documentation]    Remove a index of vbr flowfilter which have DL_SRC
278     Remove a vbr flowfilter    Tenant1    vBridge1    ${filter_index}
279
280 Add a vbrif flowfilter with dl-src
281     [Documentation]    Create a flowfilter with dl-src and Verify ping
282     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterdlsrc}
283     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
284
285 Verify dl-src action for vbrif flowfilter
286     [Documentation]    Verify actions in Flow Enties for dl-src
287     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dlsrc_action}    ${FF_DUMPFLOWS_OF10}
288
289 Remove vbrif Flowfilter index which have dl-src
290     [Documentation]    Remove a index of vbrif flowfilter which have DL_SRC
291     Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
292
293 Add a flowfilter with inet4 for drop
294     [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
295     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}
296     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
297
298 Verify Removed Flow Entry For Inet After Drop Action
299     [Documentation]    Verify no flows between the hosts after drop
300     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${drop_action}    ${DROP_DUMPFLOWS_OF10}
301
302 Delete a flowcondition
303     [Documentation]    Delete a flowcondition
304     Remove flowcondition    cond_1
305
306 Delete a vtn Tenant1
307     [Documentation]    Delete vtn Tenant1
308     Delete a vtn    Tenant1