Skip to content

Updates to "write_syscall" and "pwrite_syscall"#304

Merged
rennergade merged 4 commits intodevelopfrom
naman_write_pwrite
Jul 16, 2024
Merged

Updates to "write_syscall" and "pwrite_syscall"#304
rennergade merged 4 commits intodevelopfrom
naman_write_pwrite

Conversation

@namanlalitnyu
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Copy link
Copy Markdown
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!

Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Copy link
Copy Markdown
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

@namanlalitnyu namanlalitnyu requested a review from rennergade July 16, 2024 22:47
Copy link
Copy Markdown
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
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