RFE: add additional file tests for full test coverage of the PATH record
From an email with @rgbriggs:
We have 3 file_* tests in the test suite. There are 6 operations that need testing. There are tests required when the file exists and when it does not. That makes 12 tests (which could be 6 compound tests, or even all covered in one test).
There are 6 different file operations that need testing: CREATE, READ, DELETE, MODIFY, PERMISSIONS, OWNERSHIP. The current tests cover CREATE, DELETE, RENAME. A recent bug also found that there was a difference in behaviour of CREATE if the file existed vs. not, so other file operations were checked for missing records.
Test for all 12 of these combinations (and also add rename).
- CREATE uses open with flags O_WRONLY|O_CREAT and optionally O_NOCTTY, O_NONBLOCK, O_TRUNC, O_APPEND.
- READ uses open with flag O_RDONLY.
- DELETE uses stat and unlink*.
- MODIFY uses open with flags O_RDWR, O_CREAT.
- PERMISSIONS uses stat and fchmod*.
- OWNERSHIP uses stat and fchown*.
- RENAME uses stat and rename.
Proposed work:
- Augment the file_create test to include pre-existing target file condition.
- Augment the file_delete test to include non-existing target file condition.
- Augment the file_rename test to include a non-existing target file condition.
- Add tests for file_read, file_modify, file_perms, file_owner for both non-existing and pre-existing cases.
Outstanding questions:
- Should there be dirstat records for non-existing file targets for READ, PERMISSION, OWNERSHIP, RENAME and stat operations? (I'd suggest yes.)