Skip to content

Commit

Permalink
Disable network access for the containers
Browse files Browse the repository at this point in the history
Turns out setting up a network namespace and reconfiguring the firewall
is pretty expensive. Disabling this setup brings down test times from
~210s to ~65s.
  • Loading branch information
bjorn3 committed Jan 13, 2025
1 parent e0fff40 commit a3b9886
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test-framework/sudo-test/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Container {

pub fn new_with_hostname(image: &str, hostname: Option<&str>) -> Result<Self> {
let mut docker_run = docker_command();
docker_run.args(["run", "--detach"]);
docker_run.args(["run", "--net=none", "--detach"]);
if let Some(hostname) = hostname {
docker_run.args(["--hostname", hostname]);
}
Expand Down

0 comments on commit a3b9886

Please sign in to comment.