Allow coe to use single suite
[integration/test.git] / csit / libraries / FlowLib.robot
index 37f09d9921b6da3d700a08d7922b28ee9aa1ac3c..3c27fe66c42e827c7712bc631d6f90c95815dca6 100644 (file)
@@ -97,8 +97,7 @@ Check Number Of Groups
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${group_count}=    Get Count    ${resp.content}    "group-type"
-    ${count}=    CompareStream.Set_Variable_If_At Least_Boron    ${group_count}    ${group_count/2}
-    Should Be Equal As Integers    ${count}    ${groups}
+    Should Be Equal As Integers    ${group_count}    ${groups}
 
 Check Flow Stats Are Available
     [Arguments]    ${node_id}    ${flows}
@@ -514,3 +513,11 @@ Delete Flow Via Restconf
     Log    ${resp.content}
     ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Get Flow Id
+    [Arguments]    ${dpnid}    ${table_id}    ${flow_element}
+    [Documentation]    This verifies specific flow-id for particular table-id matching from the flow element
+    ${resp} =    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}/node/openflow:${dpnid}/table/${table_id}
+    BuiltIn.Log    ${resp.content}
+    @{flow_id} =    String.Get Regexp Matches    ${resp.content}    id\":\"(\\d+${flow_element})    1
+    [Return]    @{flow_id}[0]