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

OSAL path length variables cause tests to fail #111

Closed
2 tasks done
irowebbn opened this issue Jun 8, 2023 · 1 comment · Fixed by #112
Closed
2 tasks done

OSAL path length variables cause tests to fail #111

irowebbn opened this issue Jun 8, 2023 · 1 comment · Fixed by #112

Comments

@irowebbn
Copy link
Contributor

irowebbn commented Jun 8, 2023

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
A clear and concise description of what the bug is.

For certain values of OSAL_CONFIG_MAX_FILE_NAME and OSAL_CONFIG_MAX_PATH_LEN, DS tests fail.

To Reproduce
Steps to reproduce the behavior:

  1. Build cFS distribution with OSAL_CONFIG_MAX_FILE_NAME set to 64 and OSAL_CONFIG_MAX_PATH_LEN set to 128
  2. ctest coverage -VV --test-dir build/intel64/default_intel64/ -R coverage-ds-ds_file

Expected behavior
A clear and concise description of what you expected to happen.
Expect test to pass.

Code snips
If applicable, add references to the software.

111: [BEGIN] 25 DS_FileCreateName_Test_PathBaseSeqTooLa
111: [ PASS] 25.001 ds_file_tests.c:736 - DS_FileCreateName(FileIndex)
111: [ FAIL] 25.002 ds_file_tests.c:742 - strlen(DS_AppData.DestFileTblPtr->File[FileIndex].Pathname) + strlen(DS_AppData.DestFileTblPtr->File[FileIndex].Basename) + DS_SEQUENCE_DIGITS + strlen("/") (64) == DS_TOTAL_FNAME_BUFSIZE (128)
111: [ FAIL] 25.003 ds_file_tests.c:743 - CallCount CFE_EVS_SendEvent() (0) == 1 (1)
111: [ FAIL] 25.004 ds_file_tests.c:744 - context_CFE_EVS_SendEvent[0].EventType (0) == CFE_EVS_EventType_ERROR (3)
111: [ FAIL] 25.005 ds_file_tests.c:745 - context_CFE_EVS_SendEvent[0].EventID (0) == DS_FILE_NAME_ERR_EID (14)
111: [  END] 25 DS_FileCreateName_Test_PathBaseSeqTooLa TOTAL::5     PASS::1     FAIL::4     MIR::0     TSF::0     TTF::0     WARN::0   
111: 
111: [BEGIN] 26 DS_FileCreateName_Test_PathBaseSeqExtTo
111: [ PASS] 26.001 ds_file_tests.c:765 - DS_FileCreateName(FileIndex)
111: [ FAIL] 26.002 ds_file_tests.c:772 - strlen(DS_AppData.DestFileTblPtr->File[FileIndex].Pathname) + strlen(DS_AppData.DestFileTblPtr->File[FileIndex].Basename) + strlen(DS_AppData.DestFileTblPtr->File[FileIndex].Extension) + DS_SEQUENCE_DIGITS + strlen("/") (64) == DS_TOTAL_FNAME_BUFSIZE (128
111: [ FAIL] 26.003 ds_file_tests.c:773 - CallCount CFE_EVS_SendEvent() (0) == 1 (1)
111: [ FAIL] 26.004 ds_file_tests.c:774 - context_CFE_EVS_SendEvent[0].EventType (0) == CFE_EVS_EventType_ERROR (3)
111: [ FAIL] 26.005 ds_file_tests.c:775 - context_CFE_EVS_SendEvent[0].EventID (0) == DS_FILE_NAME_ERR_EID (14)
111: [  END] 26 DS_FileCreateName_Test_PathBaseSeqExtTo TOTAL::5     PASS::1     FAIL::4     MIR::0     TSF::0     TTF::0     WARN::0   

111: [BEGIN] 36 DS_FileCloseDest_Test_PlatformConfigMov
111: [ PASS] 36.001 ds_file_tests.c:998 - DS_AppData.FileStatus[FileIndex].FileAge (0) == 0 (0)
111: [ PASS] 36.002 ds_file_tests.c:999 - DS_AppData.FileStatus[FileIndex].FileSize (0) == 0 (0)
111: [ PASS] 36.003 ds_file_tests.c:1000 - DS_AppData.FileStatus[FileIndex].FileName[0] (0) == 0 (0)
111: [ FAIL] 36.004 ds_file_tests.c:1001 - context_CFE_EVS_SendEvent[0].EventID (0) == DS_MOVE_FILE_ERR_EID (61)
111: [ FAIL] 36.005 ds_file_tests.c:1002 - context_CFE_EVS_SendEvent[0].EventType (0) == CFE_EVS_EventType_ERROR (3)
111: [ FAIL] 36.006 ds_file_tests.c:1003 - CallCount CFE_EVS_SendEvent() (0) == 1 (1)
111: [  END] 36 DS_FileCloseDest_Test_PlatformConfigMov TOTAL::6     PASS::3     FAIL::3     MIR::0     TSF::0     TTF::0     WARN::0   

111: [  END] 52 SUMMARY              TOTAL::159   PASS::148   FAIL::11    MIR::0     TSF::0     TTF::0     WARN::0   
111: COMPLETE: 52 tests Segment(s) executed
111: 
111: OS_BSP_Initialize():Maximum user msg queue depth = 1024
1/1 Test #111: coverage-ds-ds_file ..............***Failed    0.01 sec

System observed on:

  • Hardware: Intel(R) Xeon(R) CPU E5-2687W v4 @ 3.00GHz
  • OS: CentOS 7 Linux
  • Versions: draco-rc3 tags for cFE, OSAL, and DS. Also tried with draco-rc4 DS.

Additional context
Add any other context about the problem here.
Related cFE issue: nasa/cFE#2372

Reporter Info
Full name and company/organization if applicable
Isaac Rowe, JSC/Jacobs Technology

@thnkslprpt
Copy link
Contributor

Updating the matching CFE_MISSION_MAX_FILE_LEN (to 64) and CFE_MISSION_MAX_PATH_LEN (to 128) will stop the test failures in cFE (noted in issue nasa/cFE#2372) and most of the DS test failures as well.

There will still be a single DS test failing (with 3 asserts) after the above change, but this is only because that test is testing for a 'too long' filename, while it is only set up to be 'too long' with the default config values.

Updating that test to make the passed-in string longer will cause the test to pass (i.e. an error will be returned). This is the test string that needs to be made longer:

strncpy(DS_AppData.FileStatus[FileIndex].FileName, "directory1/filenamefilenamefilenamefilenamefilenamefilename",

As an aside - FM, MD & MM will also fail some tests for similar reasons with these config parameters set to the higher values.

irowebbn added a commit to irowebbn/DS that referenced this issue Jun 20, 2023
irowebbn added a commit to irowebbn/DS that referenced this issue Nov 30, 2023
dzbaker added a commit that referenced this issue Dec 5, 2023
Fix #111: Use correct length filename for too large test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants