Update Robot Framework format - step 16
[integration/test.git] / csit / suites / vtn / VTN_Mgr_OF10 / 010__vtn_manager_flowfilter_out.robot
1 *** Settings ***
2 Documentation       Test suite for VTN Manager using OF10
3
4 Resource            ../../../libraries/VtnMaKeywords.robot
5
6 Suite Setup         Start SuiteVtnMaTest
7 Suite Teardown      Stop SuiteVtnMaTest
8
9
10 *** Variables ***
11 ${flowconditiondata}
12 ...                             "vtn-flow-match":[{"vtn-inet-match":{"source-network":"10.0.0.3/32","destination-network":"10.0.0.1/32"},"index":"1"}]
13 ${flowfilterInetdata}
14 ...                             "output": "true", "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"}]
15 ${flowfilterInetdropdata}
16 ...                             "output": "true", "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"}]
17 ${flowfilterIcmpCodedata}
18 ...                             "output": "true", "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"}}]}]
19 ${flowfilterTpsrcTpdstdata}
20 ...                             "output": "true", "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"}]
21 ${flowfilterDscpdata}
22 ...                             "output": "true", "vtn-flow-filter":[{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action": [{"order": "1","vtn-set-inet-dscp-action": {"dscp":"32"}}],"index":"1"}]
23 ${flowfiltervlanpcp}
24 ...                             "output": "true", "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"}]
25
26
27 *** Test Cases ***
28 Check if switch1 detected
29     [Documentation]    Check if openflow:1 is detected
30     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
31
32 Check if switch2 detected
33     [Documentation]    Check if openflow:2 is detected
34     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
35
36 Check if switch3 detected
37     [Documentation]    Check if openflow:3 is detected
38     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
39
40 Add a vtn Tenant1
41     [Documentation]    Add a vtn Tenant1
42     Add a vtn    Tenant1
43
44 Add a vBridge vBridge1
45     [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
46     Add a vBridge    Tenant1    vBridge1
47
48 Add a interface If1
49     [Documentation]    Add a interface if1 into vBridge vBridge1
50     Add a interface    Tenant1    vBridge1    if1
51
52 Add a interface if2
53     [Documentation]    Add a interface if2 into vBridge vBridge1
54     Add a interface    Tenant1    vBridge1    if2
55
56 Add a portmap for interface if1
57     [Documentation]    Create a portmap on Interface if1 of vBridge1
58     Add a portmap    Tenant1    vBridge1    if1    openflow:2    s2-eth1
59
60 Add a portmap for interface if2
61     [Documentation]    Create a portmap on Interface if2 of vBridge1
62     Add a portmap    Tenant1    vBridge1    if2    openflow:3    s3-eth1
63
64 Ping h1 to h3
65     [Documentation]    Ping h1 to h3, verify no packet loss
66     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
67
68 Add a vBridge vBridge2
69     [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
70     Add a vBridge    Tenant1    vBridge2
71
72 Add a interface If3
73     [Documentation]    Add a interface if3 into vBrdige vBridge2
74     Add a interface    Tenant1    vBridge2    if3
75
76 Add a interface if4
77     [Documentation]    Add a interface if4 into vBrdige vBridge2
78     Add a interface    Tenant1    vBridge2    if4
79
80 Add a portmap for interface if3
81     [Documentation]    Create a portmap on Interface if3 of vBridge2
82     Add a portmap    Tenant1    vBridge2    if3    openflow:2    s2-eth2
83
84 Add a portmap for interface if4
85     [Documentation]    Create a portmap on Interface if4 of vBridge2
86     Add a portmap    Tenant1    vBridge2    if4    openflow:3    s3-eth2
87
88 Ping h2 to h4
89     [Documentation]    Ping h2 to h4, verify no packet loss
90     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h2    h4
91
92 Add a flowcondition
93     [Documentation]    Create a flowcondition cond_1 using restconfig api
94     Add a flowcondition    cond_1    ${flowconditiondata}
95
96 Add a vbrif flowfilter with inet4src and inet4dst
97     [Documentation]    Create a flowfilter with inet4 and Verify ping
98     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}
99     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
100
101 Verify inet4src and inet4dst of vbrif flowfilter
102     [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
103     Wait_Until_Keyword_Succeeds
104     ...    20s
105     ...    1s
106     ...    Verify Flow Entries for Flowfilter
107     ...    ${FF_OUT_DUMPFLOWS_OF10}
108     ...    @{inet_actions}
109
110 Remove vbrif Flowfilter index
111     [Documentation]    Remove a index of vbrif flowfilter
112     Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
113
114 Add a vbrif flowfilter with dscp
115     [Documentation]    Create a flowfilter with dscp and Verify ping
116     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}
117     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
118
119 Verify dscp action for vbrif flowfilter
120     [Documentation]    Verify actions in Flow Enties for dscp
121     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dscp_flow}    ${FF_OUT_DUMPFLOWS_OF10}
122
123 Remove vbrif Flowfilter index which have dscp
124     [Documentation]    Remove a index of vbrif flowfilter which have DSCP
125     Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
126
127 Add a flowfilter with inet4 for drop
128     [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
129     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}
130     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
131
132 Verify Removed Flow Entry For Inet After Drop Action
133     [Documentation]    Verify no flows between the hosts after drop
134     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${drop_action}    ${DROP_OUT_DUMPFLOWS_OF10}
135
136 Delete a flowcondition
137     [Documentation]    Delete a flowcondition
138     Remove flowcondition    cond_1
139
140 Delete a vtn Tenant1
141     [Documentation]    Delete vtn Tenant1
142     Delete a vtn    Tenant1