Address issue for deprecated syntax
Change from :FOR to FOR/END to address a new WARNING in
the new robot version.
Sample warning message as mention below.
FOR loop starting on line 26: For loop header
': FOR' is deprecated. Use 'FOR' instead.
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
Change-Id: I00090db867f86f58e6af98f1b5e608f5960bc1c2
diff --git a/extended/test_slp.robot b/extended/test_slp.robot
index c2b33c2..fb95aa1 100644
--- a/extended/test_slp.robot
+++ b/extended/test_slp.robot
@@ -28,10 +28,13 @@
Verify Service Agents For Service Types
[Documentation] Find And verify service agents.
[Tags] Verify_Service_Agents_For_Service_Types
+
@{parameters}= Split String ${SLP_SERVICES} ${\n}
- :FOR ${parameter} IN @{parameters}
- \ ${output}= Run SLP command ${service_agents} ${parameter}
- \ Verify Service Agents ${output} ${parameter}
+
+ FOR ${parameter} IN @{parameters}
+ ${output}= Run SLP command ${service_agents} ${parameter}
+ Verify Service Agents ${output} ${parameter}
+ END
*** Keywords ***
@@ -67,9 +70,10 @@
${file_count}= Get Line Count ${stdout}
Should Be Equal ${service_count} ${file_count}
... msg=Number of services on system & command are not equal.
- :FOR ${service} IN @{services}
- \ Should Contain ${stdout} ${service}
- ... msg=Services on system & command are not same.
+
+ FOR ${service} IN @{services}
+ Should Contain ${stdout} ${service} msg=Services on system & command are not same.
+ END
Verify Service Agents
[Documentation] Verifies the output of srvs.
diff --git a/tests/test_hardware_sensors.robot b/tests/test_hardware_sensors.robot
index 8c0d234..b1ce766 100644
--- a/tests/test_hardware_sensors.robot
+++ b/tests/test_hardware_sensors.robot
@@ -54,16 +54,14 @@
# "Value": 0
# }
- :FOR ${entry} IN @{fans}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} >= 0
- \ Run Keyword And Ignore Error
- ... Should Be True ${json["data"]["Target"]} >= 0
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
- \ Should Be True ${json["data"]["Value"]} >= 0
-
+ FOR ${entry} IN @{fans}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} >= 0
+ Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
+ Should Be True ${json["data"]["Value"]} >= 0
+ END
Verify PCIE Sensors Attributes
[Documentation] Probe PCIE attributes.
@@ -82,14 +80,14 @@
# }
- :FOR ${entry} IN @{temp_pcie}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} == -3
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- \ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
- \ Should Be True ${temp_in_DegreeC} > 0
+ FOR ${entry} IN @{temp_pcie}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} == -3
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
+ Should Be True ${temp_in_DegreeC} > 0
+ END
Verify Rail Voltage Sensors Attributes
@@ -110,14 +108,14 @@
# "Value": 5097
# },
- :FOR ${entry} IN @{temp_rail}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} == -3
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
- \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
- \ Should Be True ${volts} > 0
+ FOR ${entry} IN @{temp_rail}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} == -3
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
+ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
+ Should Be True ${volts} > 0
+ END
Verify VDN Temperature Sensors Attributes
@@ -137,15 +135,14 @@
# "Value": 3000
# }
- :FOR ${entry} IN @{temp_vdn}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} == -3
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- \ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
- \ Should Be True ${vdn_temp} > 0
-
+ FOR ${entry} IN @{temp_vdn}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} == -3
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ Should Be True ${vdn_temp} > 0
+ END
Verify VCS Temperature Sensors Attributes
[Documentation] Check vcs temperature attributes.
@@ -165,14 +162,14 @@
# },
- :FOR ${entry} IN @{temp_vcs}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} == -3
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- \ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
- \ Should Be True ${vcs_temp} > 0
+ FOR ${entry} IN @{temp_vcs}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} == -3
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ Should Be True ${vcs_temp} > 0
+ END
Verify VDD Temperature Sensors Attributes
@@ -192,14 +189,14 @@
# "Value": 4000
# }
- :FOR ${entry} IN @{temp_vdd}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} == -3
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- \ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
- \ Should Be True ${vdd_temp} > 0
+ FOR ${entry} IN @{temp_vdd}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} == -3
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ Should Be True ${vdd_temp} > 0
+ END
Verify VDDR Temperature Sensors Attributes
@@ -220,14 +217,14 @@
# "Value": 4000
# }
- :FOR ${entry} IN @{temp_vddr}
- \ ${resp}= OpenBMC Get Request ${entry}
- \ ${json}= To JSON ${resp.content}
- \ Should Be True ${json["data"]["Scale"]} == -3
- \ Should Be Equal As Strings
- ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
- \ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
- \ Should Be True ${vddr_temp} > 0
+ FOR ${entry} IN @{temp_vddr}
+ ${resp}= OpenBMC Get Request ${entry}
+ ${json}= To JSON ${resp.content}
+ Should Be True ${json["data"]["Scale"]} == -3
+ Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ Should Be True ${vddr_temp} > 0
+ END
Verify Power Redundancy Using REST
diff --git a/tests/test_ledgroup.robot b/tests/test_ledgroup.robot
index e166842..ae9290a 100644
--- a/tests/test_ledgroup.robot
+++ b/tests/test_ledgroup.robot
@@ -134,13 +134,14 @@
Should Be True ${list_length} > 0
... msg=No ${led_prefix} ${led_suffix} LED found
- :FOR ${led} IN @{led_list}
- \ Set LED State On ${led}
- \ ${resp}= Get LED State XYZ ${led}
- \ Should Be Equal ${resp} ${1}
- \ Set LED State Off ${led}
- \ ${resp}= Get LED State XYZ ${led}
- \ Should Be Equal ${resp} ${0}
+ FOR ${led} IN @{led_list}
+ Set LED State On ${led}
+ ${resp}= Get LED State XYZ ${led}
+ Should Be Equal ${resp} ${1}
+ Set LED State Off ${led}
+ ${resp}= Get LED State XYZ ${led}
+ Should Be Equal ${resp} ${0}
+ END
Setup The Suite
[Documentation] Test setup before running this suite.
@@ -159,9 +160,10 @@
... ${LED_GROUPS} regexp=^.*[0-9a-z_].${led_prefix}.*${led_suffix}
${led_list}= Create List
- : FOR ${element} IN @{list}
- \ ${element}= Remove String ${element} ${LED_GROUPS_URI}
- \ Append To List ${led_list} ${element}
+ FOR ${element} IN @{list}
+ ${element}= Remove String ${element} ${LED_GROUPS_URI}
+ Append To List ${led_list} ${element}
+ END
Sort List ${led_list}
[Return] ${led_list}