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

Updates to "write_syscall" and "pwrite_syscall" #304

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

namanlalitnyu
Copy link
Contributor

Description

Fixes # (issue)
The following changes include the tests and comments in the code for the write_syscall and pwrite_syscall file system calls under RustPosix.
The tests were added to cover all the possible scenarios that might happen when calling the file system_calls write_syscall and pwrite_syscall.

Type of change

  • This change just contains the tests for an existing file system call.
  • This change contains the minor code changes and comments for write_syscall and pwrite_syscall.
  • This change contains code reformatting for existing file system calls.

How Has This Been Tested?

Inorder to run the tests, we need to run cargo test --lib command inside the safeposix-rust directory.

All the tests are present under this directory: lind_project/src/safeposix-rust/src/tests/fs_tests.rs

  • Test A - ut_lind_fs_write_read_only_fd()
  • Test B - ut_lind_fs_write_to_directory()
  • Test C - ut_lind_fs_write_to_epoll()
  • Test D - ut_lind_fs_write_to_regular_file()
  • Test E - ut_lind_fs_write_to_chardev_file()
  • Test F - ut_lind_fs_write_to_sockets()
  • Test G - ut_lind_fs_pwrite_read_only_fd()
  • Test H- ut_lind_fs_pwrite_to_file()
  • Test I- ut_lind_fs_pwrite_to_directory()
  • Test J - ut_lind_fs_pwrite_invalid_types()
  • Test K - ut_lind_fs_pwrite_to_chardev_file()

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

@namanlalitnyu
Copy link
Contributor Author

@qianxichen233, Requesting your review of these changes.
Thanks!

@rennergade rennergade requested a review from ve1nard July 15, 2024 21:31
@namanlalitnyu namanlalitnyu requested review from Anway-Agte and removed request for ve1nard July 15, 2024 21:56
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Outdated Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Outdated Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@yashaswi2000 yashaswi2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good tests, minor refactoring. good work!

src/safeposix/syscalls/fs_calls.rs Outdated Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Outdated Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Show resolved Hide resolved
src/safeposix/syscalls/fs_calls.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@yashaswi2000 yashaswi2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@rennergade rennergade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. Approved!

@rennergade rennergade merged commit 11bc43e into develop Jul 16, 2024
2 checks passed
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.

5 participants