Fix regex expression to find list of end point objects
Change-Id: I809c09bb120ff8730bedd0d383a6554f939c4986
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.py b/lib/bmc_redfish_utils.py
index 1ce3231..8eade5f 100644
--- a/lib/bmc_redfish_utils.py
+++ b/lib/bmc_redfish_utils.py
@@ -141,7 +141,7 @@
end_point_list = self.list_request(resource_path)
# Regex to match entries ending in "/prefix" with optional underscore.
- regex = ".*/" + end_point_prefix + "[_]?[0-9]*?"
+ regex = ".*/" + end_point_prefix + "[_]?[0-9]*$"
return [x for x in end_point_list if re.match(regex, x, re.IGNORECASE)]
def get_target_actions(self, resource_path, target_attribute):
diff --git a/redfish/systems/test_systems_inventory.robot b/redfish/systems/test_systems_inventory.robot
index 915448c..d43a383 100755
--- a/redfish/systems/test_systems_inventory.robot
+++ b/redfish/systems/test_systems_inventory.robot
@@ -121,8 +121,10 @@
[Documentation] Check that the Motherboard SerialNumber is non-blank.
[Tags] Get_Motherboard_Serial_And_Verify_Populated
- ${serial_number}= Redfish.Get Attribute
- ... ${REDFISH_CHASSIS_URI}motherboard SerialNumber
+ # Python module: get_endpoint_path_list(resource_path, end_point_prefix)
+ ${motherboard_list}= redfish_utils.Get Endpoint Path List ${REDFISH_CHASSIS_URI} motherboard
+
+ ${serial_number}= Redfish.Get Attribute ${motherboard_list[0]} SerialNumber
Valid Value serial_number
Rprint Vars serial_number
@@ -131,18 +133,24 @@
[Documentation] Check that the Motherboard manufacturer is non-blank.
[Tags] Verify_Motherboard_Manufacturer_Field_Value_Populated
- ${motherboard_manufacturer}= Redfish.Get Attribute
- ... ${REDFISH_CHASSIS_URI}motherboard Manufacturer
+ # Python module: get_endpoint_path_list(resource_path, end_point_prefix)
+ ${motherboard_list}= redfish_utils.Get Endpoint Path List ${REDFISH_CHASSIS_URI} motherboard
+
+ ${motherboard_manufacturer}= Redfish.Get Attribute ${motherboard_list[0]} Manufacturer
Valid Value motherboard_manufacturer
+ Rprint Vars motherboard_manufacturer
Verify Motherboard Partnumber Field Value Populated
[Documentation] Check that the Motherboard partnumber is non-blank.
[Tags] Verify_Motherboard_Partnumber_Field_Value_Populated
- ${motherboard_part_number}= Redfish.Get Attribute
- ... ${REDFISH_CHASSIS_URI}motherboard PartNumber
+ # Python module: get_endpoint_path_list(resource_path, end_point_prefix)
+ ${motherboard_list}= redfish_utils.Get Endpoint Path List ${REDFISH_CHASSIS_URI} motherboard
+
+ ${motherboard_part_number}= Redfish.Get Attribute ${motherboard_list[0]} PartNumber
Valid Value motherboard_part_number
+ Rprint Vars motherboard_part_number
Check GPU States When Power On