Change from :FOR to FOR/END robot syntax
Change-Id: I984e7b17b87c23df2a4ef333a6c4938635c20747
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/ipmi/test_ipmi_user.robot b/ipmi/test_ipmi_user.robot
index c8d380f..783cde1 100644
--- a/ipmi/test_ipmi_user.robot
+++ b/ipmi/test_ipmi_user.robot
@@ -79,11 +79,11 @@
Append To List ${id_list} ${random_invalid_id}
Append To List ${id_list} 0
- :FOR ${id} IN @{id_list}
- \ ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
- \ ... user set name ${id} newuser
- \ Should Contain ${msg} User ID is limited to range
-
+ FOR ${id} IN @{id_list}
+ ${msg}= Run Keyword And Expect Error * Run IPMI Standard Command
+ ... user set name ${id} newuser
+ Should Contain ${msg} User ID is limited to range
+ END
Verify Setting IPMI User With Invalid Password
[Documentation] Verify error while setting IPMI user with invalid
@@ -430,10 +430,11 @@
Delete All Non Root IPMI User
[Documentation] Delete all non-root IPMI user.
- :FOR ${userid} IN RANGE 2 16
- \ ${user_info}= Get User Info ${userid}
- \ Run Keyword If "${user_info['user_name']}" != ""
- ... Run IPMI Standard Command user set name ${userid} ""
+ FOR ${userid} IN RANGE 2 16
+ ${user_info}= Get User Info ${userid}
+ Run Keyword If "${user_info['user_name']}" != ""
+ ... Run IPMI Standard Command user set name ${userid} ""
+ END
Test Teardown Execution
diff --git a/tests/ipmi/test_fru.robot b/tests/ipmi/test_fru.robot
index 10eb793..49dfd9d 100644
--- a/tests/ipmi/test_fru.robot
+++ b/tests/ipmi/test_fru.robot
@@ -47,11 +47,12 @@
# Get the component information for each record.
${component_frus}= Create List
- : FOR ${component_uri} IN @{component_uris}
- \ ${result}= Read Properties ${component_uri} quiet=${1}
- \ ${component}= Fetch From Right ${component_uri} /
- \ Set To Dictionary ${result} fru_device_description ${component}
- \ Append To List ${component_frus} ${result}
+ FOR ${component_uri} IN @{component_uris}
+ ${result}= Read Properties ${component_uri} quiet=${1}
+ ${component}= Fetch From Right ${component_uri} /
+ Set To Dictionary ${result} fru_device_description ${component}
+ Append To List ${component_frus} ${result}
+ END
[Return] ${component_frus}
@@ -125,18 +126,19 @@
${component_uris}= Get Matches ${inventory_uris}
... regexp=^.*[0-9a-z_].${component_name}\[0-9]*$
- : FOR ${uri} IN @{component_uris}
- \ ${sub_component}= Fetch From Right ${uri} /
- \ ${ipmi_index}= Get Index Of FRU Sub Component Info
- \ ... ${ipmi_fru_component_info} ${sub_component}
- \ ${rest_index}= Get Index Of FRU Sub Component Info
- \ ... ${rest_fru_component_info} ${sub_component}
- \ ${ipmi_fru_sub_component}=
- \ ... Get From List ${ipmi_fru_component_info} ${ipmi_index}
- \ ${rest_fru_sub_component}=
- \ ... Get From List ${rest_fru_component_info} ${rest_index}
- \ Compare IPMI And REST FRU Component Info ${ipmi_fru_sub_component}
- \ ... ${rest_fru_sub_component} ${component_name}
+ FOR ${uri} IN @{component_uris}
+ ${sub_component}= Fetch From Right ${uri} /
+ ${ipmi_index}= Get Index Of FRU Sub Component Info
+ ... ${ipmi_fru_component_info} ${sub_component}
+ ${rest_index}= Get Index Of FRU Sub Component Info
+ ... ${rest_fru_component_info} ${sub_component}
+ ${ipmi_fru_sub_component}=
+ ... Get From List ${ipmi_fru_component_info} ${ipmi_index}
+ ${rest_fru_sub_component}=
+ ... Get From List ${rest_fru_component_info} ${rest_index}
+ Compare IPMI And REST FRU Component Info ${ipmi_fru_sub_component}
+ ... ${rest_fru_sub_component} ${component_name}
+ END
Get Index Of FRU Sub Component Info
@@ -163,19 +165,19 @@
${sub_component_count}= Get Length ${fru_component_info}
${index}= Set Variable ${0}
- : FOR ${rest_fru_sub_component} IN @{fru_component_info}
- \ ${fru_component_section}=
- \ ... Get From List ${fru_component_info} ${index}
- \ # Get FRU name from IPMI's fru_device_description field.
- \ # Example "cpu0" from "cpu0 (ID 1)".
- \ ${fru_name}= Fetch From Left
- \ ... ${fru_component_section['fru_device_description']} ${SPACE}
- \ ${status}= Run Keyword And Return Status Should Be Equal
- \ ... ${fru_name} ${sub_component}
- \ Exit For Loop If '${status}' == '${True}'
- \ ${index}= Evaluate ${index} + 1
- \ Exit For Loop If ${index} >= ${sub_component_count}
-
+ FOR ${rest_fru_sub_component} IN @{fru_component_info}
+ ${fru_component_section}=
+ ... Get From List ${fru_component_info} ${index}
+ # Get FRU name from IPMI's fru_device_description field.
+ # Example "cpu0" from "cpu0 (ID 1)".
+ ${fru_name}= Fetch From Left
+ ... ${fru_component_section['fru_device_description']} ${SPACE}
+ ${status}= Run Keyword And Return Status Should Be Equal
+ ... ${fru_name} ${sub_component}
+ Exit For Loop If '${status}' == '${True}'
+ ${index}= Evaluate ${index} + 1
+ Exit For Loop If ${index} >= ${sub_component_count}
+ END
[Return] ${index}
@@ -210,11 +212,12 @@
# Get key_map from ipmi_rest_fru_field_map.
${key_map}= Set Variable ${ipmi_rest_fru_field_map['${component_name}']}
- : FOR ${ipmi_key} IN @{ipmi_rest_fru_field_map['${component_name}'].keys()}
- \ ${rest_key}= Set Variable ${key_map['${ipmi_key}']}
- \ Should Contain ${rest_fru_component_obj['${rest_key}']}
- ... ${ipmi_fru_component_obj['${ipmi_key}']}
- ... msg=Comparison failed.
+ FOR ${ipmi_key} IN @{ipmi_rest_fru_field_map['${component_name}'].keys()}
+ ${rest_key}= Set Variable ${key_map['${ipmi_key}']}
+ Should Contain ${rest_fru_component_obj['${rest_key}']}
+ ... ${ipmi_fru_component_obj['${ipmi_key}']}
+ ... msg=Comparison failed.
+ END
Test Teardown Execution
diff --git a/tests/test_inventory.robot b/tests/test_inventory.robot
index e4c7e81..96fdc7d 100644
--- a/tests/test_inventory.robot
+++ b/tests/test_inventory.robot
@@ -152,10 +152,10 @@
# The CPU properties "Present" should be boolean 1.
${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
- :FOR ${cpu_uri} IN @{cpu_list}
- \ ${present}= Read Attribute ${cpu_uri} Present
- \ Should Be True ${present}
-
+ FOR ${cpu_uri} IN @{cpu_list}
+ ${present}= Read Attribute ${cpu_uri} Present
+ Should Be True ${present}
+ END
Verify DIMM Present
[Documentation] Check if the FRU "Present" is set for DIMM's.
@@ -177,10 +177,10 @@
# The DIMM properties "Present" should be boolean 1.
${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
- :FOR ${dimm_uri} IN @{dimm_list}
- \ ${present}= Read Attribute ${dimm_uri} Present
- \ Should Be True ${present}
-
+ FOR ${dimm_uri} IN @{dimm_list}
+ ${present}= Read Attribute ${dimm_uri} Present
+ Should Be True ${present}
+ END
Verify FRU Properties
[Documentation] Verify the FRU properties fields.
@@ -310,13 +310,14 @@
# "PrettyName": ""
# },
${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core
- :FOR ${core_uri} IN @{core_list}
- \ ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${core_uri}
- \ Continue For Loop If '${status}' == '${False}'
- \ ${present}= Read Attribute ${core_uri} Present
- \ Should Be True ${present}
- ... msg=${core_uri} is functional but not present.
+ FOR ${core_uri} IN @{core_list}
+ ${status}= Run Keyword And Return Status
+ ... Check URL Property Is Functional ${core_uri}
+ Continue For Loop If '${status}' == '${False}'
+ ${present}= Read Attribute ${core_uri} Present
+ Should Be True ${present}
+ ... msg=${core_uri} is functional but not present.
+ END
Verify DIMM Functional State
@@ -339,13 +340,14 @@
# },
${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
- :FOR ${dimm_uri} IN @{dimm_list}
- \ ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${dimm_uri}
- \ Continue For Loop If '${status}' == '${False}'
- \ ${present}= Read Attribute ${dimm_uri} Present
- \ Should Be True ${present}
- ... msg=${dimm_uri} is functional but not present.
+ FOR ${dimm_uri} IN @{dimm_list}
+ ${status}= Run Keyword And Return Status
+ ... Check URL Property Is Functional ${dimm_uri}
+ Continue For Loop If '${status}' == '${False}'
+ ${present}= Read Attribute ${dimm_uri} Present
+ Should Be True ${present}
+ ... msg=${dimm_uri} is functional but not present.
+ END
Verify Fan Functional State
@@ -361,13 +363,15 @@
${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan*
Should Not Be Empty ${fan_list}
- :FOR ${fan_uri} IN @{fan_list}
- \ ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${fan_uri}
- \ Continue For Loop If '${status}' == '${False}'
- \ ${present}= Read Attribute ${fan_uri} Present
- \ Should Be True ${present}
- ... msg=${fan_uri} is functional but "Present" is not set.
+ FOR ${fan_uri} IN @{fan_list}
+ ${status}= Run Keyword And Return Status
+ ... Check URL Property Is Functional ${fan_uri}
+ Continue For Loop If '${status}' == '${False}'
+ ${present}= Read Attribute ${fan_uri} Present
+ Should Be True ${present}
+ ... msg=${fan_uri} is functional but "Present" is not set.
+ END
+
Verify CPU Functional State
[Documentation] Verify that "Present" CPU property is set if "Functional"
@@ -383,13 +387,14 @@
${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu*
Should Not Be Empty ${cpu_list}
- :FOR ${cpu_uri} IN @{cpu_list}
- \ ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${cpu_uri}
- \ Continue For Loop If '${status}' == '${False}'
- \ ${present}= Read Attribute ${cpu_uri} Present
- \ Should Be True ${present}
- ... msg=${cpu_uri} is functional but "Present" is not set.
+ FOR ${cpu_uri} IN @{cpu_list}
+ ${status}= Run Keyword And Return Status
+ ... Check URL Property Is Functional ${cpu_uri}
+ Continue For Loop If '${status}' == '${False}'
+ ${present}= Read Attribute ${cpu_uri} Present
+ Should Be True ${present}
+ ... msg=${cpu_uri} is functional but "Present" is not set.
+ END
Verify GPU Functional State
@@ -408,14 +413,14 @@
${gpu_list}= Get Endpoint Paths
... ${HOST_INVENTORY_URI}system/chassis/motherboard gv*
Should Not Be Empty ${gpu_list}
- :FOR ${gpu_uri} IN @{gpu_list}
- \ ${status}= Run Keyword And Return Status
- ... Check URL Property Is Functional ${gpu_uri}
- \ Continue For Loop If '${status}' == '${False}'
- \ ${present}= Read Attribute ${gpu_uri} Present
- \ Should Be True ${present}
- ... msg=${gpu_uri} is functional but "Present" is not set.
-
+ FOR ${gpu_uri} IN @{gpu_list}
+ ${status}= Run Keyword And Return Status
+ ... Check URL Property Is Functional ${gpu_uri}
+ Continue For Loop If '${status}' == '${False}'
+ ${present}= Read Attribute ${gpu_uri} Present
+ Should Be True ${present}
+ ... msg=${gpu_uri} is functional but "Present" is not set.
+ END
Check Air Or Water Cooled
[Documentation] Check if this system is Air or water cooled.
@@ -559,14 +564,15 @@
# /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7
${fru_list}= Create List
- :FOR ${fru_uri} IN @{system_list}
- \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable
- ... quiet=${1}
- \ ${jsondata}= To JSON ${resp.content}
- \ ${status}= Run Keyword And Return Status
- ... Should Be True ${jsondata['data']} == ${1}
- \ Run Keyword If '${status}' == '${True}'
- ... Append To List ${fru_list} ${fru_uri}
+ FOR ${fru_uri} IN @{system_list}
+ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable
+ ... quiet=${1}
+ ${jsondata}= To JSON ${resp.content}
+ ${status}= Run Keyword And Return Status
+ ... Should Be True ${jsondata['data']} == ${1}
+ Run Keyword If '${status}' == '${True}'
+ ... Append To List ${fru_list} ${fru_uri}
+ END
${fru_valid_list}= Filter GPU FRU Entries ${fru_list}
@@ -621,14 +627,15 @@
# Iterate through the url of the FRU and compare its attributes with
# the pre-defined fru_type attributes.
- :FOR ${fru_url_path} IN @{fru_list}
- \ ${fru_field}= Read Properties ${fru_url_path}
- \ ${fru_keys}= List To Set ${fru_field.viewkeys()}
- \ Rprint Vars fru_keys
- \ Run Keyword If '${comparison_type}' == 'EQU'
- ... Should Be Equal ${fru_keys} ${fru_set}
- ... ELSE
- ... Should Be True $fru_set.issubset($fru_keys)
+ FOR ${fru_url_path} IN @{fru_list}
+ ${fru_field}= Read Properties ${fru_url_path}
+ ${fru_keys}= List To Set ${fru_field.viewkeys()}
+ Rprint Vars fru_keys
+ Run Keyword If '${comparison_type}' == 'EQU'
+ ... Should Be Equal ${fru_keys} ${fru_set}
+ ... ELSE
+ ... Should Be True $fru_set.issubset($fru_keys)
+ END
Check URL Property Is Functional
@@ -698,8 +705,9 @@
${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system/
... ${item}
- : FOR ${element} IN @{list}
- \ ${present}= Read Properties ${element}
- \ ${count_inventory}= Set Variable if ${present['Present']} == 1
- \ ... ${count_inventory+1} ${count_inventory}
+ FOR ${element} IN @{list}
+ ${present}= Read Properties ${element}
+ ${count_inventory}= Set Variable if ${present['Present']} == 1
+ ... ${count_inventory+1} ${count_inventory}
+ END
[return] ${count_inventory}
diff --git a/tests/test_rest_interfaces.robot b/tests/test_rest_interfaces.robot
index 8e68695..272d5ac 100644
--- a/tests/test_rest_interfaces.robot
+++ b/tests/test_rest_interfaces.robot
@@ -342,10 +342,11 @@
... /xyz/openbmc_project/ipmi/internal/soft_power_off
${error_uri_list}= Create List
- :FOR ${uri} IN @{uri_list}
- \ ${resp}= Openbmc Get Request ${uri} quiet=${1}
- \ Run keyword if '${resp.status_code}' != '${HTTP_OK}'
- \ ... Append To List ${error_uri_list} ${uri} : ${resp.status_code}
+ FOR ${uri} IN @{uri_list}
+ ${resp}= Openbmc Get Request ${uri} quiet=${1}
+ Run keyword if '${resp.status_code}' != '${HTTP_OK}'
+ ... Append To List ${error_uri_list} ${uri} : ${resp.status_code}
+ END
Should Be Empty ${error_uri_list}