-
Notifications
You must be signed in to change notification settings - Fork 24
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
PoC: Rust-based integration test PoC #879
base: main
Are you sure you want to change the base?
Conversation
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.
Nice work! Some quick initial thoughts before taking a deeper look
} | ||
|
||
pub fn configure_ifc(ifc_name: &str, ip: IpAddr) { | ||
run_command( |
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.
I guess this wouldn't work running the tests on macOS because it uses ifconfig
for interface management. as far as I know there is no one cross-platform crate for doing so, only retrieving the configuration..
tun: None, | ||
}) | ||
.unwrap(); | ||
self.dev.set_fwmark(11673110).unwrap(); |
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.
This also fails on macOS with
--> systests/src/utils/test_client.rs:86:18
|
86 | self.dev.set_fwmark(11673110).unwrap();
| ^^^^^^^^^^ method not found in `Device`
@@ -0,0 +1,59 @@ | |||
[package] | |||
name = "systests" |
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.
Would be nice to have a readme.md
with some minimal instructions
mod tests; | ||
mod utils; | ||
|
||
fn main() { |
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.
why don't we use the tests module approach here?
#[cfg(test)]
mod test_vpn {
use super::*;
#[test]
fn test_vpn_poc_works() {
test_vpn_poc();
}
}
then we could get nicer test result reports like
thread 'test_vpn::test_vpn_poc_works' panicked at systests/src/tests/vpn.rs:51:5:
assertion failed: false
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Successfully executed 'ip link delete tun10'
Successfully executed 'ip rule del priority 32111'
failures:
test_vpn::test_vpn_poc_works
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.22s
I've been able to quickly run the tests with both methods. Running the binary took half the time than with Great job!! |
This PR is a PoC that should not be merged.
The purpose of this PR is to showcase two different methods of implementing rust-based integration tests for libtelio, to make discussing a related RFC easier.
The goal before anything related to this effort is merged is to not have any external dependencies that are not runnable and manageable directly from the test (starting a separate process from Rust to run separate binaries doesn't count), but to be able to start the RFC process, this PR only localizes the derp servers to rust. Because of that, the PoC vpn connection test cannot be run without at least the natlab vpn containers running
☑️ Definition of Done checklist