From 2d721bb496576d1eabca157e6f1e768cce07dec2 Mon Sep 17 00:00:00 2001 From: "Karthik.S" Date: Thu, 19 May 2016 18:25:59 +0530 Subject: [PATCH] Add CSIT for VTN Manager flowfilter functionality * Added vlan test cases for vbrif flowfilter keytype to verify vlan-pcp in flowentry installed. * Added new function "Add a vlan portmap" in VtnMaKeyword library file. * Added new test file 010__vtn_vbridge_interface_vlanmap.robot for OF10 and OF13. Change-Id: If91f821a8337de1a2c8f0c07752a20ae0a570211 Signed-off-by: Karthik.S --- csit/libraries/VtnMaKeywords.robot | 6 ++ .../VTN_Mgr_OF10/010__vtn_vbrif_vlanmap.robot | 75 +++++++++++++++++++ .../VTN_Mgr_OF13/010__vtn_vbrif_vlanmap.robot | 75 +++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 csit/suites/vtn/VTN_Mgr_OF10/010__vtn_vbrif_vlanmap.robot create mode 100644 csit/suites/vtn/VTN_Mgr_OF13/010__vtn_vbrif_vlanmap.robot diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index 6b20745f79..c3eaf4bf21 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -326,6 +326,12 @@ Remove a vbrif flowfilter ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:remove-flow-filter data={"input": {"indices": ["${filter_index}"], "tenant-name": "${vtn_name}","bridge-name": "${vBridge_name}","interface-name": "${interface_name}"}} Should Be Equal As Strings ${resp.status_code} 200 +Add a vlan portmap + [Arguments] ${vtn_name} ${vbr_name} ${interface_name} ${id} ${node_id} ${port_id} + [Documentation] Create a portmap for a interface of a vbridge + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-port-map:set-port-map data={"input": { "tenant-name":${vtn_name}, "bridge-name":${vbr_name}, "interface-name": ${interface_name}, "vlan-id": ${id}, "node":"${node_id}", "port-name":"${port_id}"}} + Should Be Equal As Strings ${resp.status_code} 200 + Verify Flow Entries for Flowfilter [Arguments] ${dumpflows} @{flowfilter_actions} [Documentation] Verify switch flow entry using flowfilter for a vtn diff --git a/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_vbrif_vlanmap.robot b/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_vbrif_vlanmap.robot new file mode 100644 index 0000000000..2c23ae9313 --- /dev/null +++ b/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_vbrif_vlanmap.robot @@ -0,0 +1,75 @@ +*** 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.1/32","destination-network":"10.0.0.3/32"},"index":"1"}] +${flowfiltervlanpcp} "vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order":"1","vtn-set-vlan-pcp-action":{"vlan-pcp":"6"}}],"index":"1"}] + +*** Test Cases *** +Start topology + [Documentation] Add a vlan topology + Start vlan_topo OF10 + +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 with vlan-id for interface if1 + [Documentation] Create a vlan portmap on Interface if1 of vBridge1 + Add a vlan portmap Tenant1 vBridge1 if1 200 openflow:1 s1-eth1 + +Add a portmap with vlan-id for interface if2 + [Documentation] Create a vlan portmap on Interface if2 of vBridge1 + Add a vlan portmap Tenant1 vBridge1 if2 200 openflow:2 s2-eth3 + +Add a flowcondition + [Documentation] Create a flowcondition cond_1 using restconfig api + Add a flowcondition cond_1 ${flowconditiondata} + +Add a vbrif flowfilter with vlanpcp + [Documentation] Create a flowfilter with vlanpcp and Verify ping + Add a vbrif flowfilter Tenant1 vBridge1 if1 ${flowfiltervlanpcp} + Wait_Until_Keyword_Succeeds 20s 1s Mininet Ping Should Succeed h1 h3 + +Verify vlanpcp of vbrif flowfilter + [Documentation] Verify actions in Flow Enties for vlanpcp + Wait_Until_Keyword_Succeeds 20s 1s Verify Flow Entries for Flowfilter ${FF_OUT_DUMPFLOWS_OF10} ${vlanpcp_action} + +Remove vbrif Flowfilter index + [Documentation] Remove a index of vbrif flowfilter + Remove a vbrif flowfilter Tenant1 vBridge1 if1 ${filter_index} + +Delete a flowcondition + [Documentation] Delete a flowcondition + Remove flowcondition cond_1 + +Delete a vtn Tenant1 + [Documentation] Delete a vtn Tenant1 + Delete a vtn Tenant1 diff --git a/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_vbrif_vlanmap.robot b/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_vbrif_vlanmap.robot new file mode 100644 index 0000000000..6a0ebf6583 --- /dev/null +++ b/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_vbrif_vlanmap.robot @@ -0,0 +1,75 @@ +*** 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.1/32","destination-network":"10.0.0.3/32"},"index":"1"}] +${flowfiltervlanpcp} "vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order":"1","vtn-set-vlan-pcp-action":{"vlan-pcp":"6"}}],"index":"1"}] + +*** Test Cases *** +Start topology + [Documentation] Add a vlan topology + Start vlan_topo OF13 + +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 with vlan-id for interface if1 + [Documentation] Create a vlan portmap on Interface if1 of vBridge1 + Add a vlan portmap Tenant1 vBridge1 if1 200 openflow:1 s1-eth1 + +Add a portmap with vlan-id for interface if2 + [Documentation] Create a vlan portmap on Interface if2 of vBridge1 + Add a vlan portmap Tenant1 vBridge1 if2 200 openflow:2 s2-eth3 + +Add a flowcondition + [Documentation] Create a flowcondition cond_1 using restconfig api + Add a flowcondition cond_1 ${flowconditiondata} + +Add a vbrif flowfilter with vlanpcp + [Documentation] Create a flowfilter with vlanpcp and Verify ping + Add a vbrif flowfilter Tenant1 vBridge1 if1 ${flowfiltervlanpcp} + Wait_Until_Keyword_Succeeds 20s 1s Mininet Ping Should Succeed h1 h3 + +Verify vlanpcp of vbrif flowfilter + [Documentation] Verify actions in Flow Enties for vlanpcp + Wait_Until_Keyword_Succeeds 20s 1s Verify Flow Entries for Flowfilter ${FF_OUT_DUMPFLOWS_OF13} ${vlanpcp_actions} + +Remove vbrif Flowfilter index + [Documentation] Remove a index of vbrif flowfilter + Remove a vbrif flowfilter Tenant1 vBridge1 if1 ${filter_index} + +Delete a flowcondition + [Documentation] Delete a flowcondition + Remove flowcondition cond_1 + +Delete a vtn Tenant1 + [Documentation] Delete a vtn Tenant1 + Delete a vtn Tenant1 -- 2.36.6