X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Fcsit%2Flibraries%2FVtnMaKeywords.robot;fp=test%2Fcsit%2Flibraries%2FVtnMaKeywords.robot;h=8688b597854b7d32af3231869f7ba54489a69373;hb=ff5f9d4b0264334e58c6e1f9d292aa4605fe2e43;hp=929517230105850fb32d47105b503814487152a2;hpb=bd7288515593f91310833ac44859eba7a3a465a5;p=integration.git diff --git a/test/csit/libraries/VtnMaKeywords.robot b/test/csit/libraries/VtnMaKeywords.robot index 92951723..8688b597 100644 --- a/test/csit/libraries/VtnMaKeywords.robot +++ b/test/csit/libraries/VtnMaKeywords.robot @@ -10,10 +10,13 @@ Resource ./Utils.robot *** Variables *** ${REST_CONTEXT_VTNS} controller/nb/v2/vtn/default/vtns +${REST_CONTEXT} controller/nb/v2/vtn/default ${VERSION_VTN} controller/nb/v2/vtn/version ${VTN_INVENTORY} restconf/operational/vtn-inventory:vtn-nodes ${DUMPFLOWS} dpctl dump-flows -O OpenFlow13 ${index} 7 +@{FLOWELMENTS} nw_src=10.0.0.1 nw_dst=10.0.0.3 actions=drop + *** Keywords *** Start SuiteVtnMa [Documentation] Start VTN Manager Init Test Suite @@ -76,6 +79,13 @@ Add a portmap ${resp}= RequestsLibrary.Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/portmap data=${json_data} headers=${HEADERS} Should Be Equal As Strings ${resp.status_code} 200 +Add a macmap + [Arguments] ${vtn_name} ${vBridge_name} ${macmap_data} + [Documentation] Create a macmap for a vbridge + ${json_data}= json.dumps ${macmap_data} + ${resp}= RequestsLibrary.Post session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/macmap/allow data=${macmap_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 201 + Mininet Ping Should Succeed [Arguments] ${host1} ${host2} Write ${host1} ping -c 10 ${host2} @@ -140,3 +150,62 @@ Verify macaddress ${result} Read Until mininet> Should Contain ${result} ${sourcemacaddress} Should Contain ${result} ${destmacaddress} + +Add a flowcondition + [Arguments] ${cond_name} ${flowcond_data} + [Documentation] Create a flowcondition for a interface of a vbridge + ${json_data}= json.dumps ${flowcond_data} + ${resp}= RequestsLibrary.Put session ${REST_CONTEXT}/flowconditions/${cond_name} data=${json_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 201 + +Delete a flowcondition + [Arguments] ${cond_name} + [Documentation] Delete a flowcondition for a interface of a vbridge + ${resp}= RequestsLibrary.Delete session ${REST_CONTEXT}/flowconditions/${cond_name} + Should Be Equal As Strings ${resp.status_code} 200 + +Add a flowfilter + [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${flowfilter_data} ${ff_index} + [Documentation] Create a flowfilter for a vtn + ${resp}= RequestsLibrary.Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/flowfilters/IN/${ff_index} data=${flowfilter_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 201 + +Add a flowfilter_vtn + [Arguments] ${vtn_name} ${flowfilter_data} ${ff_index} + [Documentation] Create a flowfilter for a vtn + ${resp}= RequestsLibrary.Put session ${REST_CONTEXT_VTNS}/${vtn_name}/flowfilters/${ff_index} data=${flowfilter_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 201 + +Add a flowfilter_vbr + [Arguments] ${vtn_name} ${vBridge_name} ${flowfilter_data} ${ff_index} + [Documentation] Create a flowfilter for a vbr + ${resp}= RequestsLibrary.Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/flowfilters/IN/${ff_index} data=${flowfilter_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 201 + +Update a flowfilter + [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${flowfilter_data} ${ff_index} + [Documentation] Create a flowfilter for a vtn + ${resp}= RequestsLibrary.Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/flowfilters/IN/${ff_index} data=${flowfilter_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 200 + +Add a flowfilter for drop + [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${flowfilter_data} ${ff_index} + [Documentation] Create a flowfilter for a vtn + ${resp}= RequestsLibrary.Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/flowfilters/IN/${ff_index} data=${flowfilter_data} headers=${HEADERS} + Should Be Equal As Strings ${resp.status_code} 200 + +Verify Flow Entry for Inet Flowfilter + [Documentation] Verify switch flow entry using flowfilter for a vtn + ${booleanValue}= Run Keyword And Return Status Verify Actions on Flow Entry + Should Not Be Equal As Strings ${booleanValue} True + +Verify Removed Flow Entry for Inet Drop Flowfilter + [Documentation] Verify removed switch flow entry using flowfilter drop for a vtn + ${booleanValue}= Run Keyword And Return Status Verify Actions on Flow Entry + Should Be Equal As Strings ${booleanValue} True + +Verify Actions on Flow Entry + write ${DUMPFLOWS} + ${result} Read Until mininet> + : FOR ${flowElement} IN @{FLOWELMENTS} + \ should Contain ${result} ${flowElement}