Use RFC8040 URL for OVSDB tests
[integration/test.git] / csit / libraries / BulkomaticKeywords.robot
index fa708960b86465863838cff8014e45653b2845ce..6b37c65d4d293a83d875fd8cbba9c6029f79b4c0 100644 (file)
@@ -6,8 +6,9 @@ Resource          Utils.robot
 Variables         ../variables/Variables.py
 
 *** Variables ***
-${ADD_BULK_CONFIG_NODES_API}    /restconf/operations/sal-bulk-flow:flow-test
-${GET_BULK_CONFIG_NODES_API}    /restconf/operations/sal-bulk-flow:read-flow-test
+${ADD_BULK_CONFIG_NODES_API}    /rests/operations/sal-bulk-flow:flow-test
+${GET_BULK_CONFIG_NODES_API}    /rests/operations/sal-bulk-flow:read-flow-test
+${ADD_TABLE_NODEs_API}    /rests/operations/sal-bulk-flow:table-test
 ${jolokia_write_op_status}    /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/WriteOpStatus
 ${jolokia_read_op_status}    /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/ReadOpStatus
 ${jolokia_flow_count_status}    /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/FlowCount
@@ -38,6 +39,11 @@ Add Bulk Flow
     [Documentation]    Add Bulk Flow in member ${controller_index} according to \${json_body_add}.
     ${resp}    ClusterManagement.Post As Json To Member    ${ADD_BULK_CONFIG_NODES_API}    ${json_body_add}    ${controller_index}
 
+Add Table Flow
+    [Arguments]    ${json_body_add}    ${controller_index}
+    [Documentation]    Add Table in member ${controller_index} according to \${json_body_add}.
+    ${resp}    ClusterManagement.Post As Json To Member    ${ADD_TABLE_NODEs_API}    ${json_body_add}    ${controller_index}
+
 Delete Bulk Flow
     [Arguments]    ${json_body_del}    ${controller_index}
     [Documentation]    Delete Bulk Flow in member ${controller_index} according to \${json_body_del}.
@@ -68,6 +74,12 @@ Add Bulk Flow In Node
     Add Bulk Flow    ${json_body_add}    ${controller_index}
     Wait Until Write Finishes    ${controller_index}    ${timeout}
 
+Add Table In Node
+    [Arguments]    ${json_body_add}    ${controller_index}    ${timeout}
+    [Documentation]    Add Table Flow in member ${controller_index} and wait until operation is completed.
+    Add Table Flow    ${json_body_add}    ${controller_index}
+    Wait Until Write Finishes    ${controller_index}    ${timeout}
+
 Delete Bulk Flow In Node
     [Arguments]    ${json_body_del}    ${controller_index}    ${timeout}
     [Documentation]    Delete Bulk Flow in member ${controller_index} and wait until operation is completed.
@@ -77,13 +89,16 @@ Delete Bulk Flow In Node
 Get Bulk Flow And Verify Count In Cluster
     [Arguments]    ${json_body_get}    ${timeout}    ${flow_count}    ${controller_index_list}=${EMPTY}
     [Documentation]    Get Bulk Flow and Verify Flow Count in ${controller_index_list} matches ${flow_count}.
-    ${index_list} =    ClusterManagement__Given_Or_Internal_Index_List    given_list=${controller_index_list}
-    : FOR    ${index}    IN    @{index_list}
-    \    Get Bulk Flow    ${json_body_get}    ${index}
-    : FOR    ${index}    IN    @{index_list}
-    \    Wait Until Read Finishes    ${index}    ${timeout}
-    : FOR    ${index}    IN    @{index_list}
-    \    Verify Flow Count    ${flow_count}    ${index}
+    ${index_list} =    ClusterManagement.List Indices Or All    given_list=${controller_index_list}
+    FOR    ${index}    IN    @{index_list}
+        Get Bulk Flow    ${json_body_get}    ${index}
+    END
+    FOR    ${index}    IN    @{index_list}
+        Wait Until Read Finishes    ${index}    ${timeout}
+    END
+    FOR    ${index}    IN    @{index_list}
+        Verify Flow Count    ${flow_count}    ${index}
+    END
 
 Set DPN And Flow Count In Json Add
     [Arguments]    ${json_config}    ${dpn_count}    ${flows_count}
@@ -95,6 +110,9 @@ Set DPN And Flow Count In Json Add
     ${get_string}=    Set Variable    "sal-bulk-flow:flows-per-dpn" : "1000"
     ${put_string}=    Set Variable    "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
     ${json_body_add}    Replace String Using Regexp    ${str}    ${get_string}    ${put_string}
+    ${get_string}=    Set Variable    "sal-bulk-flow:batch-size" : "1"
+    ${put_string}=    Set Variable    "sal-bulk-flow:batch-size" : "${flows_count}"
+    ${json_body_add}    Replace String Using Regexp    ${json_body_add}    ${get_string}    ${put_string}
     Log    ${json_body_add}
     [Return]    ${json_body_add}
 
@@ -121,5 +139,8 @@ Set DPN And Flow Count In Json Del
     ${get_string}=    Set Variable    "sal-bulk-flow:flows-per-dpn" : "1000"
     ${put_string}=    Set Variable    "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
     ${json_body_del}    Replace String Using Regexp    ${str}    ${get_string}    ${put_string}
+    ${get_string}=    Set Variable    "sal-bulk-flow:batch-size" : "1"
+    ${put_string}=    Set Variable    "sal-bulk-flow:batch-size" : "${flows_count}"
+    ${json_body_del}    Replace String Using Regexp    ${json_body_del}    ${get_string}    ${put_string}
     Log    ${json_body_del}
     [Return]    ${json_body_del}