Skip to content

Commit 080cd27

Browse files
committed
add contest for the net_devices.
Signed-off-by: nayuta-ai <[email protected]>
1 parent f6d74b6 commit 080cd27

File tree

9 files changed

+404
-0
lines changed

9 files changed

+404
-0
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/contest/contest/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ edition = "2021"
66
[dependencies]
77
anyhow = "1.0"
88
flate2 = "1.1"
9+
futures = "0.3.31"
10+
ipnetwork = "0.20.0"
911
libcgroups = { path = "../../../crates/libcgroups" }
1012
libcontainer = { path = "../../../crates/libcontainer" }
1113
nix = "0.29.0"
@@ -15,6 +17,7 @@ once_cell = "1.21.3"
1517
pnet_datalink = "0.35.0"
1618
procfs = "0.17.0"
1719
rand = "0.9.1"
20+
rtnetlink = "0.16.0"
1821
serde = { version = "1.0", features = ["derive"] }
1922
serde_json = "1.0"
2023
tar = "0.4"
@@ -23,6 +26,7 @@ uuid = "1.16"
2326
which = "7.0.2"
2427
tempfile = "3"
2528
scopeguard = "1.2.0"
29+
tokio = { version = "1", features = ["full"] }
2630
tracing = { version = "0.1.41", features = ["attributes"]}
2731
tracing-subscriber = { version = "0.3.19", features = ["json", "env-filter"] }
2832

tests/contest/contest/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use crate::tests::lifecycle::{ContainerCreate, ContainerLifecycle};
2222
use crate::tests::linux_masked_paths::get_linux_masked_paths_tests;
2323
use crate::tests::linux_ns_itype::get_ns_itype_tests;
2424
use crate::tests::mounts_recursive::get_mounts_recursive_test;
25+
use crate::tests::net_devices::get_net_devices_test;
2526
use crate::tests::no_pivot::get_no_pivot_test;
2627
use crate::tests::pidfile::get_pidfile_test;
2728
use crate::tests::process::get_process_test;
@@ -136,6 +137,7 @@ fn main() -> Result<()> {
136137
let fd_control = get_fd_control_test();
137138
let masked_paths = get_linux_masked_paths_tests();
138139
let rootfs_propagation = get_rootfs_propagation_test();
140+
let net_devices = get_net_devices_test();
139141

140142
tm.add_test_group(Box::new(cl));
141143
tm.add_test_group(Box::new(cc));
@@ -171,6 +173,7 @@ fn main() -> Result<()> {
171173
tm.add_test_group(Box::new(process_oom_score_adj));
172174
tm.add_test_group(Box::new(fd_control));
173175
tm.add_test_group(Box::new(rootfs_propagation));
176+
tm.add_test_group(Box::new(net_devices));
174177

175178
tm.add_test_group(Box::new(io_priority_test));
176179
tm.add_cleanup(Box::new(cgroups::cleanup_v1));

tests/contest/contest/src/tests/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub mod lifecycle;
1212
pub mod linux_masked_paths;
1313
pub mod linux_ns_itype;
1414
pub mod mounts_recursive;
15+
pub mod net_devices;
1516
pub mod no_pivot;
1617
pub mod pidfile;
1718
pub mod process;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mod net_devices_test;
2+
pub use net_devices_test::get_net_devices_test;

0 commit comments

Comments
 (0)