From 4e46fe011378f83a69a4cd31701bbed43a078323 Mon Sep 17 00:00:00 2001 From: Cody Martin Date: Fri, 8 Mar 2024 12:45:44 -0800 Subject: [PATCH 1/3] Send CMake message to stdout instead of stderr --- cmake/arch_build.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index e152d7182..557d0e195 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -820,7 +820,7 @@ function(process_arch SYSVAR) if (FILESRC) # In case the file is a symlink, follow it to get to the actual file get_filename_component(FILESRC "${FILESRC}" REALPATH) - message("NOTE: Selected ${FILESRC} as source for ${INSTFILE} on ${TGTNAME}") + message(STATUS "NOTE: Selected ${FILESRC} as source for ${INSTFILE} on ${TGTNAME}") install(FILES ${FILESRC} DESTINATION ${TGTNAME}/${INSTALL_SUBDIR} RENAME ${INSTFILE}) else(FILESRC) message("WARNING: Install file ${INSTFILE} for ${TGTNAME} not found") From 24a2b21d3d0c58f3a66efff10be7ced2c4c973f4 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 18 Apr 2024 11:23:57 -0400 Subject: [PATCH 2/3] Fix #2536, rework msg API test for secondary headers For secondary header checks, different functions may (or may not) be implemented on commands vs telemetry. The functional test must not assume one or the other is implemented. It should dynamically check both checksum and timestamp based on the return value of the API call. --- modules/cfe_testcase/src/msg_api_test.c | 124 +++++++++++++++--------- 1 file changed, 77 insertions(+), 47 deletions(-) diff --git a/modules/cfe_testcase/src/msg_api_test.c b/modules/cfe_testcase/src/msg_api_test.c index 5eaa91599..435242dcb 100644 --- a/modules/cfe_testcase/src/msg_api_test.c +++ b/modules/cfe_testcase/src/msg_api_test.c @@ -176,88 +176,118 @@ void TestMsgHeaderSecondaryApi(void) "CFE_MSG_GetFcnCode, CFE_MSG_GetMsgTime, CFE_MSG_SetMsgTime "); /* declare local vars */ - CFE_MSG_CommandHeader_t cmd; - CFE_MSG_CommandHeader_t cmdTlm; - CFE_MSG_CommandHeader_t cmd2; - CFE_MSG_FcnCode_t fcnCode; - CFE_TIME_SysTime_t msgTime; - bool isValid = true; - CFE_TIME_SysTime_t currentTime = {1000, 0xFFFF0000}; - CFE_Status_t status; + CFE_MSG_CommandHeader_t cmd; + CFE_MSG_TelemetryHeader_t tlm; + CFE_MSG_FcnCode_t fcnCode; + CFE_TIME_SysTime_t msgTime; + bool isValid = true; + CFE_TIME_SysTime_t currentTime = {1000, 0xFFFF0000}; memset(&cmd, 0, sizeof(cmd)); - memset(&cmdTlm, 0xFF, sizeof(cmdTlm)); - memset(&cmd2, 0xFF, sizeof(cmd2)); + memset(&tlm, 0, sizeof(tlm)); /* msg-init */ UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(1), sizeof(cmd)), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd), true), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Cmd), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmdTlm), CFE_SB_ValueToMsgId(2), sizeof(cmdTlm)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmdTlm), true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmdTlm), CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(tlm), CFE_SB_ValueToMsgId(2), sizeof(tlm)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(tlm), true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(tlm), CFE_MSG_Type_Tlm), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd2), CFE_SB_ValueToMsgId(3), sizeof(cmd2)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(CFE_MSG_PTR(cmd2), true), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd2), CFE_MSG_Type_Cmd), CFE_SUCCESS); + /* test generate-checksum on commands */ + CFE_Assert_STATUS_STORE(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid)); + if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) + { + UtAssert_BOOL_FALSE(isValid); /* assuming a zero'ed out struct will have an invalid checksum */ - /* test generate-checksum */ - status = CFE_MSG_GenerateChecksum(NULL); - if (status == CFE_MSG_NOT_IMPLEMENTED) + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS); + UtAssert_BOOL_TRUE(isValid); + } + else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE)) { - UtAssert_NA("CFE_MSG_GenerateChecksum not implemented"); + UtAssert_NA("CFE_MSG_GenerateChecksum does not operate on commands"); } else { - UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmdTlm)), CFE_MSG_WRONG_MSG_TYPE); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmdTlm), &isValid), CFE_MSG_WRONG_MSG_TYPE); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(NULL, &isValid), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmdTlm), NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_NA("CFE_MSG_GenerateChecksum on commands not implemented"); + CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED); + } - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS); - UtAssert_True(!isValid, "Checksum isValid (%d) = false", isValid); - UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(cmd)), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(cmd), &isValid), CFE_SUCCESS); - UtAssert_True(isValid, "Checksum isValid (%d) = true", isValid); + /* test generate-checksum on telemetry */ + CFE_Assert_STATUS_STORE(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(tlm), &isValid)); + if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) + { + UtAssert_BOOL_FALSE(isValid); /* assuming a zero'ed out struct will have an invalid checksum */ + + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(CFE_MSG_PTR(tlm)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(CFE_MSG_PTR(tlm), &isValid), CFE_SUCCESS); + UtAssert_BOOL_TRUE(isValid); + } + else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE)) + { + UtAssert_NA("CFE_MSG_GenerateChecksum does not operate on telemetry"); + } + else + { + UtAssert_NA("CFE_MSG_GenerateChecksum on telemetry not implemented"); + CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED); } /* test get/set-fcn-code */ UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(NULL, 4), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(cmdTlm), 4), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(tlm), 4), CFE_MSG_WRONG_MSG_TYPE); UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(NULL, &fcnCode), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmdTlm), &fcnCode), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(tlm), &fcnCode), CFE_MSG_WRONG_MSG_TYPE); UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(CFE_MSG_PTR(cmd), 4), CFE_SUCCESS); UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(CFE_MSG_PTR(cmd), &fcnCode), CFE_SUCCESS); UtAssert_INT32_EQ(fcnCode, 4); /* test get/set-msg-time */ - UtAssert_INT32_EQ(CFE_MSG_SetType(CFE_MSG_PTR(cmd), CFE_MSG_Type_Tlm), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(NULL, &msgTime), CFE_MSG_BAD_ARGUMENT); - UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(tlm), NULL), CFE_MSG_BAD_ARGUMENT); - CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd2), &msgTime)); - if (!CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) + /* Check if GetMsgTime is implemented on commands */ + CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime)); + if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) { - CFE_Assert_STATUS_MUST_BE(CFE_MSG_WRONG_MSG_TYPE); + memset(&msgTime, 0xff, sizeof(msgTime)); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd), currentTime), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime), CFE_SUCCESS); + UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL); } - - UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(NULL, currentTime), CFE_MSG_BAD_ARGUMENT); - - CFE_Assert_STATUS_STORE(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd2), currentTime)); - if (!CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) + else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE)) + { + UtAssert_NA("CFE_MSG_GetMsgTime does not operate on commands"); + } + else { - CFE_Assert_STATUS_MUST_BE(CFE_MSG_WRONG_MSG_TYPE); + UtAssert_NA("CFE_MSG_GetMsgTime on commands not implemented"); + CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED); } - UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(cmd), currentTime), CFE_SUCCESS); - UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(cmd), &msgTime), CFE_SUCCESS); - UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL); + /* Check if GetMsgTime is implemented on telemetry */ + CFE_Assert_STATUS_STORE(CFE_MSG_GetMsgTime(CFE_MSG_PTR(tlm), &msgTime)); + if (CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS)) + { + memset(&msgTime, 0xff, sizeof(msgTime)); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(CFE_MSG_PTR(tlm), currentTime), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(CFE_MSG_PTR(tlm), &msgTime), CFE_SUCCESS); + UtAssert_UINT32_EQ(CFE_TIME_Compare(msgTime, currentTime), CFE_TIME_EQUAL); + } + else if (CFE_Assert_STATUS_MAY_BE(CFE_MSG_WRONG_MSG_TYPE)) + { + UtAssert_NA("CFE_MSG_GetMsgTime does not operate on telemetry"); + } + else + { + UtAssert_NA("CFE_MSG_GetMsgTime on telemetry not implemented"); + CFE_Assert_STATUS_MUST_BE(CFE_MSG_NOT_IMPLEMENTED); + } } void MsgApiTestSetup(void) From 4ea2b0c1309a95ebad504bca652596d6a59f440a Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 21 May 2024 08:29:45 -0400 Subject: [PATCH 3/3] Updating documentation and version numbers for equuleus-rc1+dev137 --- CHANGELOG.md | 5 +++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fd62204e..0b3db8dc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Development Build: equuleus-rc1+dev137 +- msg api test buffer overrun +- send CMake message to stdout instead of stderr +- See and + ## Development Build: equuleus-rc1+dev131 - add handle list operation routines - See diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 1ab37c239..6da2a45c2 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 131 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 137 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */ #define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ #define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */