[VOL-4599] Updated onu-upgrade at scale test to perform upgrade operations on all onus simultaneously

Change-Id: I486516c5c82bbb896b95d472f1c05fd8f3cb7796
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 2a85e95..f8c4fb0 100755
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -906,13 +906,13 @@
         ${dwlState}=    Get From Dictionary    ${imageState}    downloadState
         ${reason}=    Get From Dictionary    ${imageState}    reason
         ${imgStatus}=    Get From Dictionary    ${imageState}    imageState
-        Should Be Equal    '${version}'    '${image_version}'    Device ${dev_id}: '${version}' != '${image_version}'
+        Should Be Equal    '${version}'    '${image_version}'    Device ${deviceId}: '${version}' != '${image_version}'
         ...    values=False
-        Should Be Equal    '${dwlState}'    '${download_state}'    Device ${dev_id}: '${dwlState}' != '${download_state}'
+        Should Be Equal    '${dwlState}'    '${download_state}'    Device ${deviceId}: '${dwlState}' != '${download_state}'
         ...    values=False
-        Should Be Equal    '${reason}'    '${expected_reason}'    Device ${dev_id}: '${reason}' != '${expected_reason}'
+        Should Be Equal    '${reason}'    '${expected_reason}'    Device ${deviceId}: '${reason}' != '${expected_reason}'
         ...    values=False
-        Should Be Equal    '${imgStatus}'    '${image_status}'    Device ${dev_id}: '${imgStatus}' != '${image_status}'
+        Should Be Equal    '${imgStatus}'    '${image_status}'    Device ${deviceId}: '${imgStatus}' != '${image_status}'
         ...    values=False
     END
 
diff --git a/tests/scale/Voltha_Scale_Tests.robot b/tests/scale/Voltha_Scale_Tests.robot
index 9417038..67fe2b8 100755
--- a/tests/scale/Voltha_Scale_Tests.robot
+++ b/tests/scale/Voltha_Scale_Tests.robot
@@ -172,12 +172,12 @@
     ...    onu_image_name, onu_image_url, onu_image_version, onu_image_crc, onu_image_local_dir
     ...    Note: Expects the image url and other parameters to be common for all ONUs on all BBSim
     [Tags]    onu-upgrade    onu-upgrade-image-download
-    ${onu_device_ids}=    Get ONUs Device IDs from Voltha
-    FOR    ${onu_device_id}    IN    @{onu_device_ids}
-        Download ONU Device Image    ${image_version}    ${image_url}    ${image_vendor}
-        ...    ${image_activate_on_success}    ${image_commit_on_success}
-        ...    ${image_crc}    ${onu_device_id}
-    END
+    @{list_onu_device_id}=    Create List
+    ${list_onu_device_id}=    Get ONUs Device IDs from Voltha
+    ${onu_device_id_str}=    Catenate    @{list_onu_device_id}
+    Download ONU Device Image    ${image_version}    ${image_url}    ${image_vendor}
+    ...    ${image_activate_on_success}    ${image_commit_on_success}
+    ...    ${image_crc}    ${onu_device_id_str}
     ${imageState}=    Run Keyword If    '${image_activate_on_success}'=='true' and '${image_commit_on_success}'=='false'
     ...    Set Variable    IMAGE_ACTIVE
     ...    ELSE IF    '${image_activate_on_success}'=='true' and '${image_commit_on_success}'=='true'
@@ -186,10 +186,10 @@
     ${activated}=    Set Variable If    '${image_activate_on_success}'=='true'    True    False
     ${committed}=    Set Variable If    '${image_activate_on_success}'=='true' and '${image_commit_on_success}'=='true'
     ...    True    False
-    FOR    ${onu_device_id}    IN    @{onu_device_ids}
-        Wait Until Keyword Succeeds    ${timeout}    2s    Verify ONU Device Image Status    ${image_version}
-        ...    ${onu_device_id}    DOWNLOAD_SUCCEEDED    NO_ERROR    ${imageState}
-        Wait Until Keyword Succeeds    ${timeout}    2s    Verify ONU Device Image List    ${onu_device_id}
+    Wait Until Keyword Succeeds    ${timeout}    10s    Verify ONU Device Image Status    ${image_version}
+    ...    ${onu_device_id_str}    DOWNLOAD_SUCCEEDED    NO_ERROR    ${imageState}
+    FOR    ${onu_device_id}    IN    @{list_onu_device_id}
+        Wait Until Keyword Succeeds    ${timeout}    10s    Verify ONU Device Image List    ${onu_device_id}
         ...    ${image_version}    ${committed}    ${activated}    True
     END
 
@@ -200,16 +200,16 @@
     ...    Note: Expects the image url and other parameters to be common for all ONUs on all BBSim
     [Tags]    onu-upgrade    onu-upgrade-image-activate
     Pass Execution If    '${image_activate_on_success}'=='true'    Skipping test: Image activated in download stage
-    ${onu_device_ids}=    Get ONUs Device IDs from Voltha
-    FOR    ${onu_device_id}    IN    @{onu_device_ids}
-        Activate ONU Device Image    ${image_version}    ${image_commit_on_success}    ${onu_device_id}
-    END
+    @{list_onu_device_id}=    Create List
+    ${list_onu_device_id}=    Get ONUs Device IDs from Voltha
+    ${onu_device_id_str}=    Catenate    @{list_onu_device_id}
+    Activate ONU Device Image    ${image_version}    ${image_commit_on_success}    ${onu_device_id_str}
     ${imageState}=    Set Variable If    '${image_commit_on_success}'=='true'    IMAGE_COMMITTED    IMAGE_ACTIVE
     ${committed}=    Set Variable If    '${image_commit_on_success}'=='true'    True    False
-    FOR    ${onu_device_id}    IN    @{onu_device_ids}
-        Wait Until Keyword Succeeds    ${timeout}    2s    Verify ONU Device Image Status    ${image_version}
-        ...    ${onu_device_id}    DOWNLOAD_SUCCEEDED    NO_ERROR    ${imageState}
-        Wait Until Keyword Succeeds    ${timeout}    2s    Verify ONU Device Image List    ${onu_device_id}
+    Wait Until Keyword Succeeds    ${timeout}    10s    Verify ONU Device Image Status    ${image_version}
+    ...    ${onu_device_id_str}    DOWNLOAD_SUCCEEDED    NO_ERROR    ${imageState}
+    FOR    ${onu_device_id}    IN    @{list_onu_device_id}
+        Wait Until Keyword Succeeds    ${timeout}    10s    Verify ONU Device Image List    ${onu_device_id}
         ...    ${image_version}    ${committed}    True    True
     END
 
@@ -220,14 +220,14 @@
     ...    Note: Expects the image url and other parameters to be common for all ONUs on all BBSim
     [Tags]    onu-upgrade    onu-upgrade-image-commit
     Pass Execution If    '${image_commit_on_success}'=='true'    Skipping test: Image committed in download or activate stage
-    ${onu_device_ids}=    Get ONUs Device IDs from Voltha
-    FOR    ${onu_device_id}    IN    @{onu_device_ids}
-        Commit ONU Device Image    ${image_version}    ${onu_device_id}
-    END
-    FOR    ${onu_device_id}    IN    @{onu_device_ids}
-        Wait Until Keyword Succeeds    ${timeout}    2s    Verify ONU Device Image Status    ${image_version}
-        ...    ${onu_device_id}    DOWNLOAD_SUCCEEDED    NO_ERROR    IMAGE_COMMITTED
-        Wait Until Keyword Succeeds    ${timeout}    2s    Verify ONU Device Image List    ${onu_device_id}
+    @{list_onu_device_id}=    Create List
+    ${list_onu_device_id}=    Get ONUs Device IDs from Voltha
+    ${onu_device_id_str}=    Catenate    @{list_onu_device_id}
+    Commit ONU Device Image    ${image_version}    ${onu_device_id_str}
+    Wait Until Keyword Succeeds    ${timeout}    10s    Verify ONU Device Image Status    ${image_version}
+    ...    ${onu_device_id_str}    DOWNLOAD_SUCCEEDED    NO_ERROR    IMAGE_COMMITTED
+    FOR    ${onu_device_id}    IN    @{list_onu_device_id}
+        Wait Until Keyword Succeeds    ${timeout}    10s    Verify ONU Device Image List    ${onu_device_id}
         ...    ${image_version}    True    True    True
     END