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