Add CSIT for VTN Manager flowfilter OUT direction 52/38052/6
authorKarthik.S <siva-karthik@hcl.com>
Mon, 25 Apr 2016 15:25:01 +0000 (20:55 +0530)
committerLuis Gomez <ecelgp@gmail.com>
Fri, 6 May 2016 03:53:36 +0000 (03:53 +0000)
 * Added new test files 010__vtn_manager_flowfilter_out.robot for OF10 and OF13
    for direction "OUT" of flowfilter functionalities.
 * Added test cases for dscp, inet src and inet dst attributes

Change-Id: Ib51e76a26393f63096da8b646e0e397c5154c92d
Signed-off-by: Karthik.S <siva-karthik@hcl.com>
csit/libraries/VtnMaKeywords.robot
csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_flowfilter_out.robot [new file with mode: 0644]
csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_flowfilter_out.robot [new file with mode: 0644]

index 373db05e97014209d20fe2057d137ae80a0c17cb..b4ed02092a093602e54dd48a374a14c33a2f38d1 100644 (file)
@@ -20,6 +20,10 @@ ${FF_DUMPFLOWS_OF10}    sh ovs-ofctl dump-flows -OOpenFlow10 s3
 ${FF_DUMPFLOWS_OF13}    sh ovs-ofctl dump-flows -OOpenFlow13 s3
 ${DROP_DUMPFLOWS_OF10}    sh ovs-ofctl dump-flows -OOpenFlow10 s2
 ${DROP_DUMPFLOWS_OF13}    sh ovs-ofctl dump-flows -OOpenFlow13 s2
+${DROP_OUT_DUMPFLOWS_OF10}    sh ovs-ofctl dump-flows -OOpenFlow10 s3
+${DROP_OUT_DUMPFLOWS_OF13}    sh ovs-ofctl dump-flows -OOpenFlow13 s3
+${FF_OUT_DUMPFLOWS_OF10}    sh ovs-ofctl dump-flows -OOpenFlow10 s2
+${FF_OUT_DUMPFLOWS_OF13}    sh ovs-ofctl dump-flows -OOpenFlow13 s2
 ${index}          7
 @{inet_actions}    mod_nw_src:192.0.0.1    mod_nw_dst:192.0.0.2
 @{BRIDGE1_DATAFLOW}    "reason":"PORTMAPPED"    "tenant-name":"Tenant1"    "bridge-name":"vBridge1"    "interface-name":"if2"
diff --git a/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_flowfilter_out.robot b/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_flowfilter_out.robot
new file mode 100644 (file)
index 0000000..19e1fb9
--- /dev/null
@@ -0,0 +1,126 @@
+*** Settings ***
+Documentation     Test suite for VTN Manager using OF10
+Suite Setup       Start SuiteVtnMaTest
+Suite Teardown    Stop SuiteVtnMaTest
+Resource          ../../../libraries/VtnMaKeywords.robot
+
+*** Variables ***
+${flowconditiondata}    "vtn-flow-match":[{"vtn-inet-match":{"source-network":"10.0.0.3/32","destination-network":"10.0.0.1/32"},"index":"1"}]
+${flowfilterInetdata}    "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"}]
+${flowfilterInetdropdata}   "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"}]
+${flowfilterIcmpCodedata}   "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"}}]}]
+${flowfilterTpsrcTpdstdata}   "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"}]
+${flowfilterDscpdata}   "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"}]
+${flowfiltervlanpcp}   "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"}]
+
+*** Test Cases ***
+Check if switch1 detected
+    [Documentation]    Check if openflow:1 is detected
+    BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
+
+Check if switch2 detected
+    [Documentation]    Check if openflow:2 is detected
+    BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
+
+Check if switch3 detected
+    [Documentation]    Check if openflow:3 is detected
+    BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
+
+Add a vtn Tenant1
+    [Documentation]    Add a vtn Tenant1
+    Add a vtn    Tenant1
+
+Add a vBridge vBridge1
+    [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge1
+
+Add a interface If1
+    [Documentation]    Add a interface if1 into vBridge vBridge1
+    Add a interface    Tenant1    vBridge1    if1
+
+Add a interface if2
+    [Documentation]    Add a interface if2 into vBridge vBridge1
+    Add a interface    Tenant1    vBridge1    if2
+
+Add a portmap for interface if1
+    [Documentation]    Create a portmap on Interface if1 of vBridge1
+    Add a portmap    Tenant1    vBridge1    if1    openflow:2    s2-eth1
+
+Add a portmap for interface if2
+    [Documentation]    Create a portmap on Interface if2 of vBridge1
+    Add a portmap    Tenant1    vBridge1    if2    openflow:3    s3-eth1
+
+Ping h1 to h3
+    [Documentation]    Ping h1 to h3, verify no packet loss
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
+
+Add a vBridge vBridge2
+    [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge2
+
+Add a interface If3
+    [Documentation]    Add a interface if3 into vBrdige vBridge2
+    Add a interface    Tenant1    vBridge2    if3
+
+Add a interface if4
+    [Documentation]    Add a interface if4 into vBrdige vBridge2
+    Add a interface    Tenant1    vBridge2    if4
+
+Add a portmap for interface if3
+    [Documentation]    Create a portmap on Interface if3 of vBridge2
+    Add a portmap    Tenant1    vBridge2    if3    openflow:2    s2-eth2
+
+Add a portmap for interface if4
+    [Documentation]    Create a portmap on Interface if4 of vBridge2
+    Add a portmap    Tenant1    vBridge2    if4    openflow:3    s3-eth2
+
+Ping h2 to h4
+    [Documentation]    Ping h2 to h4, verify no packet loss
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h2    h4
+
+Add a flowcondition
+    [Documentation]    Create a flowcondition cond_1 using restconfig api
+    Add a flowcondition    cond_1    ${flowconditiondata}
+
+Add a vbrif flowfilter with inet4src and inet4dst
+    [Documentation]    Create a flowfilter with inet4 and Verify ping
+    Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
+
+Verify inet4src and inet4dst of vbrif flowfilter
+    [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
+    Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${FF_OUT_DUMPFLOWS_OF10}    @{inet_actions}
+
+Remove vbrif Flowfilter index
+    [Documentation]    Remove a index of vbrif flowfilter
+    Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
+
+Add a vbrif flowfilter with dscp
+    [Documentation]    Create a flowfilter with dscp and Verify ping
+    Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
+
+Verify dscp action for vbrif flowfilter
+    [Documentation]    Verify actions in Flow Enties for dscp
+    Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dscp_flow}    ${FF_OUT_DUMPFLOWS_OF10}
+
+Remove vbrif Flowfilter index which have dscp
+    [Documentation]    Remove a index of vbrif flowfilter which have DSCP
+    Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
+
+Add a flowfilter with inet4 for drop
+    [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
+    Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
+
+Verify Removed Flow Entry For Inet After Drop Action
+    [Documentation]    Verify no flows between the hosts after drop
+    Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${drop_action}    ${DROP_OUT_DUMPFLOWS_OF10}
+
+Delete a flowcondition
+    [Documentation]    Delete a flowcondition
+    Remove flowcondition    cond_1
+
+Delete a vtn Tenant1
+    [Documentation]    Delete vtn Tenant1
+    Delete a vtn    Tenant1
diff --git a/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_flowfilter_out.robot b/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_flowfilter_out.robot
new file mode 100644 (file)
index 0000000..70ccfd6
--- /dev/null
@@ -0,0 +1,126 @@
+*** Settings ***
+Documentation     Test suite for VTN Manager using OF13
+Suite Setup       Start SuiteVtnMaTest
+Suite Teardown    Stop SuiteVtnMaTest
+Resource          ../../../libraries/VtnMaKeywords.robot
+
+*** Variables ***
+${flowconditiondata}    "vtn-flow-match":[{"vtn-inet-match":{"source-network":"10.0.0.3/32","destination-network":"10.0.0.1/32"},"index":"1"}]
+${flowfilterInetdata}    "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"}]
+${flowfilterInetdropdata}   "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"}]
+${flowfilterIcmpCodedata}   "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"}}]}]
+${flowfilterTpsrcTpdstdata}   "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"}]
+${flowfilterDscpdata}   "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"}]
+${flowfiltervlanpcp}   "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"}]
+
+*** Test Cases ***
+Check if switch1 detected
+    [Documentation]    Check if openflow:1 is detected
+    BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
+
+Check if switch2 detected
+    [Documentation]    Check if openflow:2 is detected
+    BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
+
+Check if switch3 detected
+    [Documentation]    Check if openflow:3 is detected
+    BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
+
+Add a vtn Tenant1
+    [Documentation]    Add a vtn Tenant1
+    Add a vtn    Tenant1
+
+Add a vBridge vBridge1
+    [Documentation]    Add a vBridge vBridge1 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge1
+
+Add a interface If1
+    [Documentation]    Add a interface if1 into vBridge vBridge1
+    Add a interface    Tenant1    vBridge1    if1
+
+Add a interface if2
+    [Documentation]    Add a interface if2 into vBridge vBridge1
+    Add a interface    Tenant1    vBridge1    if2
+
+Add a portmap for interface if1
+    [Documentation]    Create a portmap on Interface if1 of vBridge1
+    Add a portmap    Tenant1    vBridge1    if1    openflow:2    s2-eth1
+
+Add a portmap for interface if2
+    [Documentation]    Create a portmap on Interface if2 of vBridge1
+    Add a portmap    Tenant1    vBridge1    if2    openflow:3    s3-eth1
+
+Ping h1 to h3
+    [Documentation]    Ping h1 to h3, verify no packet loss
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
+
+Add a vBridge vBridge2
+    [Documentation]    Add a vBridge vBridge2 in vtn Tenant1
+    Add a vBridge    Tenant1    vBridge2
+
+Add a interface If3
+    [Documentation]    Add a interface if3 into vBrdige vBridge2
+    Add a interface    Tenant1    vBridge2    if3
+
+Add a interface if4
+    [Documentation]    Add a interface if4 into vBrdige vBridge2
+    Add a interface    Tenant1    vBridge2    if4
+
+Add a portmap for interface if3
+    [Documentation]    Create a portmap on Interface if3 of vBridge2
+    Add a portmap    Tenant1    vBridge2    if3    openflow:2    s2-eth2
+
+Add a portmap for interface if4
+    [Documentation]    Create a portmap on Interface if4 of vBridge2
+    Add a portmap    Tenant1    vBridge2    if4    openflow:3    s3-eth2
+
+Ping h2 to h4
+    [Documentation]    Ping h2 to h4, verify no packet loss
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h2    h4
+
+Add a flowcondition
+    [Documentation]    Create a flowcondition cond_1 using restconfig api
+    Add a flowcondition    cond_1    ${flowconditiondata}
+
+Add a vbrif flowfilter with inet4src and inet4dst
+    [Documentation]    Create a flowfilter with inet4 and Verify ping
+    Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdata}
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
+
+Verify inet4src and inet4dst of vbrif flowfilter
+    [Documentation]    Verify actions in Flow Enties for inet4src and inet4dst
+    Wait_Until_Keyword_Succeeds    20s    1s    Verify Flow Entries for Flowfilter    ${FF_OUT_DUMPFLOWS_OF13}    @{inet_action}
+
+Remove vbrif Flowfilter index
+    [Documentation]    Remove a index of vbrif flowfilter
+    Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
+
+Add a vbrif flowfilter with dscp
+    [Documentation]    Create a flowfilter with dscp and Verify ping
+    Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterDscpdata}
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h3
+
+Verify dscp action for vbrif flowfilter
+    [Documentation]    Verify actions in Flow Enties for dscp
+    Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${dscp_action}    ${FF_OUT_DUMPFLOWS_OF13}
+
+Remove vbrif Flowfilter index which have dscp
+    [Documentation]    Remove a index of vbrif flowfilter which have DSCP
+    Remove a vbrif flowfilter    Tenant1    vBridge1    if1    ${filter_index}
+
+Add a flowfilter with inet4 for drop
+    [Documentation]    Create a flowfilter with inet4 for drop action and Verify no pinging
+    Add a vbrif flowfilter    Tenant1    vBridge1    if1    ${flowfilterInetdropdata}
+    Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Not Succeed    h1    h3
+
+Verify Removed Flow Entry For Inet After Drop Action
+    [Documentation]    Verify no flows between the hosts after drop
+    Wait_Until_Keyword_Succeeds    20s    1s    Verify flowactions    ${drop_action}    ${DROP_OUT_DUMPFLOWS_OF13}
+
+Delete a flowcondition
+    [Documentation]    Delete a flowcondition
+    Remove flowcondition    cond_1
+
+Delete a vtn Tenant1
+    [Documentation]    Delete vtn Tenant1
+    Delete a vtn    Tenant1