-
Notifications
You must be signed in to change notification settings - Fork 396
linux_ns_path contest integration test #3283
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
base: main
Are you sure you want to change the base?
linux_ns_path contest integration test #3283
Conversation
ccdec4f to
d41b628
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements integration tests for linux namespace path functionality as part of issue #361. The tests verify that containers can correctly inherit namespaces by comparing inodes between unshared processes and container processes.
- Adds comprehensive integration tests for various Linux namespace types (PID, UTS, IPC, Mount, Network)
- Implements a namespace path testing framework with proper cleanup mechanisms
- Integrates the new test module into the existing test suite structure
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/contest/contest/src/tests/mod.rs | Adds module declaration for the new linux_ns_path test module |
| tests/contest/contest/src/tests/linux_ns_path/ns_path_test.rs | Implements the core namespace path testing logic with cleanup utilities and test cases |
| tests/contest/contest/src/tests/linux_ns_path/mod.rs | Module file exposing the test functionality |
| tests/contest/contest/src/main.rs | Integrates the new test group into the main test runner |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Cody <[email protected]>
…nodes and parent process inodes are different Signed-off-by: Cody <[email protected]>
Signed-off-by: Cody <[email protected]>
…onventions Signed-off-by: Cody <[email protected]>
Signed-off-by: Cody <[email protected]>
Signed-off-by: Cody <[email protected]>
2d9833a to
547760e
Compare
Signed-off-by: Cody <[email protected]>
Signed-off-by: Cody <[email protected]>
Signed-off-by: Cody <[email protected]>
|
Apologies for all the fix commits. I just notice the "just lint" command |
Signed-off-by: Cody <[email protected]>
ba8180b to
fdd3b27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } | ||
|
|
||
| fn create_spec(namespace_path: &Vec<NamespacePath>) -> Spec { |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter should be a slice &[NamespacePath] instead of a reference to a Vec. This is more idiomatic Rust and allows the function to accept both Vec and array references.
| fn create_spec(namespace_path: &Vec<NamespacePath>) -> Spec { | |
| fn create_spec(namespace_path: &[NamespacePath]) -> Spec { |
| let child = match child { | ||
| Ok(child) => child, | ||
| Err(e) => { | ||
| return TestResult::Failed(anyhow!(format!("could not spawn unshare: {}", e))); |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format!() call is unnecessary here. Use anyhow!() directly with format string arguments: anyhow!('could not spawn unshare: {}', e).
| return TestResult::Failed(anyhow!(format!("could not spawn unshare: {}", e))); | |
| return TestResult::Failed(anyhow!("could not spawn unshare: {}", e)); |
| return TestResult::Failed(anyhow!(format!( | ||
| "could not wait for path {}", | ||
| &namespace_path.path.display() | ||
| ))); |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format!() call is unnecessary here. Use anyhow!() directly with format string arguments: anyhow!('could not wait for path {}', namespace_path.path.display()).
| return TestResult::Failed(anyhow!(format!( | |
| "could not wait for path {}", | |
| &namespace_path.path.display() | |
| ))); | |
| return TestResult::Failed(anyhow!( | |
| "could not wait for path {}", | |
| &namespace_path.path.display() | |
| )); |
| return TestResult::Failed(anyhow!(format!( | ||
| "could not get inode of {}: {}", | ||
| &unshared_namespace_path.path.display(), | ||
| e | ||
| ))); |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format!() call is unnecessary here. Use anyhow!() directly with format string arguments: anyhow!('could not get inode of {}: {}', unshared_namespace_path.path.display(), e).
| return TestResult::Failed(anyhow!(format!( | ||
| "could not get inode of {}: {}", | ||
| container_ns_path.display(), | ||
| e | ||
| ))); |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format!() call is unnecessary here. Use anyhow!() directly with format string arguments: anyhow!('could not get inode of {}: {}', container_ns_path.display(), e).
| return TestResult::Failed(anyhow!(format!( | |
| "could not get inode of {}: {}", | |
| container_ns_path.display(), | |
| e | |
| ))); | |
| return TestResult::Failed(anyhow!( | |
| "could not get inode of {}: {}", | |
| container_ns_path.display(), | |
| e | |
| )); |
Signed-off-by: Cody <[email protected]>
Description
part of #361
Implemented the linux_ns_path integration test
Type of Change
Testing
Related Issues
Fixes #
Additional Context