Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cFE Integration candidate: Equuleus-rc1+dev13 #2555

Merged
merged 25 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
008609b
Fix #2343, Update `CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE` macro in
thnkslprpt May 21, 2023
c92df5f
Fix #2116, Update comment re. limits of
thnkslprpt May 29, 2023
99eb3c3
Fix #2375, Use `size_t` for variables/parameters representing size
thnkslprpt Jun 15, 2023
7d7a826
Fix #2495, Remove superfluous status assignment in `CFE_SB_CreatePipe`
thnkslprpt Jan 15, 2024
550e7f7
Fix #2378, refactor SB to support additional use cases
jphickey Jun 16, 2023
1272f6d
Fix #2550, Use resource ID for validation index
jphickey Apr 18, 2024
b906671
Fix #2550, Use resource ID for dump control index
jphickey Apr 18, 2024
48dd153
Fix #2378, update for code coverage
jphickey Apr 19, 2024
9fd5a13
fix-2553-address-sanitizer-error-in-es_UT
Apr 25, 2024
0a253d9
Merge pull request #2551 from jphickey:fix-2550-tbl-val-dump-resourceid
dzbaker May 2, 2024
64b6837
Merge pull request #2381 from jphickey:fix-2378-sb-refactor
dzbaker May 2, 2024
ef14d5a
Merge pull request #2537 from jphickey:fix-2536-msgapi-buffer
dzbaker May 2, 2024
e346973
Updating documentation and version numbers for equuleus-rc1+dev141
dzbaker May 6, 2024
374d851
Fix #2559, Improve CFE_SB_AllocateMessageBuffer error report
skliper May 10, 2024
27fba65
Fix #2529, Reduces CFE_EVS_MAX_PORT_MSG_LENGTH to prevent new line ch…
May 22, 2024
0dc799d
Fix #2552, Adds JSC 2.1 Static Analysis comments
Jun 13, 2024
ab69280
Merge pull request #2560 from skliper:fix2559-improve_allocatemsg_err…
dzbaker Jul 1, 2024
319dac1
Merge pull request #2344 from thnkslprpt:fix-2343-update-syslog-macro
dzbaker Jul 1, 2024
cb2762e
Merge pull request #2359 from thnkslprpt:fix-2116-update-documentatio…
dzbaker Jul 1, 2024
6059459
Merge pull request #2376 from thnkslprpt:fix-2375-use-size-t-for-size…
dzbaker Jul 1, 2024
d6bfc2f
Merge pull request #2496 from thnkslprpt:fix-2495-remove-superflous-s…
dzbaker Jul 1, 2024
4990c4e
Merge pull request #2554 from avan989:Fix-2553-address-sanitizer
dzbaker Jul 1, 2024
653c058
Merge pull request #2568 from chillfig:SA_jsc2_1
dzbaker Jul 1, 2024
6b40010
Merge pull request #2566 from chillfig:portTruncation
dzbaker Jul 1, 2024
0c7b073
Updating documentation and version numbers for equuleus-rc1+dev163
dzbaker Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:

- name: Confirm Minimum Coverage
run: |
missed_branches=50
missed_lines=17
missed_branches=39
missed_lines=19
branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*")
line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*")

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Development Build: equuleus-rc1+dev141
- use resourceids for internal table validation and dump control blocks
- refactor SB to support additional use cases
- msg api test buffer overrun
- See <2551>, <2381>, and <2537>

## Development Build: equuleus-rc1+dev131
- add handle list operation routines
- See <https://github.com/nasa/cFE/pull/2548>
Expand Down
124 changes: 77 additions & 47 deletions modules/cfe_testcase/src/msg_api_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,88 +176,118 @@
"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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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))

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning test

This Boolean expression is not side-effect free.
{
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)
Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 141 /**< @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 */
Expand Down
10 changes: 10 additions & 0 deletions modules/resourceid/fsw/inc/cfe_core_resourceid_basevalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ enum

/* configuration registry */
CFE_RESOURCEID_CONFIGID_BASE_OFFSET = OS_OBJECT_TYPE_USER + 7,

/* TBL managed resources */
CFE_RESOURCEID_TBL_VALRESULTID_BASE_OFFSET = OS_OBJECT_TYPE_USER + 8,
CFE_RESOURCEID_TBL_DUMPCTRLID_BASE_OFFSET = OS_OBJECT_TYPE_USER + 9,

};

/*
Expand All @@ -92,6 +97,11 @@ enum

/* configuration registry */
CFE_CONFIGID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_CONFIGID_BASE_OFFSET),

/* TBL managed resources */
CFE_TBL_VALRESULTID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_TBL_VALRESULTID_BASE_OFFSET),
CFE_TBL_DUMPCTRLID_BASE = CFE_RESOURCEID_MAKE_BASE(CFE_RESOURCEID_TBL_DUMPCTRLID_BASE_OFFSET),

};

/** @} */
Expand Down
Loading
Loading