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