Fix for cpu inventory path for Get_a_Property test case
Why the test case failing:
- The URL for CPU is not same for Barreleye and Palmetto.
This fix includes:
- Enumerates the inventory to find cpu URL path
- Removed this test from skip list
- Added keywork in utils.robot to get url paths ending
particular string
Resolves openbmc/openbmc-test-automation#208
Change-Id: I59c1969ad01a6aee88af99aa7ccc7a46359584f1
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 5d95454..b7134a1 100644
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -486,3 +486,21 @@
:FOR ${var} IN Range 1 4
\ BMC Mem Performance check
+Get Endpoint Paths
+ [Documentation] Returns all url paths ending with given endpoint
+ ... Example:
+ ... Given the following endpoint: cpu
+ ... This keyword will return: list of all urls ending with cpu -
+ ... /org/openbmc/inventory/system/chassis/motherboard/cpu0,
+ ... /org/openbmc/inventory/system/chassis/motherboard/cpu1
+ ... Description of arguments:
+ ... path URL path for enumeration
+ ... endpoint string for which url path ending
+ [Arguments] ${path} ${endpoint}
+
+ ${resp}= Read Properties ${path}/enumerate timeout=30
+ log Dictionary ${resp}
+
+ ${list}= Get Dictionary Keys ${resp}
+ ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${endpoint}[0-9]*$
+ [return] ${resp}
diff --git a/test_lists/skip_test_palmetto b/test_lists/skip_test_palmetto
index cdd8f09..52003be 100644
--- a/test_lists/skip_test_palmetto
+++ b/test_lists/skip_test_palmetto
@@ -27,8 +27,6 @@
-e Verify_DIMM_VPD_Properties
#https://github.com/openbmc/openbmc/issues/740
-e Test_BIOS_Version
-#https://github.com/openbmc/openbmc-test-automation/issues/208
--e Get_a_Property
#https://github.com/openbmc/openbmc-test-automation/issues/207
-e Disable_PowerCap
#https://github.com/openbmc/openbmc-test-automation/issues/110
diff --git a/tests/test_obmcrest.robot b/tests/test_obmcrest.robot
index 5a6dfb6..10eb871 100644
--- a/tests/test_obmcrest.robot
+++ b/tests/test_obmcrest.robot
@@ -24,8 +24,10 @@
Get a Property
[Tags] Get_a_Property
- ${resp}= Read Attribute /org/openbmc/inventory/system/chassis/motherboard/cpu0 is_fru
- Should Be Equal ${resp} ${1}
+ ${url_list}= Get Endpoint Paths ${OPENBMC_BASE_URI}inventory cpu
+ ${url}= Get From List ${url_list} 0
+ ${resp}= Read Attribute ${url} is_fru
+ Should Be Equal ${resp} ${1}
Get a null Property
${resp}= OpenBMC Get Request /org/openbmc/inventory/attr/is_fru