Modify flowfilter and pathpolicy robot files for VTN Manager RESTCONF
[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 ${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"}]
9
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
12 ${flowfilterIcmpCodedata}    "vtn-flow-filter":[{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action":[{ "order":"1","vtn-set-icmp-code-action":{"code":"9"}}],"index":"2"}]
13
14 ${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": "3"}]
15
16 ${flowfilterDscpdata}   "vtn-flow-filter":[{"condition": "cond_1","vtn-pass-filter": {},"vtn-flow-action": [{"order": "1","vtn-set-inet-dscp-action": {"dscp":"10"}}],"index":"6"}]
17
18 ${flowfiltervlanpcp}   "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"}},{"order":"3","vtn-set-icmp-code-action":{"code":"1"}},{"order":"4","vtn-set-vlan-pcp-action":{"vlan-pcp":"3"}}],"index":"3"}]
19
20 *** Test Cases ***
21 Check if switch1 detected
22     [Documentation]    Check if openflow:1 is detected
23     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
24
25 Check if switch2 detected
26     [Documentation]    Check if openflow:2 is detected
27     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
28
29 Check if switch3 detected
30     [Documentation]    Check if openflow:3 is detected
31     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
32
33 Add a vtn Tenant1
34     [Documentation]    Add a vtn Tenant1
35     Add a vtn    Tenant1
36
37 Add a vBridge vBridge1
38     [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
39     Add a vBridge    Tenant1    vBridge1
40
41 Add a interface If1
42     [Documentation]    Add a interface if1 into vBridge vBridge1
43     Add a interface    Tenant1    vBridge1    if1
44
45 Add a interface if2
46     [Documentation]    Add a interface if2 into vBridge vBridge1
47     Add a interface    Tenant1    vBridge1    if2
48
49 Add a portmap for interface if1
50     [Documentation]    Create a portmap on Interface if1 of vBridge1
51     Add a portmap    Tenant1    vBridge1    if1    openflow:2    s2-eth1
52
53 Add a portmap for interface if2
54     [Documentation]    Create a portmap on Interface if2 of vBridge1
55     Add a portmap    Tenant1    vBridge1    if2    openflow:3    s3-eth1
56
57 Ping h1 to h3
58     [Documentation]    Ping h1 to h3, verify no packet loss
59     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
60
61 Add a vBridge vBridge2
62     [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
63     Add a vBridge    Tenant1    vBridge2
64
65 Add a interface If3
66     [Documentation]    Add a interface if3 into vBrdige vBridge1
67     Add a interface    Tenant1    vBridge1    if3
68
69 Add a interface if4
70     [Documentation]    Add a interface if4 into vBrdige vBridge1
71     Add a interface    Tenant1    vBridge1    if4
72
73 Add a portmap for interface if3
74     [Documentation]    Create a portmap on Interface if3 of vBridge1
75     Add a portmap    Tenant1    vBridge1    if3    openflow:2    s2-eth2
76
77 Add a portmap for interface if4
78     [Documentation]    Create a portmap on Interface if4 of vBridge1
79     Add a portmap    Tenant1    vBridge1    if4    openflow:3    s3-eth2
80
81 Ping h2 to h4
82     [Documentation]    Ping h2 to h4, verify no packet loss
83     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h2    h4
84
85 Add a flowcondition
86     [Documentation]    Create a flowcondition cond_1 using restconfig api
87     Add a flowcondition    cond_1
88
89 Add a flowfilter with inet4src and inet4dst
90     [Documentation]    Create a flowfilter with inet4 and Verify ping
91     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}
92     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
93
94 Add a flowfilter with Icmp code
95     [Documentation]    Create a flowfilter with icmp code and Verify ping
96     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterIcmpCodedata}
97     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
98
99 Add a flowfilter with tpsrc and tpdst
100     [Documentation]    Create a flowfilter with tpsrc and tpdst and Verify ping
101     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterTpsrcTpdstdata}
102     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
103
104 Add a flowfilter with dscp
105     [Documentation]    Create a flowfilter with dscp and Verify ping
106     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}
107     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
108
109 Verify Flow Entry for Inet Flowfilter
110     [Documentation]    Verify Flow Entry for Inet Flowfilter
111     Verify Flow Entry for Inet Flowfilter
112
113 Add a flowfilter with vlanpcp
114     [Documentation]    Create a flowfilter with vlanpcp and Verify ping
115     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfiltervlanpcp}
116     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
117
118 Add a flowfilter_vtn with inet4src and inet4dst
119     [Documentation]    Create a vtn_flowfilter with inet4 and Verify ping
120     Add a vtn flowfilter    Tenant1    ${flowfilterInetdata}
121     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
122
123 Add a flowfilter_vbr with inet4src and inet4dst
124     [Documentation]    Create a vbr_flowfilter with inet4 and Verify ping
125     Add a vbr flowfilter    Tenant1    vBridge1    ${flowfilterInetdata}
126     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Succeed    h1    h3
127
128 Add a flowfilter with inet4 for drop
129     [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
130     [Tags]    exclude
131     Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}
132     Wait_Until_Keyword_Succeeds    20s   1s    Mininet Ping Should Not Succeed    h1    h3
133
134 Delete a flowcondition
135     [Documentation]    Delete a flowcondition
136     Remove flowcondition    cond_1
137
138 Delete a vtn Tenant1
139     [Documentation]    Delete vtn Tenant1
140     Delete a vtn    Tenant1