ded18605715be48b3b8f4824c295f3829e8ad6d6
[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 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","protocol":1,"destination-network":"10.0.0.3/32"},"index":"1"}]
9
10 ${flowfilterInetdata}    "vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]
11
12 ${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.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]
13
14 ${flowfilterIcmpCodedata}    "vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]
15
16 ${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"}]
17
18 ${flowfilterDscpdata}   "vtn-flow-filter":[{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action": [{"order": "1","vtn-set-inet-dscp-action": {"dscp":"32"}}],"index":"1"}]
19
20 ${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"}]
21
22 *** Test Cases ***
23 Check if switch1 detected
24     [Documentation]    Check if openflow:1 is detected
25     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
26
27 Check if switch2 detected
28     [Documentation]    Check if openflow:2 is detected
29     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
30
31 Check if switch3 detected
32     [Documentation]    Check if openflow:3 is detected
33     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
34
35 Add a vtn Tenant1
36     [Documentation]    Add a vtn Tenant1
37     Add a vtn    Tenant1
38
39 Add a vBridge vBridge1
40     [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
41     Add a vBridge    Tenant1    vBridge1
42
43 Add a interface If1
44     [Documentation]    Add a interface if1 into vBridge vBridge1
45     Add a interface    Tenant1    vBridge1    if1
46
47 Add a interface if2
48     [Documentation]    Add a interface if2 into vBridge vBridge1
49     Add a interface    Tenant1    vBridge1    if2
50
51 Add a portmap for interface if1
52     [Documentation]    Create a portmap on Interface if1 of vBridge1
53     Add a portmap    Tenant1    vBridge1    if1    openflow:2    s2-eth1
54
55 Add a portmap for interface if2
56     [Documentation]    Create a portmap on Interface if2 of vBridge1
57     Add a portmap    Tenant1    vBridge1    if2    openflow:3    s3-eth1
58
59 Ping h1 to h3
60     [Documentation]    Ping h1 to h3, verify no packet loss
61     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
62
63 Add a vBridge vBridge2
64     [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
65     Add a vBridge    Tenant1    vBridge2
66
67 Add a interface If3
68     [Documentation]    Add a interface if3 into vBrdige vBridge1
69     Add a interface    Tenant1    vBridge1    if3
70
71 Add a interface if4
72     [Documentation]    Add a interface if4 into vBrdige vBridge1
73     Add a interface    Tenant1    vBridge1    if4
74
75 Add a portmap for interface if3
76     [Documentation]    Create a portmap on Interface if3 of vBridge1
77     Add a portmap    Tenant1    vBridge1    if3    openflow:2    s2-eth2
78
79 Add a portmap for interface if4
80     [Documentation]    Create a portmap on Interface if4 of vBridge1
81     Add a portmap    Tenant1    vBridge1    if4    openflow:3    s3-eth2
82
83 Ping h2 to h4
84     [Documentation]    Ping h2 to h4, verify no packet loss
85     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h2    h4
86
87 Add a flowcondition
88     [Documentation]    Create a flowcondition cond_1 using restconfig api
89     Add a flowcondition    cond_1    ${flowconditiondata}
90
91 Add a vtn flowfilter with inet4src and inet4dst
92     [Documentation]    Create a flowfilter with inet4 and Verify ping
93     Add a vtn flowfilter    Tenant1    ${flowfilterInetdata}
94     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
95
96 Verify inet4src and inet4dst of vtn flowfilter
97     [Documentation]    Verify vtn flowfilter actions in Flow Enties for inet4src and inet4dst
98     Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${DUMPFLOWS_OF10}    @{inet_actions}
99
100 Add a vbr flowfilter with inet4src and inet4dst
101     [Documentation]    Create a flowfilter with inet4 and Verify ping
102     Add a vbr flowfilter    Tenant1    vBridge1     ${flowfilterInetdata}
103     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
104
105 Verify inet4src and inet4dst of vbr flowfilter
106     [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
107     Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${DUMPFLOWS_OF10}    @{inet_actions}
108
109 Add a vbrif flowfilter with inet4src and inet4dst
110     [Documentation]    Create a flowfilter with inet4 and Verify ping
111     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}
112     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
113
114 Verify inet4src and inet4dst of vbrif flowfilter
115     [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
116     Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${DUMPFLOWS_OF10}    @{inet_actions}
117
118 Add a vtn flowfilter with Icmp code
119     [Documentation]    Create a flowfilter with icmp code and Verify ping
120     Add a vtn flowfilter    Tenant1    ${flowfilterIcmpCodedata}
121     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
122
123 Verify icmp action for vtn flowfilter
124     [Documentation]    Verify actions in Flow Enties for icmp code and type
125     Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${DUMPFLOWS_OF10}     @{icmp_action}
126
127 Add a vbr flowfilter with Icmp code
128     [Documentation]    Create a flowfilter with icmp code and Verify ping
129     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterIcmpCodedata}
130     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
131
132 Verify icmp action for vbr flowfilter
133     [Documentation]    Verify actions in Flow Enties for icmp code and type
134     Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${DUMPFLOWS_OF10}    @{icmp_action}
135
136 Add a vbrif flowfilter with Icmp code
137     [Documentation]    Create a flowfilter with icmp code and Verify ping
138     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterIcmpCodedata}
139     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
140
141 Verify icmp action for vbrif flowfilter
142     [Documentation]    Verify actions in Flow Enties for icmp code and type
143     Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${DUMPFLOWS_OF10}     @{icmp_action}
144
145 Add a flowfilter with tpsrc and tpdst
146     [Documentation]    Create a flowfilter with tpsrc and tpdst and Verify ping
147     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterTpsrcTpdstdata}
148     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
149
150 Add a vtn flowfilter with dscp
151     [Documentation]    Create a flowfilter with dscp and Verify ping
152     Add a vtn flowfilter    Tenant1    ${flowfilterDscpdata}
153     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
154
155 Verify dscp action for vtn flowfilter
156     [Documentation]    Verify actions in Flow Enties for dscp
157     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions     ${dscp_flow}    ${DUMPFLOWS_OF10}
158
159 Add a vbr flowfilter with dscp
160     [Documentation]    Create a flowfilter with dscp and Verify ping
161     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterDscpdata}
162     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
163
164 Verify dscp action for vbr flowfilter
165     [Documentation]    Verify actions in Flow Enties for dscp
166     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions     ${dscp_flow}    ${DUMPFLOWS_OF10}
167
168 Add a vbrif flowfilter with dscp
169     [Documentation]    Create a flowfilter with dscp and Verify ping
170     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}
171     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
172
173 Verify dscp action for vbrif flowfilter
174     [Documentation]    Verify actions in Flow Enties for dscp
175     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions     ${dscp_flow}    ${DUMPFLOWS_OF10}
176
177 Add a flowfilter with vlanpcp
178     [Documentation]    Create a flowfilter with vlanpcp and Verify ping
179     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfiltervlanpcp}
180     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
181
182 Add a flowfilter with inet4 for drop
183     [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
184     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}
185     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
186
187 Verify Removed Flow Entry For Inet After Drop Action
188     [Documentation]    Verify no flows between the hosts after drop
189     [Tags]    exclude
190     Wait_Until_Keyword_Succeeds    20s    1s    Verify Removed Flow Entry for Inet Drop Flowfilter    @{inet_actions}    ${DUMPFLOWS_OF10}
191
192 Delete a flowcondition
193     [Documentation]    Delete a flowcondition
194     Remove flowcondition    cond_1
195
196 Delete a vtn Tenant1
197     [Documentation]    Delete vtn Tenant1
198     Delete a vtn    Tenant1