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: Caelum-rc4+dev52 #2357

Merged
merged 15 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

counter=$(grep -c "BEGIN" cf/cfe_test.tmp)
echo "Waiting for CFE Tests"
sleep 60
sleep 120
done

../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Development Build: v7.0.0-rc4+dev334
- Format update for additional counters in summary
- make shared tbl configurable
- Update README_Functionaltest.md
- Increase CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC to 15
- Increase slp time in funct test workflow
- CFE_TIME_Print() calls strftime()
- Adds utassert message descriptions to README_Functionaltest.md
- See <https://github.com/nasa/cFE/pull/2350>, <https://github.com/nasa/cFE/pull/2354>, <https://github.com/nasa/cFE/pull/2355>, <https://github.com/nasa/cFE/pull/2366>, <https://github.com/nasa/cFE/pull/2364>, <https://github.com/nasa/cFE/pull/2356>, and <https://github.com/nasa/cFE/pull/2361>

## Development Build: v7.0.0-rc4+dev318
- generalize update header parameter
- add msg verify capability
Expand Down
29 changes: 26 additions & 3 deletions docs/README_functionaltest.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,33 @@ cases. It also must be loaded after `cfe_assert`.
To execute tests at startup, the following lines can be added to `cfe_es_startup.scr` on the
designated test target:

CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0;
CFE_APP, cfe_testcase, CFE_TestMain, CFE_TEST_APP, 100, 16384, 0x0, 0;
CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0;
CFE_APP, cfe_testcase, CFE_TestMain, CFE_TEST_APP, 100, 16384, 0x0, 0;
CFE_LIB, sample_lib, SAMPLE_LIB_Init, SAMPLE_LIB, 0, 0, 0x0, 0;
CFE_APP, sample_app, SAMPLE_APP_Main, SAMPLE_APP, 50, 16384, 0x0, 0;

It is important that `cfe_assert` is loaded first, as all other test applications depend on
symbols provided in this library. The order of loading other test cases should not
matter with respect to symbol resolution, but note that test apps may be executed in
a different order than they are listed in the startup script.
a different order than they are listed in the startup script. It is also worth noting
that sample_app is included in the startup script by default because the cFE functional
tests are dependent on it for requirements verification.

## Utassert messages

Below are various types of messages that can be generated by a test.

"ABORT", /**< Test sequence abort (major failure, cannot continue) */
"FAIL", /**< Test case failure status messages */
"TSF", /**< Test Setup Failure (TSF) status messages */
"TTF", /**< Test Teardown Failure (TTF) status messages */
"MIR", /**< Manual Inspection Required (MIR) status messages */
"WARN", /**< Test was unable to run (WARN) status messages (e.g. initial condition wrong) */
"N/A", /**< Test Not Applicable (NA) status messages */
"BEGIN", /**< Beginning of test status messages */
"END", /**< End of test status messages */
"INFO", /**< All other informational status messages */
"PASS", /**< Test case passed (normal) status messages */
"FLOW", /**< Other condition checks/messages that record test flow, but are not assertions */
"DEBUG", /**< Debugging messages */

7 changes: 4 additions & 3 deletions modules/cfe_assert/src/cfe_assert_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage)

void UT_BSP_EndTest(const UtAssert_TestCounter_t *TestCounters)
{

CFE_ES_WriteToSysLog("TEST COMPLETE: %u tests Segment(s) executed\n\n",
(unsigned int)TestCounters->TestSegmentCount);

/*
* Only output a "summary" if there is more than one test Segment.
* Otherwise it is a duplicate of the report already given.
Expand All @@ -134,7 +138,4 @@ void UT_BSP_EndTest(const UtAssert_TestCounter_t *TestCounters)
{
UtAssert_DoTestSegmentReport("SUMMARY", TestCounters);
}

CFE_ES_WriteToSysLog("TEST COMPLETE: %u tests Segment(s) executed\n\n",
(unsigned int)TestCounters->TestSegmentCount);
}
8 changes: 8 additions & 0 deletions modules/cfe_testcase/src/cfe_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ extern CFE_FT_Global_t CFE_FT_Global;
*/
#define CFE_ASSERT_LOG_FILE_NAME "/cf/cfe_test.log"

/**
* Name of the shared table used by CFE_TEST_APP for requirements verification
*
* This filename was made configurable such that projects can replace the
* sample app table with a project specific table for the purpose of CI/CD.
*/
#define CFE_ASSERT_SHARED_TBL_NAME "SAMPLE_APP.SampleAppTable"

void TimeInRange(CFE_TIME_SysTime_t Start, CFE_TIME_SysTime_t Time, CFE_TIME_SysTime_t Range, const char *Str);

void CFE_TestMain(void);
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_content_access_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void TestGetAddress(void)
TBL_TEST_Table_t TestTable = {1, 2};

CFE_TBL_Handle_t SharedTblHandle = CFE_TBL_BAD_TABLE_HANDLE;
const char * SharedTblName = "SAMPLE_APP.SampleAppTable";
const char * SharedTblName = CFE_ASSERT_SHARED_TBL_NAME;

UtPrintf("Testing: CFE_TBL_GetAddress");

Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_information_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void TestGetInfo(void)
void TestNotifyByMessage(void)
{
CFE_TBL_Handle_t SharedTblHandle = CFE_TBL_BAD_TABLE_HANDLE;
const char * SharedTblName = "SAMPLE_APP.SampleAppTable";
const char * SharedTblName = CFE_ASSERT_SHARED_TBL_NAME;
CFE_SB_MsgId_t TestMsgId = CFE_SB_ValueToMsgId(CFE_TEST_CMD_MID);
CFE_MSG_FcnCode_t TestCmdCode = 0;
uint32 TestParameter = 0;
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_registration_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void TestTableShare(void)
{
UtPrintf("Testing: CFE_TBL_Share");
CFE_TBL_Handle_t SharedTblHandle;
const char * SharedTblName = "SAMPLE_APP.SampleAppTable";
const char * SharedTblName = CFE_ASSERT_SHARED_TBL_NAME;
const char * BadTblName = "SampleAppTable";

UtAssert_INT32_EQ(CFE_TBL_Share(NULL, SharedTblName), CFE_TBL_BAD_ARGUMENT);
Expand Down
8 changes: 7 additions & 1 deletion modules/core_api/fsw/inc/cfe_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ CFE_Status_t CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t Callba
** - \c \\0 = trailing null
**
** \par Assumptions, External Events, and Notes:
** - This function calls strftime to format the output. Systems without this
** C99-standard function will have to write their own implementation.
** - The value of the time argument is simply added to the configuration
** definitions for the ground epoch and converted into a fixed length
** string in the buffer provided by the caller.
Expand All @@ -706,8 +708,12 @@ CFE_Status_t CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t Callba
**
** \param[in] TimeToPrint The time to print into the character array.
**
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_TIME_BAD_ARGUMENT \copybrief CFE_TIME_BAD_ARGUMENT
**
******************************************************************************/
void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint);
CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint);

/*****************************************************************************/
/**
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 318 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_NUMBER 334 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */

/* See \ref cfsversions for definitions */
Expand Down
3 changes: 2 additions & 1 deletion modules/core_api/ut-stubs/src/cfe_time_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@
* Default handler for CFE_TIME_Print coverage stub function
*
*------------------------------------------------------------*/
void UT_DefaultHandler_CFE_TIME_Print(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
CFE_Status_t UT_DefaultHandler_CFE_TIME_Print(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
{
char * PrintBuffer = UT_Hook_GetArgValueByName(Context, "PrintBuffer", char *);
CFE_TIME_SysTime_t TimeToPrint = UT_Hook_GetArgValueByName(Context, "TimeToPrint", CFE_TIME_SysTime_t);

snprintf(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE, "UT %u.%u -", (unsigned int)TimeToPrint.Seconds,
(unsigned int)TimeToPrint.Subseconds);
return CFE_SUCCESS;
}

/*------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion modules/core_api/ut-stubs/src/cfe_time_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,16 @@ uint32 CFE_TIME_Micro2SubSecs(uint32 MicroSeconds)
* Generated stub function for CFE_TIME_Print()
* ----------------------------------------------------
*/
void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint)
CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
UT_GenStub_SetupReturnBuffer(CFE_TIME_Print, CFE_Status_t);

Check warning

Code scanning / CodeQL

Uses of recursion

The function CFE_TIME_Print is indirectly recursive via this call to [UT_Stub_RegisterReturnType](1).

UT_GenStub_AddParam(CFE_TIME_Print, char *, PrintBuffer);
UT_GenStub_AddParam(CFE_TIME_Print, CFE_TIME_SysTime_t, TimeToPrint);

UT_GenStub_Execute(CFE_TIME_Print, Basic, UT_DefaultHandler_CFE_TIME_Print);

return UT_GenStub_GetReturnValue(CFE_TIME_Print, CFE_Status_t);

Check warning

Code scanning / CodeQL

Uses of recursion

The function CFE_TIME_Print is indirectly recursive via this call to [UT_Stub_GetReturnValuePtr](1).
}

/*
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/config/default_cfe_evs_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
** This number must be less than or equal to #CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST.
** Values lower than 8 may cause functional and unit test failures.
*/
#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 8
#define CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC 15

/**
** \cfeevscfg Default Event Log Filename
Expand Down
15 changes: 3 additions & 12 deletions modules/time/config/default_cfe_time_interface_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,14 @@
** \cfetimecfg Default EPOCH Values
**
** \par Description:
** Default ground time epoch values
** Default ground time epoch values (from Jan. 1, 1970 00:00:00)
** Note: these values are used only by the CFE_TIME_Print() API function
**
** \par Limits
** Year - must be within 136 years
** Day - Jan 1 = 1, Feb 1 = 32, etc.
** Hour - 0 to 23
** Minute - 0 to 59
** Second - 0 to 59
** Micros - 0 to 999999
*/
#define CFE_MISSION_TIME_EPOCH_YEAR 1980
#define CFE_MISSION_TIME_EPOCH_DAY 1
#define CFE_MISSION_TIME_EPOCH_HOUR 0
#define CFE_MISSION_TIME_EPOCH_MINUTE 0
#define CFE_MISSION_TIME_EPOCH_SECOND 0
#define CFE_MISSION_TIME_EPOCH_MICROS 0
#define CFE_MISSION_TIME_EPOCH_SECONDS 315532800 /* Jan. 1, 1980 00:00:00 */
#define CFE_MISSION_TIME_EPOCH_MICROS 0

/**
** \cfetimecfg Time File System Factor
Expand Down
Loading