- summary: HPI-B.01.01/src/alarm/saHpiAlarmGet/6.c bug --> alarm/saHpiAlarmGet/6.c returns FAIL in error.
saftest_HPI-B_01_01_1_0_8: HPI-B.01.01/src/alarm/saHpiAlarmGet/6.c is incorrect. It expects SA_OK or SA_ERR_HPI_NOT_PRESENT to be returned when it attempts to get the last alarm using SAHPI_LAST_ENTRY as the AlarmId. SA_ERR_HPI_INVALID_PARAMS is the correct return value as specified by the Saf-HPI Spec.
Please see Page 86 of Saf-HPI Spec.
SA_ERR_HPI_INVALID_PARAMS is returned if
• The Alarm parameter is passed in as NULL.
• The AlarmId parameter passed is SAHPI_FIRST_ENTRY or
SAHPI_LAST_ENTRY.
Fix is as follows:
if (status == SA_ERR_HPI_INVALID_PARAMS) {
//It is unclear whether this should work.
retval = SAF_TEST_PASS;
} else {
e_print(saHpiAlarmGet,
status != SA_ERR_HPI_INVALID_PARAMS,
status);
retval = SAF_TEST_FAIL;
}