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

fix: test case ut_lind_fs_lseek_on_epoll #65

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

ChinmayShringi
Copy link
Contributor

Description

Fixes # (issue)

This PR modifies the test function ut_lind_fs_lseek_on_epoll to directly call libc::lseek on an epoll file descriptor and verifies that it returns -1 with errno set to ESPIPE. Previously, the test relied on cage.lseek_syscall, but the current version ensures that the test directly checks the behavior of the underlying libc function. This update ensures the test behaves as expected when performing a seek on an epoll file descriptor, which is not seekable.

Changes:

  • Modified the test function to directly call libc::lseek instead of cage.lseek_syscall.
  • Added verification for errno to ensure it matches ESPIPE when lseek fails on the epoll file descriptor.

Motivation:

This change is required to test the behavior of lseek more directly, bypassing the wrapper syscall for better control in the test. The issue this addresses is ensuring correct handling of non-seekable file descriptors like epoll in tests.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • cargo test ut_lind_fs_lseek_on_epoll

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)

@Yaxuan-w Yaxuan-w merged commit 2b7eb08 into main Oct 23, 2024
1 check failed
@Yaxuan-w Yaxuan-w deleted the fix-ut-lind-fs-lseek-on-epoll branch October 23, 2024 17:54
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