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

Random UT Failure: PosixFile #2939

Merged
merged 6 commits into from
Oct 10, 2024

Conversation

rlcheng
Copy link
Collaborator

@rlcheng rlcheng commented Oct 10, 2024

Related Issue(s)
Has Unit Tests (y/n)
Documentation Included (y/n)

Change Description

Update get_test_filename() to exclude certain special characters and change minimum filename length to prevent posix open() from getting an unintentional bad file name.

Rationale

This fix removes possibility of creating a filename with single character . that causes unintentional error with posix open() in otherwise nominal tests (OpenForRead, OpenFileCreate, and OpenForWrite). Filenames are now 2 character minimum and cannot start with . or /, which can also cause problems.

Testing/Review Recommendations

Tested with seed values known to create the single char . filename: 522402, 588311, and 501569.

Future Work

None

 * Fix UT failing FinalizeCrc test when crc calculation miss match.
   Miss match due to file crc and shadow being out of sync when
   both are not reinialized at the same time.

 * Update File::open in File.ccp to match shadow operation in
   FileRules.cpp to only reset crc when status is OP_OK.

 * Update FileRules.cpp to print out rule name during test.

 * Remove changing file mode in shadow_open() in FileRules.cpp to
   OPEN_NO_MODE when status is not OP_OK.
 * Fix additional issue where randomly generate file name may be
   too large for POSIX.
 * Fix preallocate test from picking 0 for length, which causes
   unintentional error in preallocate cmd.
 * Fix seek() in SyntheticFileSystem and assert_file_seek() to allow
   for offset being 0.
 * Update get_test_filename() to exclude certain special characters
   and change minimum filename length to prevent posix open() from
   getting an unintentional bad file name.
@LeStarch
Copy link
Collaborator

@rlcheng do we need to limit to 2+ characters if we are removing specials?

@LeStarch
Copy link
Collaborator

I am going to merge the fix anyway.

@LeStarch LeStarch merged commit 4bee99e into nasa:devel Oct 10, 2024
33 of 34 checks passed
@rlcheng
Copy link
Collaborator Author

rlcheng commented Oct 10, 2024

We dont have to set it to 2+ but I did find it can be puzzling when you get a file name that is just ; which I did get.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants