X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FBulkomaticKeywords.robot;h=c76bc7e75ad46d3138d9b8740f08573dbbcd8ada;hb=50127a8724b4e6ed61a1e19e5bea33863c396a18;hp=e6b27fb42612ae9d95f3314818ac680ae581082e;hpb=e14db1139bd8778e3f7c4575e69c1a12f37c4fa1;p=integration%2Ftest.git diff --git a/csit/libraries/BulkomaticKeywords.robot b/csit/libraries/BulkomaticKeywords.robot index e6b27fb426..c76bc7e75a 100644 --- a/csit/libraries/BulkomaticKeywords.robot +++ b/csit/libraries/BulkomaticKeywords.robot @@ -14,10 +14,9 @@ ${jolokia_flow_count_status} /jolokia/read/org.opendaylight.openflowplugin.ap *** Keywords *** Operation Status Check - [Arguments] ${controller_index} ${op_status_uri} + [Arguments] ${op_status_uri} ${controller_index} [Documentation] Checks to see if read or write operation is successfull in controller node. - ${data}= Utils.Get Data From URI controller${controller_index} ${op_status_uri} - Log ${data} + ${data}= ClusterManagement.Get From Member ${op_status_uri} ${controller_index} ${json}= To Json ${data} ${value}= Get From Dictionary ${json} value ${value}= Convert to String ${value} @@ -26,66 +25,107 @@ Operation Status Check Wait Until Write Finishes [Arguments] ${controller_index} ${timeout} - [Documentation] Wait Until Write operation status is OK in ${controller_index}. - Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${controller_index} ${jolokia_write_op_status} + [Documentation] Wait Until Write operation status is OK in member ${controller_index}. + Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${jolokia_write_op_status} ${controller_index} Wait Until Read Finishes [Arguments] ${controller_index} ${timeout} - [Documentation] Wait Until Read operation status is OK in ${controller_index}. - Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${controller_index} ${jolokia_read_op_status} + [Documentation] Wait Until Read operation status is OK in member ${controller_index}. + Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${jolokia_read_op_status} ${controller_index} Add Bulk Flow - [Arguments] ${controller_index} ${add_bulk_json_file} - [Documentation] Add Bulk Flow in ${controller_index} according to ${add_bulk_json_file}. - ${add_body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${add_bulk_json_file} - ${resp} Utils.Post Elements To URI ${ADD_BULK_CONFIG_NODES_API} ${add_body} headers=${HEADERS_YANG_JSON} session=controller${controller_index} + [Arguments] ${json_body_add} ${controller_index} + [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} Delete Bulk Flow - [Arguments] ${controller_index} ${del_bulk_json_file} - [Documentation] Delete Bulk Flow in ${controller_index} according to ${del_bulk_json_file}. - ${del_body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${del_bulk_json_file} - ${resp} Utils.Post Elements To URI ${ADD_BULK_CONFIG_NODES_API} ${del_body} headers=${HEADERS_YANG_JSON} session=controller${controller_index} + [Arguments] ${json_body_del} ${controller_index} + [Documentation] Delete Bulk Flow in member ${controller_index} according to \${json_body_del}. + ${resp} ClusterManagement.Post As Json To Member ${ADD_BULK_CONFIG_NODES_API} ${json_body_del} ${controller_index} Get Bulk Flow - [Arguments] ${controller_index} ${get_bulk_json_file} - [Documentation] Get Bulk Flow in ${controller_index} according to ${get_bulk_json_file}. - ${get_body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${get_bulk_json_file} - ${resp} Utils.Post Elements To URI ${GET_BULK_CONFIG_NODES_API} ${get_body} headers=${HEADERS_YANG_JSON} session=controller${controller_index} + [Arguments] ${json_body_get} ${controller_index} + [Documentation] Get Bulk Flow in member ${controller_index} according to \${json_body_get}. + ${resp} ClusterManagement.Post As Json To Member ${GET_BULK_CONFIG_NODES_API} ${json_body_get} ${controller_index} Get Bulk Flow Count [Arguments] ${controller_index} - [Documentation] Get Flow count in ${controller_index}. New Flow Count is available after Get Bulk Flow operation. - ${data}= Utils.Get Data From URI controller${controller_index} ${jolokia_flow_count_status} - Log ${data} + [Documentation] Get Flow count in member ${controller_index}. New Flow Count is available after Get Bulk Flow operation. + ${data}= ClusterManagement.Get From Member ${jolokia_flow_count_status} ${controller_index} [Return] ${data} Verify Flow Count - [Arguments] ${controller_index} ${flow_count} - [Documentation] Verify Flow Count in ${controller_index} matches ${flow_count}. + [Arguments] ${flow_count} ${controller_index} + [Documentation] Verify Flow Count in member ${controller_index} matches ${flow_count}. ${data}= Get Bulk Flow Count ${controller_index} - Log ${data} ${json}= To Json ${data} ${value}= Get From Dictionary ${json} value Should Be Equal As Strings ${value} ${flow_count} Add Bulk Flow In Node - [Arguments] ${controller_index} ${add_bulk_json_file} ${timeout} - [Documentation] Add Bulk Flow in ${controller_index} and wait until operation is completed. - Add Bulk Flow ${controller_index} ${add_bulk_json_file} + [Arguments] ${json_body_add} ${controller_index} ${timeout} + [Documentation] Add Bulk Flow in member ${controller_index} and wait until operation is completed. + Add Bulk Flow ${json_body_add} ${controller_index} Wait Until Write Finishes ${controller_index} ${timeout} Delete Bulk Flow In Node - [Arguments] ${controller_index} ${delete_bulk_json_file} ${timeout} - [Documentation] Delete Bulk Flow in ${controller_index} and wait until operation is completed. - Delete Bulk Flow ${controller_index} ${delete_bulk_json_file} + [Arguments] ${json_body_del} ${controller_index} ${timeout} + [Documentation] Delete Bulk Flow in member ${controller_index} and wait until operation is completed. + Delete Bulk Flow ${json_body_del} ${controller_index} Wait Until Write Finishes ${controller_index} ${timeout} Get Bulk Flow And Verify Count In Cluster - [Arguments] ${controller_index_list} ${get_bulk_json_file} ${timeout} ${flow_count} + [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}. - : FOR ${index} IN @{controller_index_list} - \ Get Bulk Flow ${index} ${get_bulk_json_file} - : FOR ${index} IN @{controller_index_list} + ${index_list} = ClusterManagement.List Indices Or All 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 @{controller_index_list} - \ Verify Flow Count ${index} ${flow_count} + : FOR ${index} IN @{index_list} + \ Verify Flow Count ${flow_count} ${index} + +Set DPN And Flow Count In Json Add + [Arguments] ${json_config} ${dpn_count} ${flows_count} + [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Add json file. + ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config} + ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1" + ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}" + ${str} Replace String Using Regexp ${body} ${get_string} ${put_string} + ${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} + +Set DPN And Flow Count In Json Get + [Arguments] ${json_config} ${dpn_count} ${flows_count} + [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Get json file. + ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config} + ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1" + ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}" + ${str} Replace String Using Regexp ${body} ${get_string} ${put_string} + ${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_get} Replace String Using Regexp ${str} ${get_string} ${put_string} + Log ${json_body_get} + [Return] ${json_body_get} + +Set DPN And Flow Count In Json Del + [Arguments] ${json_config} ${dpn_count} ${flows_count} + [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Del json file. + ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config} + ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1" + ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}" + ${str} Replace String Using Regexp ${body} ${get_string} ${put_string} + ${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}