X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FVtnMaKeywords.robot;h=0291a71c67bbc00eb42f48a289226cebfc977f2e;hb=132b65975cea1a3862a2841e4865b2588e9a5051;hp=e5fdc0c61e5c27f3a359befb1cbd6af9d331a126;hpb=dd942881d4014c5e5b68cad168f11d610fc9ae39;p=integration%2Ftest.git diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index e5fdc0c61e..0291a71c67 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -9,8 +9,8 @@ Variables ../variables/Variables.py Resource ./Utils.robot *** Variables *** -${vlan_topo_10} sudo mn --controller=remote,ip=${CONTROLLER} --custom vlan_vtn_test.py --topo vlantopo -${vlan_topo_13} sudo mn --controller=remote,ip=${CONTROLLER} --custom vlan_vtn_test.py --topo vlantopo --switch ovsk,protocols=OpenFlow13 +${vlan_topo_10} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom vlan_vtn_test.py --topo vlantopo +${vlan_topo_13} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom vlan_vtn_test.py --topo vlantopo --switch ovsk,protocols=OpenFlow13 ${VERSION_VTN} controller/nb/v2/vtn/version ${VTN_INVENTORY} restconf/operational/vtn-inventory:vtn-nodes ${DUMPFLOWS_OF10} dpctl dump-flows -O OpenFlow10 @@ -23,21 +23,26 @@ ${vlanmap_bridge1} 200 ${vlanmap_bridge2} 300 @{VLANMAP_BRIDGE1_DATAFLOW} "reason":"VLANMAPPED" "virtual-node-path":{"bridge-name":"vBridge1_vlan","tenant-name":"Tenant1","vlan-map-id":"ANY.200"} @{VLANMAP_BRIDGE2_DATAFLOW} "reason":"VLANMAPPED" "virtual-node-path":{"bridge-name":"vBridge2_vlan","tenant-name":"Tenant1","vlan-map-id":"ANY.300"} -${in_port} 1 ${out_before_pathpolicy} output:2 ${out_after_pathpolicy} output:3 -${flowcond_restconfigdata} {"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"vtn-ether-match":{"destination-address":"ba:bd:0f:e3:a8:c8","ether-type":"2048","source-address":"ca:9e:58:0c:1e:f0","vlan-id": "1"},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}} +${pathpolicy_topo_13} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow13 +${pathpolicy_topo_10} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow10 +@{PATHMAP_ATTR} "index":"1" "condition":"flowcond_path" "policy":"1" +${policy_id} 1 +${in_port} 1 +@{PATHPOLICY_ATTR} "id":1 "port-desc":"openflow:4,2,s4-eth2" +${custom} ${CURDIR}/${CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH} *** Keywords *** Start SuiteVtnMa [Documentation] Start VTN Manager Rest Config Api Test Suite - Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} + Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} BuiltIn.Wait_Until_Keyword_Succeeds 30 3 Fetch vtn list Start Suite Start SuiteVtnMaTest [Documentation] Start VTN Manager Test Suite - Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} + Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Stop SuiteVtnMa [Documentation] Stop VTN Manager Test Suite @@ -104,6 +109,21 @@ Verify Data Flows ... ELSE IF '${vBridge_name}' == 'vBridge1_vlan' DataFlowsForBridge ${resp} @{VLANMAP_BRIDGE1_DATAFLOW} ... ELSE DataFlowsForBridge ${resp} @{VLANMAP_BRIDGE2_DATAFLOW} +Start PathSuiteVtnMaTest + [Documentation] Start VTN Manager Test Suite and Mininet + Start SuiteVtnMaTest + Start Mininet ${MININET} ${pathpolicy_topo_13} ${custom} + +Start PathSuiteVtnMaTestOF10 + [Documentation] Start VTN Manager Test Suite and Mininet in Open Flow 10 Specification + Start SuiteVtnMaTest + Start Mininet ${MININET} ${pathpolicy_topo_10} ${custom} + +Stop PathSuiteVtnMaTest + [Documentation] Cleanup/Shutdown work at the completion of all tests. + Delete All Sessions + Stop Mininet ${mininet_conn_id} + DataFlowsForBridge [Arguments] ${resp} @{BRIDGE_DATAFLOW} [Documentation] Verify whether the required attributes exists. @@ -135,10 +155,16 @@ Get a pathpolicy : FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR} \ should Contain ${resp.content} ${pathpolicyElement} +Delete a pathmap + [Arguments] ${tenant_path} + [Documentation] Remove a pathmap for a vtn + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-path-map:remove-path-map data={"input":{"tenant-name":"${tenant_path}","map-index":["${policy_id}"]}} + Should Be Equal As Strings ${resp.status_code} 200 + Delete a pathpolicy - [Arguments] ${path_id} + [Arguments] ${policy_id} [Documentation] Delete a pathpolicy for a vtn - ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-path-policy:remove-path-policy data={"input": {"id": "${path_id}"}} + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-path-policy:remove-path-policy data={"input":{"id":"${policy_id}"}} Should Be Equal As Strings ${resp.status_code} 200 Verify flowEntryPathPolicy @@ -150,9 +176,9 @@ Verify flowEntryPathPolicy Should Contain ${result} in_port=${port} actions=${output} Add a macmap - [Arguments] ${vtn_name} ${vBridge_name} ${macmap_data} + [Arguments] ${vtn_name} ${vBridge_name} ${src_add} ${dst_add} [Documentation] Create a macmap for a vbridge - ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-mac-map:set-mac-map data={"input": { "allowed-hosts": ["${macmap_data}"], "tenant-name":${vtn_name}, "bridge-name": ${vBridge_name}}} } + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-mac-map:set-mac-map data={"input":{"operation":"SET","allowed-hosts":["${dst_add}@0","${src_add}@0"],"tenant-name":"${vtn_name}","bridge-name":"${vBridge_name}"}} Should Be Equal As Strings ${resp.status_code} 200 Get DynamicMacAddress @@ -249,19 +275,19 @@ Verify macaddress Add a vtn flowfilter [Arguments] ${vtn_name} ${vtnflowfilter_data} [Documentation] Create a flowfilter for a vtn - ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:set-flow-filter data=${vtnflowfilter_data} + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:set-flow-filter data={"input": {"tenant-name": "${vtn_name}",${vtnflowfilter_data}}} Should Be Equal As Strings ${resp.status_code} 200 Add a vbr flowfilter [Arguments] ${vtn_name} ${vBridge_name} ${vbrflowfilter_data} [Documentation] Create a flowfilter for a vbr - ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:set-flow-filter data=${vbrflowfilter_data} + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:set-flow-filter data={"input": {"tenant-name": "${vtn_name}", "bridge-name": "${vBridge_name}", ${vbrflowfilter_data}}} Should Be Equal As Strings ${resp.status_code} 200 Add a vbrif flowfilter [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${vbrif_flowfilter_data} [Documentation] Create a flowfilter for a vbrif - ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:set-flow-filter data=${vbrif_flowfilter_data} + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-filter:set-flow-filter data={"input": {"tenant-name": ${vtn_name}, "bridge-name": "${vBridge_name}","interface-name":"${interface_name}",${vbrif_flowfilter_data}}} Should Be Equal As Strings ${resp.status_code} 200 Verify Flow Entry for Inet Flowfilter @@ -294,8 +320,8 @@ Get flowconditions Get flowcondition [Arguments] ${flowcond_name} ${retrieve} - [Documentation] Retrieve the flowcondition by name and to check the removed flowcondition added "retrieve" argument to differentiate the status code, since - ... after removing flowcondition name the status will be different compare to status code when the flowcondition name is present. + [Documentation] Retrieve the flowcondition by name and to check the removed flowcondition we added "retrieve" argument to differentiate the status code, + ... since after removing flowcondition name the status will be different compare to status code when the flowcondition name is present. ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-flow-condition:vtn-flow-conditions/vtn-flow-condition/${flowcond_name} Run Keyword If '${retrieve}' == 'retrieve' Should Be Equal As Strings ${resp.status_code} 200 ... ELSE Should Not Be Equal As Strings ${resp.status_code} 200 @@ -303,5 +329,5 @@ Get flowcondition Remove flowcondition [Arguments] ${flowcond_name} [Documentation] Remove the flowcondition by name - ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-condition:remove-flow-condition {"input": {"name": "${flowcond_name}"}} + ${resp}= RequestsLibrary.Post Request session restconf/operations/vtn-flow-condition:remove-flow-condition data={"input":{"name":"${flowcond_name}"}} Should Be Equal As Strings ${resp.status_code} 200