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

RFE: add additional file tests for full test coverage of the PATH record #33

Open
pcmoore opened this issue Jan 9, 2017 · 1 comment

Comments

@pcmoore
Copy link
Contributor

pcmoore commented Jan 9, 2017

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).

@rgbriggs
Copy link
Contributor

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.)

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

No branches or pull requests

2 participants