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