close
Skip to content

add a system call mock for uid/gid. - #3173

Merged
utam0k merged 2 commits into
youki-dev:mainfrom
nayuta723:add-system-call-mock-for-id
May 28, 2025
Merged

add a system call mock for uid/gid.#3173
utam0k merged 2 commits into
youki-dev:mainfrom
nayuta723:add-system-call-mock-for-id

Conversation

@nayuta723

Copy link
Copy Markdown
Contributor

Description

Add a system call mock for uid, gid. euid, egid, etc.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)

Related Issues

Fixes #3136

Additional Context

This change is related to the issue discussed in this comment.
I have moved the get operations for uid, gid, euid, and egid used in the libcontainer and youki crates into the syscall package. As for libcgroup and runtimetest, they are not dependent on libcontainer, so they are omitted.

Signed-off-by: nayuta-ai <nayuta723@gmail.com>
@nayuta723 nayuta723 mentioned this pull request May 25, 2025
13 tasks
@utam0k utam0k added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 27, 2025
Comment thread crates/libcontainer/src/syscall/test.rs Outdated
gid: Gid,
euid: Uid,
egid: Gid,
// TODO: add more fields such as suid, sgid, etc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we will need to add these IDs. Why did you think we needed them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The set_id function sets uid/euid/suid and gid/egid/sgid, so I initially thought we might need these fields in the future. However, since there’s currently no implementation for get_suid or get_sgid on nix, they aren't necessary at this point. I'll remove them, thanks!

Signed-off-by: nayuta-ai <nayuta723@gmail.com>

@utam0k utam0k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@utam0k

utam0k commented May 28, 2025

Copy link
Copy Markdown
Member

!github easy-benchmark

@utam0k
utam0k merged commit 61c9ae0 into youki-dev:main May 28, 2025
@github-actions github-actions Bot mentioned this pull request May 28, 2025
@nayuta723
nayuta723 deleted the add-system-call-mock-for-id branch December 7, 2025 11:41
sat0ken pushed a commit to sat0ken/youki that referenced this pull request Mar 17, 2026
* add MockId

Signed-off-by: nayuta-ai <nayuta723@gmail.com>

* delete the unnecessary comment.

Signed-off-by: nayuta-ai <nayuta723@gmail.com>

---------

Signed-off-by: nayuta-ai <nayuta723@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Define Linux Network Devices

2 participants