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: 2021-08-31 #1885

Merged
merged 46 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c24daf4
Fix #1812, Add SB API test cases
jphickey Aug 13, 2021
0f569ff
Fix #1866, Add ES API test cases
jphickey Aug 17, 2021
19e5f2f
Fix #1867, Add FS API test cases
jphickey Aug 13, 2021
fb7cd23
Fix #1868, Add TBL API test cases
jphickey Aug 19, 2021
308beb2
Merge pull request #1870 from jphickey/fix-1812-sb-testcases
astrogeco Aug 24, 2021
21074a1
Merge pull request #1869 from jphickey/fix-1866-es-testcases
astrogeco Aug 24, 2021
c0e3e1c
Merge pull request #1872 from jphickey/fix-1868-tbl-testcases
astrogeco Aug 24, 2021
ea38fd2
Merge pull request #1871 from jphickey/fix-1867-fs-testcases
astrogeco Aug 24, 2021
914d9b3
Fix #1843, Add Time Clock Test
zanzaben Aug 24, 2021
922e665
Fix #1819, Test EVS Filter Failures
zanzaben Aug 20, 2021
8e7bb8f
Fix #1820, Add LogOverflowCounter test.
zanzaben Aug 20, 2021
5c388e3
Fix #1829, confirm CFE_SB_PEND_FOREVER flag
jphickey Aug 24, 2021
7170dff
Fix #1826, Add testcases for message broadcasting
jphickey Aug 24, 2021
b108e7e
Fix #1825, test unsubscribe from single pipe
jphickey Aug 24, 2021
7e7f5a5
Fix #1830, add sequence number validation to zero copy test
jphickey Aug 24, 2021
9b96246
Fix #1834 CFE_TBL_Modified: Test CRC, updated flag
pepepr08 Aug 23, 2021
ff90d70
Fix #1769, add call to CFE_ES_ExitChildTask
jphickey Aug 24, 2021
6e6b751
Fix #1880, Improve FS coverage
skliper Aug 25, 2021
6a8da99
Fix #1843, Remove ClockFlagCheck helper method.
zanzaben Aug 25, 2021
88e1d11
Fix #1888, Improve MSG branch coverage
skliper Aug 25, 2021
18ffb99
Fix #1890, Improve resource ID branch coverage
skliper Aug 25, 2021
9197270
Merge pull request #1860 from zanzaben/fix1843_Time_Clock_Func_Test
astrogeco Aug 25, 2021
2ca46e6
Merge pull request #1862 from zanzaben/Fix1819_EVS_coverage_test
astrogeco Aug 25, 2021
4c93929
Fix #1893, Improve SBR branch coverage
skliper Aug 26, 2021
ba1ed4b
Fix #1879, Improve EVS code coverage
skliper Aug 25, 2021
6d04b95
Fix #1897 #1899, Improve TBL code coverage
skliper Aug 27, 2021
af64eb4
Merge pull request #1881 from skliper/fix1879-evs_coverage
astrogeco Aug 27, 2021
90cedf2
Merge pull request #1865 from pepepr08/fix1834-table-mod
astrogeco Aug 27, 2021
98d723e
Merge pull request #1876 from jphickey/fix-1825-1826-1829-1830-sb-tests
astrogeco Aug 27, 2021
97f39b6
Merge pull request #1877 from jphickey/fix-1769-exitchildtask
astrogeco Aug 27, 2021
2fdd1b5
Fix #1616, Incorrect OSAL Format in Users Guide Reference
arielswalker Aug 27, 2021
7b83bed
Fix #1912, Update time tests to use bitmask check macros
jphickey Aug 30, 2021
9072b00
Merge pull request #1902 from ArielSAdamsNASA/fix-1616-incorrect-osal…
astrogeco Aug 30, 2021
6493ddc
Merge pull request #1884 from skliper/fix1880-fs_coverage
astrogeco Aug 30, 2021
bb16216
Merge pull request #1889 from skliper/fix1888-msg_coverage
astrogeco Aug 30, 2021
d145434
Merge pull request #1891 from skliper/fix1890-rid_coverage
astrogeco Aug 30, 2021
4941284
Fix #1895, Improve TIME branch coverage
skliper Aug 26, 2021
6fb3b3c
Merge pull request #1894 from skliper/fix1893-sbr_coverage
astrogeco Aug 31, 2021
ae56eb4
Merge pull request #1896 from skliper/fix1895-time_coverage
astrogeco Aug 31, 2021
5fa8e74
Fix #1918, remove extra word in comment
jphickey Aug 31, 2021
2922987
Merge pull request #1904 from skliper/fix1897-tbl_coverage
astrogeco Aug 31, 2021
811d1fd
Fix #1921, Support custom PSP directory (#1864)
jbohren-hbr Aug 23, 2021
6aa555a
Merge pull request #1913 from jphickey/fix-1912-bitmask-checks
astrogeco Sep 1, 2021
74320c3
Merge pull request #1923 from jphickey/fix-1918-correct-comment
astrogeco Sep 1, 2021
c67fb7d
HOTFIX 20210831, use memset to clear structs
jphickey Sep 1, 2021
a8634eb
IC:2021-08-31, Bump to v6.8.0-rc1+dev980
astrogeco Sep 1, 2021
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
Prev Previous commit
Next Next commit
Fix #1867, Add FS API test cases
Adds FS functional test cases to cover all missing items that
were identified as part of the scrub in issue #1724.

Where a specific condition is not testable because it requires
a failure of another subsystem, it is marked as `covtest` to
indicate it is only verifiable in coverage test environment.
  • Loading branch information
jphickey committed Aug 23, 2021
commit 19e5f2fc1d9eaf0e34db01e6265fc953e0b98450
50 changes: 43 additions & 7 deletions modules/cfe_testcase/src/fs_util_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,35 @@ void TestInputFile(void)
CFE_FS_INVALID_PATH);
UtAssert_INT32_EQ(CFE_FS_ParseInputFileNameEx(OutNameBuf, InNameBuf, sizeof(OutNameBuf), 0, NULL, Path, Ext),
CFE_FS_INVALID_PATH);

/* A short output buffer that is too small to fit the result */
UtAssert_INT32_EQ(CFE_FS_ParseInputFileNameEx(OutNameBuf, InNameBuf, 8, sizeof(InNameBuf), Name, Path, Ext),
CFE_FS_FNAME_TOO_LONG);
}

void TestFileName(void)
{
const char Path[] = "/func/FileName.test";
char Path[OS_MAX_PATH_LEN + 4];
char Name[OS_MAX_FILE_NAME];
const char ExpectedName[] = "FileName.test";

UtPrintf("Testing: CFE_FS_ExtractFilenameFromPath");

snprintf(Path, sizeof(Path), "/func/FileName.test");
UtAssert_INT32_EQ(CFE_FS_ExtractFilenameFromPath(Path, Name), CFE_SUCCESS);
UtAssert_StrCmp(Name, ExpectedName, "Extract Filename: %s", Name);

UtAssert_INT32_EQ(CFE_FS_ExtractFilenameFromPath(NULL, Name), CFE_FS_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_FS_ExtractFilenameFromPath(Path, NULL), CFE_FS_BAD_ARGUMENT);

memset(Path, 'x', sizeof(Path) - 1);
Path[sizeof(Path) - 1] = 0;
Path[0] = '/';
UtAssert_INT32_EQ(CFE_FS_ExtractFilenameFromPath(Path, Name), CFE_FS_FNAME_TOO_LONG);

Path[0] = 'x';
Path[OS_MAX_PATH_LEN - 1] = 0;
UtAssert_INT32_EQ(CFE_FS_ExtractFilenameFromPath(Path, Name), CFE_FS_INVALID_PATH);
}

/* FT helper stub compatible with background file write DataGetter */
Expand All @@ -119,32 +133,54 @@ bool FS_DataGetter(void *Meta, uint32 RecordNum, void **Buffer, size_t *BufSize)
void FS_OnEvent(void *Meta, CFE_FS_FileWriteEvent_t Event, int32 Status, uint32 RecordNum, size_t BlockSize,
size_t Position)
{
OS_TaskDelay(100);
}

void TestFileDump(void)
{
int32 count;
int32 MaxWait = 20;

memset(&CFE_FT_Global.FuncTestState, 0, sizeof(CFE_FT_Global.FuncTestState));
CFE_FT_Global.FuncTestState.FileSubType = 2;
CFE_FT_Global.FuncTestState.GetData = FS_DataGetter;
CFE_FT_Global.FuncTestState.OnEvent = FS_OnEvent;
strncpy(CFE_FT_Global.FuncTestState.FileName, "/ram/FT.bin", sizeof(CFE_FT_Global.FuncTestState.FileName));
strncpy(CFE_FT_Global.FuncTestState.Description, "FT", sizeof(CFE_FT_Global.FuncTestState.Description));
int count = 0;
int MaxWait = 20;

UtPrintf("Testing: CFE_FS_BackgroundFileDumpRequest, CFE_FS_BackgroundFileDumpIsPending");

UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpIsPending(&CFE_FT_Global.FuncTestState), false);

/* With an empty "FileName" field, it should fail path validation */
CFE_FT_Global.FuncTestState.GetData = FS_DataGetter;
CFE_FT_Global.FuncTestState.OnEvent = FS_OnEvent;
UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&CFE_FT_Global.FuncTestState), CFE_FS_INVALID_PATH);
strncpy(CFE_FT_Global.FuncTestState.FileName, "/ram/FT.bin", sizeof(CFE_FT_Global.FuncTestState.FileName));

/* With an empty "GetData" field, it should fail validation */
CFE_FT_Global.FuncTestState.GetData = NULL;
UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&CFE_FT_Global.FuncTestState), CFE_FS_BAD_ARGUMENT);
CFE_FT_Global.FuncTestState.GetData = FS_DataGetter;

/* With an empty "OnEvent" field, it should fail validation */
CFE_FT_Global.FuncTestState.OnEvent = NULL;
UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&CFE_FT_Global.FuncTestState), CFE_FS_BAD_ARGUMENT);
CFE_FT_Global.FuncTestState.OnEvent = FS_OnEvent;

/* This should work */
UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&CFE_FT_Global.FuncTestState), CFE_SUCCESS);

/* Duplicate request should get rejected */
UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&CFE_FT_Global.FuncTestState),
CFE_STATUS_REQUEST_ALREADY_PENDING);

/* Wait for background task to complete */
count = 0;
while (CFE_FS_BackgroundFileDumpIsPending(&CFE_FT_Global.FuncTestState) && count < MaxWait)
{
OS_TaskDelay(100);
count++;
}

UtAssert_True(count < MaxWait, "count (%i) < MaxWait (%i)", count, MaxWait);
UtAssert_INT32_LT(count, MaxWait);

UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(NULL), CFE_FS_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpIsPending(NULL), false);
Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ CFE_Status_t CFE_FS_WriteHeader(osal_id_t FileDes, CFE_FS_Header_t *Hdr);
** to be put into the file's Standard cFE File Header.
**
** \return Execution status, see \ref CFEReturnCodes, or OSAL status
** \retval #CFE_STATUS_EXTERNAL_RESOURCE_FAIL \copybrief CFE_STATUS_EXTERNAL_RESOURCE_FAIL
** \retval #CFE_STATUS_EXTERNAL_RESOURCE_FAIL \covtest \copybrief CFE_STATUS_EXTERNAL_RESOURCE_FAIL
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
**
** \note This function invokes OSAL API routines and the current implementation may return
Expand Down