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