diff --git a/test_pool/base/test_b010.c b/test_pool/base/test_b010.c index 24ef24e688097f585d5b5055736ac7cbcf9664fd..0db4f49b89bd7b2fea3238b0fc44882ea981faf6 100644 --- a/test_pool/base/test_b010.c +++ b/test_pool/base/test_b010.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2019-2020, 2025, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ uint32_t base_query_notify_error_support(void) { - int32_t status; + int32_t status, optional_protocol_query_status; uint32_t rsp_msg_hdr; uint32_t cmd_msg_hdr; size_t param_count; @@ -39,28 +39,43 @@ uint32_t base_query_notify_error_support(void) VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status); message_id = BASE_NOTIFY_ERRORS; - param_count++; + param_count = 1; cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG); val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status, &return_value_count, return_values); - if (status == SCMI_NOT_FOUND) { + if (!((val_compare_status(status, SCMI_SUCCESS) == VAL_STATUS_PASS) || + (val_compare_status(status, SCMI_NOT_FOUND) == VAL_STATUS_PASS))) { val_print(VAL_PRINT_ERR, "\n BASE_NOTIFY_ERRORS not supported "); - return VAL_STATUS_SKIP; + return VAL_STATUS_FAIL; } - /* BASE NOTIFY ERRORS with invalid notify_enable should return status INVALID PARAMETERS */ + optional_protocol_query_status = status; + + /* + * if query status is SCMI_SUCCESS: + * Invalid notify_enable should return INVALID PARAMETERS + * + * if query status is SCMI_NOT_FOUND: + * Invalid notify_enable should return SCMI_PROTOCOL_ERROR due to incorrect payload size. + * Otherwise, setting param_count to zero would return SCMI_NOT_SUPPORTED. + */ val_print(VAL_PRINT_TEST, "\n [Check 2] Query notify error with invalid notify_enable"); VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status); notify_enable = INVALID_NOTIFY_ENABLE; /* Invalid notify enable value */ - param_count++; + param_count = 1; cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_NOTIFY_ERRORS, COMMAND_MSG); val_send_message(cmd_msg_hdr, param_count, ¬ify_enable, &rsp_msg_hdr, &status, &return_value_count, return_values); - if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS) - return VAL_STATUS_FAIL; + if (val_compare_status(optional_protocol_query_status, SCMI_SUCCESS) == VAL_STATUS_PASS) { + if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS) + return VAL_STATUS_FAIL; + } else { + if (val_compare_status(status, SCMI_PROTOCOL_ERROR) != VAL_STATUS_PASS) + return VAL_STATUS_FAIL; + } if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS) return VAL_STATUS_FAIL; diff --git a/test_pool/system_power/test_s007.c b/test_pool/system_power/test_s007.c index 2afe74ae6c6c75481e802eb67ee0e978b60310f5..c6a86c971efb1bc56e70474422422b9a972d352e 100644 --- a/test_pool/system_power/test_s007.c +++ b/test_pool/system_power/test_s007.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ uint32_t system_power_state_notify_invalid_parameters(void) { - int32_t status; + int32_t status, optional_protocol_query_status; uint32_t rsp_msg_hdr; uint32_t cmd_msg_hdr; size_t param_count; @@ -40,29 +40,48 @@ uint32_t system_power_state_notify_invalid_parameters(void) VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status); message_id = SYSTEM_POWER_STATE_NOTIFY; - param_count++; + param_count = 1; cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER, SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG); val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status, &return_value_count, return_values); - if (val_compare_status(status, SCMI_NOT_SUPPORTED) == VAL_STATUS_PASS) { + if (!((val_compare_status(status, SCMI_SUCCESS) == VAL_STATUS_PASS) || + (val_compare_status(status, SCMI_NOT_FOUND) == VAL_STATUS_PASS) || + (val_compare_status(status, SCMI_NOT_SUPPORTED) == VAL_STATUS_PASS))) { val_print(VAL_PRINT_ERR, "\n SYSTEM POWER STATE NOTIFY not supported "); - return VAL_STATUS_SKIP; + return VAL_STATUS_FAIL; } - val_print(VAL_PRINT_TEST, "\n [Check 2] Set power state notify invalid notify_enable"); + optional_protocol_query_status = status; + /* + * if previous query status is SCMI_SUCCESS, SCP should return SCMI_INVALID_PARAMETERS. + * if previous query status is SCMI_NOT_FOUND, SCP should return SCMI_PROTOCOL_ERROR. + * if previous query status is SCMI_NOT_SUPPORTED, SCP should return SCMI_PROTOCOL_ERROR. + * (SCP should return SCMI_NOT_SUPPORTED if we set payload size to zero.) + */ + val_print(VAL_PRINT_TEST, "\n [Check 2] Set power state notify invalid notify_enable"); VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status); parameters = INVALID_NOTIFY_EN_VAL; - param_count++; + param_count = 1; cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER, - SYSTEM_POWER_STATE_NOTIFY, COMMAND_MSG); + SYSTEM_POWER_STATE_NOTIFY, COMMAND_MSG); val_send_message(cmd_msg_hdr, param_count, ¶meters, &rsp_msg_hdr, &status, - &return_value_count, return_values); + &return_value_count, return_values); - if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS) - return VAL_STATUS_FAIL; + if (val_compare_status(optional_protocol_query_status, SCMI_SUCCESS) == VAL_STATUS_PASS) { + if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS) + return VAL_STATUS_FAIL; + } else if (val_compare_status( + optional_protocol_query_status, SCMI_NOT_SUPPORTED) == VAL_STATUS_PASS + ) { + if (val_compare_status(status, SCMI_PROTOCOL_ERROR) != VAL_STATUS_PASS) + return VAL_STATUS_FAIL; + } else { + if (val_compare_status(status, SCMI_PROTOCOL_ERROR) != VAL_STATUS_PASS) + return VAL_STATUS_FAIL; + } if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS) return VAL_STATUS_FAIL;