[VOL-3844] Test for ONOS apps minor version upgrade
[VOL-3843] Test for Voltha components minor version upgrade

Change-Id: Iae981056d92c461d67419ef3a1107c86a5aa231b
diff --git a/Makefile b/Makefile
index 569f207..2e23ddf 100755
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,7 @@
 ROBOT_SANITY_TT_SINGLE_PON_FILE    ?= $(ROOT_DIR)/tests/data/bbsim-kind-tt.yaml
 ROBOT_DMI_SINGLE_BBSIM_FILE     ?= $(ROOT_DIR)/tests/data/dmi-components-bbsim.yaml
 ROBOT_DMI_SINGLE_ADTRAN_FILE     ?= $(ROOT_DIR)/tests/data/dmi-components-adtran.yaml
+ROBOT_ONOS_APP_UPGRADE_FILE     ?= $(ROOT_DIR)/tests/data/onos-app-upgrade.yaml
 
 # for backwards compatibility
 sanity-kind: sanity-single-kind
@@ -315,6 +316,25 @@
 	cd tests/dmi-interface ;\
 	robot -V $(ROBOT_CONFIG_FILE) $(ROBOT_MISC_ARGS) $(ROBOT_FILE)
 
+# ONOS Apps to test for Software Upgrade need to be passed in the 'onos_apps_under_test' variable in format:
+# <app-name>,<version>,<oar-url>*<app-name>,<version>,<oar-url>
+onos-app-upgrade-test: ROBOT_MISC_ARGS +=  -e notready -i functional
+onos-app-upgrade-test: ROBOT_FILE := ONOS_AppsUpgrade.robot
+onos-app-upgrade-test: ROBOT_CONFIG_FILE := $(ROBOT_ONOS_APP_UPGRADE_FILE)
+onos-app-upgrade-test: software-upgrade-test
+
+# Voltha Components to test for Software Upgrade need to be passed in the 'voltha_comps_under_test' variable in format:
+# <comp-label>,<comp-container>,<comp-image>*<comp-label>,<comp-container>,<comp-image>
+voltha-comp-upgrade-test: ROBOT_MISC_ARGS +=  -e notready -i functional
+voltha-comp-upgrade-test: ROBOT_FILE := Voltha_ComponentsUpgrade.robot
+voltha-comp-upgrade-test: ROBOT_CONFIG_FILE := $(ROBOT_ONOS_APP_UPGRADE_FILE)
+voltha-comp-upgrade-test: software-upgrade-test
+
+software-upgrade-test: vst_venv
+	source ./$</bin/activate ; set -u ;\
+	cd tests/software-upgrades ;\
+	robot -V $(ROBOT_CONFIG_FILE) $(ROBOT_MISC_ARGS) $(ROBOT_FILE)
+
 voltha-dt-test: ROBOT_MISC_ARGS += -e notready
 
 voltha-dt-test: vst_venv
diff --git a/libraries/k8s.robot b/libraries/k8s.robot
index 63b9efe..a8312e6 100755
--- a/libraries/k8s.robot
+++ b/libraries/k8s.robot
@@ -351,7 +351,7 @@
     [Arguments]    ${namespace}    ${key}    ${value}
     [Documentation]    Uses kubectl to scale a deployment given the app name of the pod
     ${rc}    ${name}    Run And Return Rc And Output
-    ...    kubectl describe rs -n ${namespace} -l ${key}=${value} | grep "Controlled By" | awk -F'/' '{print $2}'
+    ...    kubectl describe rs -n ${namespace} -l ${key}=${value} | grep "Controlled By" | awk -F'/' '{print $2}' | awk 'FNR == 1'
     Should Be Equal as Integers    ${rc}    0
     [Return]    ${name}
 
@@ -461,3 +461,38 @@
     ${rc}    ${count}    Run and Return Rc and Output
     ...    kubectl -n ${namespace} get pods -l ${key}=${value} -o name | wc -l
     [Return]    ${count}
+
+Get Pod Restart Count
+    [Arguments]    ${namespace}    ${name}
+    [Documentation]    Returns the restart count for the given Pod
+    ${rc}    ${count}=    Run and Return Rc and Output
+    ...    kubectl get pods -n ${namespace} | grep ${name} | awk 'NR==1{print $4}'
+    [Return]    ${count}
+
+Verify ONOS Pod Restart
+    [Arguments]    ${restarted}=True
+    [Documentation]    Verifies if any of the given ONOS instances restarted
+    ${num_onos}=    Wait Until Keyword Succeeds    20s    5s    Get Number of Running Pods Number By Label    default
+    ...    app    onos-onos-classic
+    FOR    ${I}    IN RANGE    0    ${num_onos}
+         ${onos_pod}=    Catenate    SEPARATOR=-    onos-onos-classic    ${I}
+         ${count}=    Get Pod Restart Count    default    ${onos_pod}
+         Run Keyword If    ${restarted}
+         ...    Should Not Be Equal As Integers    ${count}    0    ONOS Pod ${onos_pod} Not Restarted
+         ...    ELSE
+         ...    Should Be Equal As Integers    ${count}    0    ONOS Pod ${onos_pod} Restarted
+    END
+
+Deploy Pod New Image
+    [Arguments]    ${namespace}    ${deployment}    ${container}    ${image}
+    [Documentation]   Deploys the Pod given image
+    ${rc}    Run and Return Rc
+    ...    kubectl -n ${namespace} set image deployment/${deployment} ${container}=${image}
+    Should Be Equal as Integers    ${rc}    0
+
+Verify Pod Image
+    [Arguments]    ${namespace}    ${key}    ${value}    ${image}
+    [Documentation]    Verifies the Pod Image
+    ${output}=    Run
+    ...    kubectl -n ${namespace} get pods -l ${key}=${value} -o=jsonpath="{.items[].status.containerStatuses[].image}"
+    Should Be Equal    '${output}'    'docker.io/${image}'
diff --git a/libraries/onos.robot b/libraries/onos.robot
index e0288b3..3225d5f 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -720,3 +720,33 @@
     Should Be Equal As Integers    ${dhcp_count}    0
     # Close ONOS SSH Connection
     Close ONOS SSH Connection    ${onos_ssh_connection}
+
+Delete ONOS App
+    [Arguments]    ${url}    ${app_name}
+    [Documentation]    This keyword deactivates and uninstalls the given ONOS App
+    ${rc}=    Run And Return Rc    curl --fail -sSL -X DELETE ${url}/onos/v1/applications/${app_name}
+    Should Be Equal As Integers    ${rc}    0
+
+Verify ONOS App Active
+    [Arguments]    ${url}    ${app_name}    ${app_version}=${EMPTY}
+    [Documentation]    This keyword verifies that the given ONOS App status is Active
+    ${rc}    ${output}    Run And Return Rc And Output
+    ...    curl --fail -sSL ${url}/onos/v1/applications/${app_name} | jq -r .state
+    Should Be Equal As Integers    ${rc}    0
+    Should Be Equal    '${output}'    'ACTIVE'
+    ${rc1}    ${output1}    Run And Return Rc And Output
+    ...    curl --fail -sSL ${url}/onos/v1/applications/${app_name} | jq -r .version
+    Run Keyword If    '${app_version}'!='${EMPTY}'
+    ...    Run Keywords
+    ...    Should Be Equal As Integers    ${rc1}    0
+    ...    AND    Should Be Equal    '${output1}'    '${app_version}'
+
+Install And Activate ONOS App
+    [Arguments]    ${url}    ${app_oar_file}
+    [Documentation]    This keyword installs and activates the given ONOS App
+    ${cmd}=    Catenate    SEPARATOR=
+    ...    curl --fail -sSL -H Content-Type:application/octet-stream -
+    ...    X POST ${url}/onos/v1/applications?activate=true --data-binary \@${app_oar_file}
+    ${rc}    ${output}    Run And Return Rc And Output    ${cmd}
+    Should Be Equal As Integers    ${rc}    0
+    Log    ${output}
diff --git a/tests/data/onos-app-upgrade.yaml b/tests/data/onos-app-upgrade.yaml
new file mode 100644
index 0000000..30c4061
--- /dev/null
+++ b/tests/data/onos-app-upgrade.yaml
@@ -0,0 +1,53 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Automated deployment configuration for kind-voltha running BBSim
+
+# Change default values in tests
+has_dataplane: false
+# teardown_device: true
+ONOS_REST_PORT: 8181
+ONOS_SSH_PORT: 8101
+OLT_PORT: 50060
+
+nodes:
+  -
+    ip: '127.0.0.1'
+
+olts:
+  -
+    ip: bbsim0
+    serial: BBSIM_OLT_10
+
+hosts:
+  src:
+    -
+      onu: 'BBSM000a0001'
+      olt: 'BBSIM_OLT_10'
+      c_tag: '900'
+      s_tag: '900'
+
+  dst:
+    - ip: null
+
+onos_apps:
+  - org.opencord.sadis
+  - org.opencord.olt
+  - org.opencord.mcast
+  - org.opencord.igmpproxy
+  - org.opencord.dhcpl2relay
+  - org.opencord.kafka
+  - org.opencord.aaa
diff --git a/tests/data/onos-files/README.md b/tests/data/onos-files/README.md
new file mode 100644
index 0000000..66c46b6
--- /dev/null
+++ b/tests/data/onos-files/README.md
@@ -0,0 +1 @@
+This folder is the place holder for ONOS Apps OAR file as required by the Software-Upgrades Test
diff --git a/tests/software-upgrades/ONOS_AppsUpgrade.robot b/tests/software-upgrades/ONOS_AppsUpgrade.robot
new file mode 100644
index 0000000..e9a51e1
--- /dev/null
+++ b/tests/software-upgrades/ONOS_AppsUpgrade.robot
@@ -0,0 +1,138 @@
+# Copyright 2021 - present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation     Test ONOS Apps Software Upgrade
+Suite Setup       Setup Suite
+Test Setup        Setup
+Test Teardown     Teardown
+Suite Teardown    Teardown Suite
+Library           Collections
+Library           String
+Library           OperatingSystem
+Library           XML
+Library           RequestsLibrary
+Library           ../../libraries/DependencyLibrary.py
+Resource          ../../libraries/onos.robot
+Resource          ../../libraries/voltctl.robot
+Resource          ../../libraries/voltha.robot
+Resource          ../../libraries/utils.robot
+Resource          ../../libraries/k8s.robot
+Resource          ../../variables/variables.robot
+Resource          ../../libraries/power_switch.robot
+
+*** Variables ***
+${POD_NAME}       flex-ocp-cord
+${KUBERNETES_CONF}    ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
+${KUBERNETES_CONFIGS_DIR}    ~/pod-configs/kubernetes-configs
+#${KUBERNETES_CONFIGS_DIR}    ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
+${KUBERNETES_YAML}    ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
+${HELM_CHARTS_DIR}    ~/helm-charts
+${VOLTHA_POD_NUM}    8
+${NAMESPACE}      voltha
+# For below variable value, using deployment name as using grep for
+# parsing radius pod name, we can also use full radius pod name
+${RESTART_POD_NAME}    radius
+${timeout}        60s
+${of_id}          0
+${logical_id}     0
+${uprate}         0
+${dnrate}         0
+${has_dataplane}    True
+${teardown_device}    False
+${scripts}        ../../scripts
+
+# Per-test logging on failure is turned off by default; set this variable to enable
+${container_log_dir}    ${None}
+
+# ONOS Apps to Test for Software Upgrade need to be passed in the following variable in format:
+# <app-name>,<version>,<oar-url>*<app-name>,<version>,<oar-url>
+# Example: org.opencord.aaa,2.3.0.SNAPSHOT,
+# https://oss.sonatype.org/content/groups/public/org/opencord/aaa-app/2.3.0-SNAPSHOT/aaa-app-2.3.0-20201210.223737-1.oar
+${onos_apps_under_test}    ${EMPTY}
+
+*** Test Cases ***
+Test ONOS App Minor Version Upgrade
+    [Documentation]    Validates the ONOS App Minor Version Upgrade doesn't affect the system functionality
+    ...    Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
+    ...    Requirement: Apps to test needs to be passed in robot command variable 'onos_apps_under_test' in the format:
+    ...    <app-name>,<version>,<oar-url>*<app-name>,<version>,<oar-url>
+    ...    Check [VOL-3844] for more details
+    [Tags]    functional    ONOSAppMinorVerUpgrade
+    [Setup]    Run Keywords    Start Logging    ONOSAppMinorVerUpgrade
+    ...        AND    Setup
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Stop Logging    ONOSAppMinorVerUpgrade
+    ...           AND             Delete All Devices and Verify
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
+    ${onos_url}=    Set Variable    http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT}
+    ${num_apps_under_test}=    Get Length    ${list_onos_apps_under_test}
+    FOR    ${I}    IN RANGE    0    ${num_apps_under_test}
+        ${app}=    Set Variable    ${list_onos_apps_under_test}[${I}][app]
+        ${version}=    Set Variable    ${list_onos_apps_under_test}[${I}][version]
+        ${url}=    Set Variable    ${list_onos_apps_under_test}[${I}][url]
+        ${oar_file}=    Set Variable    ${CURDIR}/../../tests/data/onos-files/${app}-${version}.oar
+        Download App OAR File    ${url}    ${oar_file}
+        Delete ONOS App    ${onos_url}    ${app}
+        Verify ONOS Apps Active Except App Under Test    ${onos_url}    ${app}
+        Install And Activate ONOS App    ${onos_url}    ${oar_file}
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Verify ONOS App Active    ${onos_url}    ${app}    ${version}
+        Verify ONOS Pod Restart    False
+        Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test    True
+    END
+    # Additional Verification
+    Wait Until Keyword Succeeds    ${timeout}    2s    Delete All Devices and Verify
+    Setup
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
+
+*** Keywords ***
+Setup Suite
+    [Documentation]    Set up the test suite
+    Common Test Suite Setup
+    Create ONOS Apps Under Test List
+
+Verify ONOS Apps Active Except App Under Test
+    [Documentation]    Verifies all the apps defined in input yaml are active except for the app under test
+    [Arguments]    ${onos_url}    ${app_under_test}
+    ${num_onos_apps}=    Get Length    ${onos_apps}
+    FOR    ${I}    IN RANGE    0    ${num_onos_apps}
+        Continue For Loop If    '${app_under_test}'=='${onos_apps}[${I}]'
+        Verify ONOS App Active    ${onos_url}    ${onos_apps}[${I}]
+    END
+
+Download App OAR File
+    [Documentation]    This keyword downloads the app oar file from the given url to the specified location
+    [Arguments]    ${oar_url}    ${oar_file}
+    ${rc}    Run And Return Rc    curl -L ${oar_url} > ${oar_file}
+    Should Be Equal As Integers    ${rc}    0
+
+Create ONOS Apps Under Test List
+    [Documentation]    Creates a list of ONOS Apps to Test from the input variable string
+    ...    The input string is expected to be in format:
+    ...    <app-name>,<version>,<oar-url>*<app-name>,<version>,<oar-url>
+    ${list_onos_apps_under_test}    Create List
+    @{apps_under_test_arr}=    Split String    ${onos_apps_under_test}    *
+    ${num_apps_under_test}=    Get Length    ${apps_under_test_arr}
+    FOR    ${I}    IN RANGE    0    ${num_apps_under_test}
+        @{app_under_test_arr}=    Split String    ${apps_under_test_arr[${I}]}    ,
+        ${app}=    Set Variable    ${app_under_test_arr[0]}
+        ${version}=    Set Variable    ${app_under_test_arr[1]}
+        ${url}=    Set Variable    ${app_under_test_arr[2]}
+        ${app_under_test}    Create Dictionary    app    ${app}    version    ${version}    url    ${url}
+        Append To List    ${list_onos_apps_under_test}    ${app_under_test}
+    END
+    Set Suite Variable    ${list_onos_apps_under_test}
diff --git a/tests/software-upgrades/Voltha_ComponentsUpgrade.robot b/tests/software-upgrades/Voltha_ComponentsUpgrade.robot
new file mode 100755
index 0000000..53d303f
--- /dev/null
+++ b/tests/software-upgrades/Voltha_ComponentsUpgrade.robot
@@ -0,0 +1,135 @@
+# Copyright 2021 - present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# FIXME Can we use the same test against BBSim and Hardware?
+
+*** Settings ***
+Documentation     Test Voltha Components Software Upgrade
+Suite Setup       Setup Suite
+Test Setup        Setup
+Test Teardown     Teardown
+Suite Teardown    Teardown Suite
+Library           Collections
+Library           String
+Library           OperatingSystem
+Library           XML
+Library           RequestsLibrary
+Library           ../../libraries/DependencyLibrary.py
+Resource          ../../libraries/onos.robot
+Resource          ../../libraries/voltctl.robot
+Resource          ../../libraries/voltha.robot
+Resource          ../../libraries/utils.robot
+Resource          ../../libraries/k8s.robot
+Resource          ../../variables/variables.robot
+Resource          ../../libraries/power_switch.robot
+
+*** Variables ***
+${POD_NAME}       flex-ocp-cord
+${KUBERNETES_CONF}    ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
+${KUBERNETES_CONFIGS_DIR}    ~/pod-configs/kubernetes-configs
+#${KUBERNETES_CONFIGS_DIR}    ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
+${KUBERNETES_YAML}    ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
+${HELM_CHARTS_DIR}    ~/helm-charts
+${VOLTHA_POD_NUM}    8
+${NAMESPACE}      voltha
+# For below variable value, using deployment name as using grep for
+# parsing radius pod name, we can also use full radius pod name
+${RESTART_POD_NAME}    radius
+${timeout}        60s
+${of_id}          0
+${logical_id}     0
+${has_dataplane}    True
+${teardown_device}    False
+${scripts}        ../../scripts
+
+# Per-test logging on failure is turned off by default; set this variable to enable
+${container_log_dir}    ${None}
+
+${suppressaddsubscriber}    True
+
+# Voltha Components to Test for Software Upgrade need to be passed in the following variable in format:
+# <comp-label>,<comp-container>,<comp-image>*<comp-label>,<comp-container>,<comp-image>
+# Example: adapter-open-olt,adapter-open-olt,voltha/voltha-openolt-adapter:3.1.3
+${voltha_comps_under_test}    ${EMPTY}
+
+*** Test Cases ***
+Test Voltha Components Minor Version Upgrade
+    [Documentation]    Validates the Voltha Components Minor Version Upgrade doesn't affect the system functionality
+    ...    Performs the sanity and verifies all the ONUs are authenticated/DHCP/pingable
+    ...    Requirement: Components to test needs to be passed in robot command variable 'voltha_comps_under_test' in the format:
+    ...    <comp-label>,<comp-container>,<comp-image>*<comp-label>,<comp-container>,<comp-image>
+    ...    Check [VOL-3843] for more details
+    [Tags]    functional   VolthaCompMinorVerUpgrade
+    [Setup]    Start Logging    VolthaCompMinorVerUpgrade
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Stop Logging    VolthaCompMinorVerUpgrade
+    ...           AND             Delete All Devices and Verify
+    # Add OLT device
+    Setup
+    # Performing Sanity Test to make sure subscribers are all DHCP and pingable
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
+    ${podStatusOutput}=    Run    kubectl get pods -n ${NAMESPACE}
+    Log    ${podStatusOutput}
+    ${countBeforeUpgrade}=    Run    kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
+    ${num_comps_under_test}=    Get Length    ${list_voltha_comps_under_test}
+    FOR    ${I}    IN RANGE    0    ${num_comps_under_test}
+        ${label}=    Set Variable    ${list_voltha_comps_under_test}[${I}][label]
+        ${container}=    Set Variable    ${list_voltha_comps_under_test}[${I}][container]
+        ${image}=    Set Variable    ${list_voltha_comps_under_test}[${I}][image]
+        ${deployment}=    Wait Until Keyword Succeeds    ${timeout}    15s
+        ...    Get K8s Deployment by Pod Label    ${NAMESPACE}    app    ${label}
+        Wait Until Keyword Succeeds    ${timeout}    15s    Deploy Pod New Image    ${NAMESPACE}    ${deployment}
+        ...    ${container}    ${image}
+        Wait Until Keyword Succeeds    ${timeout}    3s    Validate Pods Status By Label    ${NAMESPACE}
+        ...    app    ${label}    Running
+        Wait Until Keyword Succeeds    ${timeout}    3s    Pods Are Ready By Label    ${NAMESPACE}    app    ${label}
+        Wait Until Keyword Succeeds    ${timeout}    3s    Verify Pod Image    ${NAMESPACE}    app    ${label}    ${image}
+        Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test     ${suppressaddsubscriber}
+    END
+    ${podStatusOutput}=    Run    kubectl get pods -n ${NAMESPACE}
+    Log    ${podStatusOutput}
+    ${countAfterUpgrade}=    Run    kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
+    Should Be Equal As Strings    ${countAfterUpgrade}    ${countBeforeUpgrade}
+    # Additional Verification
+    Wait Until Keyword Succeeds    ${timeout}    2s    Delete All Devices and Verify
+    Setup
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    Wait Until Keyword Succeeds    ${timeout}    2s    Perform Sanity Test
+
+*** Keywords ***
+Setup Suite
+    [Documentation]    Set up the test suite
+    Common Test Suite Setup
+    Create Voltha Comp Under Test List
+
+Teardown Suite
+    [Documentation]    Tear down steps for the suite
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+
+Create Voltha Comp Under Test List
+    [Documentation]    Creates a list of Voltha Components to Test from the input variable string
+    ...    The input string is expected to be in format:
+    ...    <comp-label>,<comp-container>,<comp-image>*<comp-label>,<comp-container>,<comp-image>
+    ${list_voltha_comps_under_test}    Create List
+    @{comps_under_test_arr}=    Split String    ${voltha_comps_under_test}    *
+    ${num_comps_under_test}=    Get Length    ${comps_under_test_arr}
+    FOR    ${I}    IN RANGE    0    ${num_comps_under_test}
+        @{comp_under_test_arr}=    Split String    ${comps_under_test_arr[${I}]}    ,
+        ${label}=    Set Variable    ${comp_under_test_arr[0]}
+        ${container}=    Set Variable    ${comp_under_test_arr[1]}
+        ${image}=    Set Variable    ${comp_under_test_arr[2]}
+        ${comp_under_test}    Create Dictionary    label    ${label}    container    ${container}    image    ${image}
+        Append To List    ${list_voltha_comps_under_test}    ${comp_under_test}
+    END
+    Set Suite Variable    ${list_voltha_comps_under_test}