Closed gkeishin closed 8 years ago
@tomjoseph83 can you please have a look?
Probably a little restructuring in the code should do the work.. Keeping the old sub function code and clubbing the LEDs test cases.
Example
* Test Cases * Probe If heartbeat LED Path Exist and Execute Test [Documentation] Checks if heartbeat LED exist and then execute the test set.
${resp} = OpenBMC Get Request /org/openbmc/control/led/heartbeat Should be equal as strings ${resp.status_code} ${HTTP_OK} Execute Heartbeat LEDs Test Cases
Probe If identify LED Path Exist and Execute Test [Documentation] Checks if identify LED exist and then execute the test set.
${resp} = OpenBMC Get Request /org/openbmc/control/led/identify Should be equal as strings ${resp.status_code} ${HTTP_OK} Execute Identify LEDs Test Cases
Probe If beep LED Path Exist and Execute Test [Documentation] Checks if beep LED exist and then execute the test set.
${resp} = OpenBMC Get Request /org/openbmc/control/led/beep Should be equal as strings ${resp.status_code} ${HTTP_OK} Execute Beep LEDs Test Cases
* Keywords * Execute Heartbeat LEDs Test Cases [Documentation] Executing ON/OFF/Fast/Slow Heartbeat LED test cases. Turn ON the Heartbeat LED Turn OFF the Heartbeat LED Blink Fast the Heartbeat LED Blink Slow the Heartbeat LED
Execute Identify LEDs Test Cases [Documentation] Executing ON/OFF/Fast/Slow Identify LED test cases. Turn ON the Identify LED Turn OFF the Identify LED Blink Fast the Identify LED Blink Slow the Identify LED
Execute Beep LEDs Test Cases [Documentation] Executing ON/OFF/Fast/Slow Beep LED test cases. Turn ON the Beep LED Turn OFF the Beep LED Blink Fast the Beep LED Blink Slow the Beep LED
Suggestion... we can fix this in two parts drops..
I would like to use this ticket to fix the part 1.. Let me know if that's ok with it...
The beep FRU is not available in Palmetto /org/openbmc/control/led/beep. So the test case ended failure..
So this needs to be fix as pre-req check if this FRU is available or not then proceed.
The sample psuedo code would look like as per Chris Austen input..
Get Inventory List [arguments] ${args} ${list} = Get Inventory Fru Type List ${OPENBMC_MODEL} ${args} : FOR ${element} IN @{list} \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element} \ Run Keyword If ${d['present']} == True Verify Present Properties ${args}
Verify Present Properties [arguments] ${args} ${data} = create dictionary data=@{EMPTY} ${resp} = OpenBMC Post Request /org/openbmc/sensor/led/${args} data=${data} should be equal as strings ${resp.status_code} ${HTTP_OK} ${json} = to json ${resp.content} should be equal as integers ${json['data']} 0
Here are some questions of it
${d} = Get From Dictionary ${SYSTEM_INFO} ${element}
There is no SYSTEM_INFO dictionary in the ENV or the files .. Which json dictionary we need to use or is it populated somewhere which I'm not aware of..
${data} = create dictionary data=@{EMPTY}
But I dont see it used in this particular test case.. Should we remove this ?