33017248ea9784bd71e14adb261da49c02af3b88
[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 Force Tags        exclude
6 Resource          ../../../libraries/VtnMaKeywords.robot
7
8 *** Variables ***
9 ${flowfilterInetdata}    {"index":1,"condition":"cond1","filterType":{"pass":{}},"actions":[{"inet4src":{"address":"10.0.0.1"}},{"inet4dst":{"address":"10.0.0.3"}}]}
10 ${flowfilterInetdropdata}    {"index":1,"condition":"cond1","filterType":{"drop":{}},"actions":[{"inet4src":{"address":"10.0.0.1"}},{"inet4dst":{"address":"10.0.0.3"}}]}
11 ${flowfilterIcmpCodedata}    {"index":2,"condition":"cond1","filterType":{"pass":{}},"actions":[{"icmpcode":{"code":9}}]}
12 ${flowfilterTpsrcTpdstdata}    {"index":3,"condition":"cond1","filterType":{"pass":{}},"actions":[{"tpsrc":{"port":"5"}},{"tpdst":{"port":"10"}}]}
13 ${flowfilterDscpdata}    {"index":6,"condition":"cond1","filterType":{"pass":{}},"actions":[{"dscp": {"dscp": 10}}]}
14 ${macmap_data}    {"machost": [{"address": "0e:d5:e3:40:a3:f0", "vlan": "0"},{"address": "9a:dd:b0:8a:de:2f", "vlan": "0"}]}
15 ${flowfiltervlanpcp}    {"index":7,"condition":"cond1","filterType":{"pass":{}},"actions":[{"inet4src":{"address":"10.0.0.1"}},{"inet4dst":{"address":"10.0.0.3"}},{"icmpcode":{"code":1}},{"vlanpcp":{"priority":3}}]}
16 ${vtn_flowfilterInetdata}    {"index":8,"condition":"cond1","filterType":{"pass":{}},"actions":[{"inet4src":{"address":"10.0.0.1"}},{"inet4dst":{"address":"10.0.0.3"}}]}
17 ${vbr_flowfilterInetdata}    {"index":9,"condition":"cond1","filterType":{"pass":{}},"actions":[{"inet4src":{"address":"10.0.0.1"}},{"inet4dst":{"address":"10.0.0.3"}}]}
18
19 *** Test Cases ***
20 Check if switch1 detected
21     [Documentation]    Check if openflow:1 is detected
22     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
23
24 Check if switch2 detected
25     [Documentation]    Check if openflow:2 is detected
26     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
27
28 Check if switch3 detected
29     [Documentation]    Check if openflow:3 is detected
30     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
31
32 Add a vtn Tenant1
33     [Documentation]    Add a vtn Tenant1
34     Add a vtn    Tenant1    {"idleTimeout": "200","hardTimeout": "600","description": "Virtual Tenant1 for Hackfest network"}
35
36 Add a vBridge vBridge1
37     [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
38     Add a vBridge    Tenant1    vBridge1    {"ageInterval": "300","description": "vBridge1 for Tenant1"}
39
40 Add a interface If1
41     [Documentation]    Add a interface if1 into vBridge vBridge1
42     Add a interface    Tenant1    vBridge1    if1    {"enabled": "true","description": "Interface1 for vBridge1 for Tenant1"}
43
44 Add a interface if2
45     [Documentation]    Add a interface if2 into vBridge vBridge1
46     Add a interface    Tenant1    vBridge1    if2    {"enabled": "true","description": "Interface2 for vBridge1 for Tenant1"}
47
48 Add a portmap for interface if1
49     [Documentation]    Create a portmap on Interface if1 of vBridge1
50     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:02
51     ${port}    Create Dictionary    name=s2-eth1
52     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
53     Add a portmap    Tenant1    vBridge1    if1    ${portmap_data}
54
55 Add a portmap for interface if2
56     [Documentation]    Create a portmap on Interface if2 of vBridge1
57     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:03
58     ${port}    Create Dictionary    name=s3-eth1
59     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
60     Add a portmap    Tenant1    vBridge1    if2    ${portmap_data}
61
62 Ping h1 to h3
63     [Documentation]    Ping h1 to h3, verify no packet loss
64     Mininet Ping Should Succeed    h1    h3
65
66 Add a vBridge vBridge2
67     [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
68     Add a vBridge    Tenant1    vBridge2    {}
69
70 Add a interface If3
71     [Documentation]    Add a interface if3 into vBrdige vBridge1
72     Add a interface    Tenant1    vBridge1    if3    {}
73
74 Add a interface if4
75     [Documentation]    Add a interface if4 into vBrdige vBridge1
76     Add a interface    Tenant1    vBridge1    if4    {}
77
78 Add a portmap for interface if3
79     [Documentation]    Create a portmap on Interface if3 of vBridge1
80     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:02
81     ${port}    Create Dictionary    name=s2-eth2
82     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
83     Add a portmap    Tenant1    vBridge1    if3    ${portmap_data}
84
85 Add a portmap for interface if4
86     [Documentation]    Create a portmap on Interface if4 of vBridge1
87     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:03
88     ${port}    Create Dictionary    name=s3-eth2
89     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
90     Add a portmap    Tenant1    vBridge1    if4    ${portmap_data}
91
92 Ping h2 to h4
93     [Documentation]    Ping h2 to h4, verify no packet loss
94     Mininet Ping Should Succeed    h2    h4
95
96 Add a macmap
97     [Documentation]    Create a macmap on vBridge vBridge1
98     Add a macmap    Tenant1    vBridge1    ${macmap_data}
99
100 Get flow
101     [Documentation]    Get flow of a vtn Tenant1
102     Get flow    Tenant1
103
104 Add a flowcondition cond1
105     [Documentation]    Create a flowcondition cond1
106     ${inet4}=    Create Dictionary    src=10.0.0.1    dst=10.0.0.3
107     ${inetMatch}=    Create Dictionary    inet4=${inet4}
108     ${matchElement}=    Create Dictionary    index=1    inetMatch=${inetMatch}
109     @{matchlist}    Create List    ${matchElement}
110     ${flowcond_data}=    Create Dictionary    name=cond1    match=${matchlist}
111     Add a flowcondition    cond1    ${flowcond_data}
112
113 Add a flowfilter with inet4src and inet4dst
114     [Documentation]    Create a flowfilter with inet4 and Verify ping
115     Add a flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}    ${index}
116     Mininet Ping Should Succeed    h1    h3
117
118 Add a flowfilter with Icmp code
119     [Documentation]    Create a flowfilter with icmp code and Verify ping
120     Update a flowfilter    Tenant1    vBridge1    if1    ${flowfilterIcmpCodedata}    ${index}
121     Mininet Ping Should Succeed    h1    h3
122
123 Add a flowfilter with tpsrc and tpdst
124     [Documentation]    Create a flowfilter with tpsrc and tpdst and Verify ping
125     Update a flowfilter    Tenant1    vBridge1    if1    ${flowfilterTpsrcTpdstdata}    ${index}
126     Mininet Ping Should Succeed    h1    h3
127
128 Add a flowfilter with dscp
129     [Documentation]    Create a flowfilter with dscp and Verify ping
130     Update a flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}    ${index}
131     Mininet Ping Should Succeed    h1    h3
132
133 Verify Flow Entry for Inet Flowfilter
134     [Documentation]    Verify Flow Entry for Inet Flowfilter
135     Verify Flow Entry for Inet Flowfilter
136
137 Add a flowfilter with vlanpcp
138     [Documentation]    Create a flowfilter with vlanpcp and Verify ping
139     Update a flowfilter    Tenant1    vBridge1    if1    ${flowfiltervlanpcp}    ${index}
140     Mininet Ping Should Succeed    h1    h3
141
142 Add a flowfilter_vtn with inet4src and inet4dst
143     [Documentation]    Create a vtn_flowfilter with inet4 and Verify ping
144     Add a flowfilter_vtn    Tenant1    ${vtn_flowfilterInetdata}    ${index}
145     Mininet Ping Should Succeed    h1    h3
146
147 Add a flowfilter_vbr with inet4src and inet4dst
148     [Documentation]    Create a vbr_flowfilter with inet4 and Verify ping
149     Add a flowfilter_vbr    Tenant1    vBridge1    ${vbr_flowfilterInetdata}    ${index}
150     Mininet Ping Should Succeed    h1    h3
151
152 Add a flowfilter with inet4 for drop
153     [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
154     Add a flowfilter for drop    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}    ${index}
155     Mininet Ping Should Not Succeed    h1    h3
156
157 Verify Removed Flow Entry For Inet After Drop Action
158     [Documentation]    Verify no flows between the hosts after drop
159     Verify Removed Flow Entry for Inet Drop Flowfilter
160
161 Delete a flowcondition
162     [Documentation]    Delete a flowcondition
163     Delete a flowcondition    cond1
164
165 Delete a vtn Tenant1
166     [Documentation]    Delete a vtn Tenant1
167     Delete a vtn    Tenant1