Fix Get OMCC Version
Change-Id: Idb67d469acb4311a6e58750b8ede64d044f87ca4
diff --git a/libraries/bbsim.robot b/libraries/bbsim.robot
index 9fed918..7333268 100755
--- a/libraries/bbsim.robot
+++ b/libraries/bbsim.robot
@@ -162,7 +162,9 @@
Should Be Equal as Integers ${rc} 0
Should Not Be Empty ${output} Unable to read OMCC Version
${output}= Remove String ${output} " [ ]
- @{commands}= Split String ${output} ,
+ ${is_comma_separated}= Evaluate "," in """${output}"""
+ @{commands}= Run Keyword If ${is_comma_separated} Split String ${output} ,
+ ... ELSE Split String ${output}
${length}= Get Length ${commands}
${match}= Set Variable False
FOR ${I} IN RANGE 0 ${length}
diff --git a/tests/software-upgrades/ONU_Upgrade.robot b/tests/software-upgrades/ONU_Upgrade.robot
index fdf3227..2c1c331 100755
--- a/tests/software-upgrades/ONU_Upgrade.robot
+++ b/tests/software-upgrades/ONU_Upgrade.robot
@@ -723,9 +723,11 @@
Do ONU Upgrade Compare OMCI Message Version
[Documentation] This keyword performs the ONU Upgrade Compare OMCI Message Version test for the first OLT/ONU
[Arguments] ${activate_on_success}=${image_activate_on_success} ${commit_on_success}=${image_commit_on_success}
- [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' Remove Adapter Image ${image_version} ${onu_device_id}
- ${firstonu}= Set Variable 0
- ${outputfile}= Set variable ${OUTPUTDIR}/ONU_SW_Upgrade_Time.txt
+ [Teardown] Run Keyword If '${KEYWORD STATUS}'=='FAIL' and '${onu_device_id}'!='${EMPTY}'
+ ... Remove Adapter Image ${image_version} ${onu_device_id}
+ ${onu_device_id}= Set Variable ${EMPTY}
+ ${firstonu}= Set Variable 0
+ ${outputfile}= Set variable ${OUTPUTDIR}/ONU_SW_Upgrade_Time.txt
${omcc_version} ${is_omcc_extended}= Get BBSIM OMCC Version ${NAMESPACE}
# Restart BBSIM with OMCI Baseline Message if needed
Create File ${outputfile} This file contains the SW Upgrade download durations