[VOL-4620] Extending voltctl gRPC payload size for scale test related commands

Change-Id: I69076f895cae0f708f6e3a9fa8c99c32bdd9b260
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 3579db7..bd415f1 100755
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -25,6 +25,9 @@
 Resource          ./utils.robot
 Resource          ./flows.robot
 
+*** Variables ***
+${voltctlGrpcLimit}     32M
+
 *** Keywords ***
 Test Empty Device List
     [Documentation]    Verify that there are no devices in the system
@@ -79,7 +82,7 @@
     ${arg}=    Set Variable    ${EMPTY}
     ${arg}=    Run Keyword If    len('${filter}'.strip()) != 0    Set Variable    --filter ${filter}
     ${rc}    ${devices}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB ${arg} --orderby Root -q | xargs echo -n
+    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} ${arg} --orderby Root -q | xargs echo -n
     Should Be Equal As Integers    ${rc}    0
     ${rc}    ${output}=    Run Keyword If    len('${devices}') != 0    Run and Return Rc and Output
     ...    voltctl -c ${VOLTCTL_CONFIG} device disable ${devices}
@@ -90,7 +93,7 @@
     [Documentation]    Tests to verify that all devices in VOLTHA are disabled
     [Arguments]    ${filter}
     ${rc}    ${count}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB --filter '${filter},AdminState!=DISABLED' -q | wc -l
+    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} --filter '${filter},AdminState!=DISABLED' -q | wc -l
     Should Be Equal As Integers    ${rc}    0
     Should Be Equal As Integers    ${count}    0
 
@@ -100,7 +103,7 @@
     ${arg}=    Set Variable    ${EMPTY}
     ${arg}=    Run Keyword If    len('${filter}'.strip()) != 0    Set Variable    --filter ${filter}
     ${rc}    ${devices}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device list ${arg} -m 32MB --orderby Root -q | xargs echo -n
+    ...    voltctl -c ${VOLTCTL_CONFIG} device list ${arg} -m ${voltctlGrpcLimit} --orderby Root -q | xargs echo -n
     Should Be Equal As Integers    ${rc}    0
     ${rc}    ${output}=    Run Keyword If    len('${devices}') != 0    Run and Return Rc and Output
     ...    voltctl -c ${VOLTCTL_CONFIG} device delete ${devices}
@@ -110,7 +113,7 @@
     [Arguments]    ${device_id}
     [Documentation]    Gets device flows from VOLTHA
     ${rc}    ${output}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device flows ${device_id} -m 32MB
+    ...    voltctl -c ${VOLTCTL_CONFIG} device flows ${device_id} -m ${voltctlGrpcLimit}
     Should Be Equal As Integers    ${rc}    0
     [Return]    ${output}
 
@@ -130,9 +133,9 @@
     [Arguments]    ${device_id}
     [Documentation]    Gets device flows and ports from VOLTHA
     ${rc1}    ${flows}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device flows ${device_id} -m 32MB
+    ...    voltctl -c ${VOLTCTL_CONFIG} device flows ${device_id} -m ${voltctlGrpcLimit}
     ${rc2}    ${ports}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device port list ${device_id} -m 32MB
+    ...    voltctl -c ${VOLTCTL_CONFIG} device port list ${device_id} -m ${voltctlGrpcLimit}
     Log    ${flows}
     Log    ${ports}
     Should Be Equal As Integers    ${rc1}    0
@@ -140,14 +143,14 @@
 
 Get Device List from Voltha
     [Documentation]    Gets Device List Output from Voltha
-    ${rc1}    ${devices}=    Run and Return Rc and Output    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB
+    ${rc1}    ${devices}=    Run and Return Rc and Output    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit}
     Log    ${devices}
     Should Be Equal As Integers    ${rc1}    0
 
 Get ONUs Device IDs from Voltha
     [Documentation]    Fetches the ONU Device Ids from Voltha
     ${rc}    ${onus}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f Type=brcm_openomci_onu -q
+    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} -f Type=brcm_openomci_onu -q
     Should Be Equal as Integers    ${rc}    0
     @{onuDevList}=    Split To Lines    ${onus}
     [Return]    ${onuDevList}
@@ -156,7 +159,7 @@
     [Documentation]    Gets Device List Output from Voltha applying filtering by device type
     [Arguments]  ${type}
     ${rc1}    ${devices}=    Run and Return Rc and Output
-    ...     voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f Type=${type} -o json
+    ...     voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} -f Type=${type} -o json
     Log    ${devices}
     Should Be Equal As Integers    ${rc1}    0
     Return From Keyword     ${devices}
@@ -164,7 +167,7 @@
 Get Logical Device List from Voltha
     [Documentation]    Gets Logical Device List Output from Voltha (in json format)
     ${rc1}    ${devices}=    Run and Return Rc and Output
-    ...   voltctl -c ${VOLTCTL_CONFIG} logicaldevice list -m 32MB -o json
+    ...   voltctl -c ${VOLTCTL_CONFIG} logicaldevice list -m ${voltctlGrpcLimit} -o json
     Log    ${devices}
     Should Be Equal As Integers    ${rc1}    0
     Return From Keyword     ${devices}
@@ -179,9 +182,9 @@
     [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}
     ...    ${id}    ${onu_reason}=${EMPTY}    ${onu}=False    ${by_dev_id}=False
     ${rc}    ${output}=    Run Keyword If    ${by_dev_id}    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f Id=${id} -o json
+    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} -f Id=${id} -o json
     ...    ELSE    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f SerialNumber=${id} -o json
+    ...    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} -f SerialNumber=${id} -o json
     Should Be Equal As Integers    ${rc}    0
     ${jsondata}=    To Json    ${output}
     Log     ${output}
@@ -257,7 +260,7 @@
     ...    Parses the output of voltctl device port list <device_id> and matches the port types listed
     [Arguments]    ${device_id}    ${pon_type}    ${ethernet_type}   ${all_active}=True
     ${rc}    ${output}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device port list ${device_id} -m 32MB -o json
+    ...    voltctl -c ${VOLTCTL_CONFIG} device port list ${device_id} -m ${voltctlGrpcLimit} -o json
     Should Be Equal As Integers    ${rc}    0
     ${jsondata}=    To Json    ${output}
     Log    ${jsondata}
@@ -301,7 +304,7 @@
     [Arguments]    ${device_id}    ${flow_count}=${EMPTY}
     [Documentation]    Parses the output of voltctl device flows <device_id> and expects flow count > 0
     ${rc}    ${output}=    Run and Return Rc and Output
-    ...    voltctl -c ${VOLTCTL_CONFIG} device flows ${device_id} -m 32MB -o json
+    ...    voltctl -c ${VOLTCTL_CONFIG} device flows ${device_id} -m ${voltctlGrpcLimit} -o json
     Should Be Equal As Integers    ${rc}    0
     ${jsondata}=    To Json    ${output}
     Log    ${jsondata}
@@ -335,7 +338,7 @@
     [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}    ${onu_reason}
     ...    ${List_ONU_Serial}   ${startTime}    ${print2console}=False    ${output_file}=${EMPTY}
     ...    ${alternate_reason}=${EMPTY}
-    ${cmd}=    Catenate    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f Type=brcm_openomci_onu
+    ${cmd}=    Catenate    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} -f Type=brcm_openomci_onu
     ...    --format "{{.SerialNumber}}\t{{.AdminState}}\t{{.OperStatus}}\t{{.ConnectStatus}}\t{{.Reason}}" | grep -v SERIALNUMBER
     ${rc}    ${output}=    Run and Return Rc and Output    ${cmd}
     Should Be Equal As Integers    ${rc}    0   Failed Validate ONU Devices because of ${output}
@@ -377,7 +380,7 @@
     ...    ${List_ONU_Serial}   ${startTime}    ${print2console}=False    ${output_file}=${EMPTY}
     ${type} =    Set Variable    brcm_openomci_onu
     ${voltctl_commad} =    Catenate    SEPARATOR=
-        ...    voltctl device list -m 32MB -f Type=${type} -f Reason=${onu_reason} --format '{{.SerialNumber}}'
+        ...    voltctl device list -m ${voltctlGrpcLimit} -f Type=${type} -f Reason=${onu_reason} --format '{{.SerialNumber}}'
     ${rc}    ${output}=    Run and Return Rc and Output    ${voltctl_commad}
     Should Be Equal As Integers    ${rc}    0
     ${timeCurrent} =    Get Current Date
@@ -403,7 +406,7 @@
     [Documentation]
     ...    Parses the output of "voltctl device list" filtered by device id and inspects states including reason.
     [Arguments]    ${admin_state}    ${oper_status}    ${connect_status}    ${onu_reason}    ${onu_id}
-    ${cmd}    Catenate    voltctl -c ${VOLTCTL_CONFIG} device list --filter=Id=${onu_id} -m 32MB -o json
+    ${cmd}    Catenate    voltctl -c ${VOLTCTL_CONFIG} device list --filter=Id=${onu_id} -m ${voltctlGrpcLimit} -o json
     ${rc}    ${output}=    Run and Return Rc and Output    ${cmd}
     Should Be Equal As Integers    ${rc}    0
     ${jsondata}=    To Json    ${output}
@@ -445,7 +448,7 @@
 Check all ONU OperStatus
     [Documentation]     Checks that all ONUs OperStatus is the required one.
     [Arguments]     ${List_ONU_Serial}   ${oper_status}
-    ${cmd}=    Catenate    voltctl -c ${VOLTCTL_CONFIG} device list -m 32MB -f Type=brcm_openomci_onu
+    ${cmd}=    Catenate    voltctl -c ${VOLTCTL_CONFIG} device list -m ${voltctlGrpcLimit} -f Type=brcm_openomci_onu
     ...    --format "{{.SerialNumber}}\t{{.AdminState}}\t{{.OperStatus}}\t{{.ConnectStatus}}\t{{.Reason}}"
     ...     | grep -v SERIALNUMBER | grep ${oper_status}
     ${rc}    ${output}=    Run and Return Rc and Output    ${cmd}
@@ -821,7 +824,7 @@
     [Arguments]    ${count}
     [Documentation]    Check that a certain number of devices reached the ACTIVE/ENABLE state
     ${rc1}    ${devices}=    Run and Return Rc and Output
-    ...     voltctl -c ${VOLTCTL_CONFIG} -m 32MB device list | grep -v OLT | grep ACTIVE | wc -l
+    ...     voltctl -c ${VOLTCTL_CONFIG} -m ${voltctlGrpcLimit} device list | grep -v OLT | grep ACTIVE | wc -l
     Should Be Equal As Integers    ${rc1}    0
     Should Be Equal As Integers    ${devices}    ${count}
 
@@ -838,7 +841,7 @@
     ${total_flows}=     Set Variable    0
     FOR     ${device}   IN  @{logical_devices}
         ${rc}    ${flows}=    Run and Return Rc and Output
-        ...    voltctl -c ${VOLTCTL_CONFIG} logicaldevice flows ${device['id']} | grep -v ID | wc -l
+        ...    voltctl -m ${voltctlGrpcLimit} -c ${VOLTCTL_CONFIG} logicaldevice flows ${device['id']} | grep -v ID | wc -l
         Should Be Equal As Integers    ${rc}    0
         ${total_flows}=     Evaluate    ${total_flows} + ${flows}
     END
@@ -865,7 +868,7 @@
     ${total_flows}=     Set Variable    0
     FOR     ${device}   IN  @{devices}
         ${rc}    ${flows}=    Run and Return Rc and Output
-        ...     voltctl -c ${VOLTCTL_CONFIG} device flows ${device['id']} | grep -v ID | wc -l
+        ...     voltctl -m ${voltctlGrpcLimit} -c ${VOLTCTL_CONFIG} device flows ${device['id']} | grep -v ID | wc -l
         Should Be Equal As Integers    ${rc}    0
         ${total_flows}=     Evaluate    ${total_flows} + ${flows}
     END
@@ -981,7 +984,7 @@
 Assert ONUs Image Status in Voltha
     [Arguments]    ${onu_count}    ${image_version}    ${download_state}    ${expected_reason}    ${image_state}
     [Documentation]    Check that a certain number of devices reached the given image status
-    ${cmd}=    Catenate    voltctl -c ${VOLTCTL_CONFIG} -m 32MB device onuimage status ${image_version}
+    ${cmd}=    Catenate    voltctl -c ${VOLTCTL_CONFIG} -m ${voltctlGrpcLimit} device onuimage status ${image_version}
     ...    | grep ${download_state} | grep ${expected_reason} | grep ${image_state} | wc -l
     ${rc}    ${count}=    Run and Return Rc and Output    ${cmd}
     Should Be Equal As Integers    ${rc}    0