From a3b98867331b2a4c68943b0fcda6bbf109321e3d Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:26:22 +0100 Subject: [PATCH] Disable network access for the containers 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. --- test-framework/sudo-test/src/docker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-framework/sudo-test/src/docker.rs b/test-framework/sudo-test/src/docker.rs index 474218d1e..91539bc1f 100644 --- a/test-framework/sudo-test/src/docker.rs +++ b/test-framework/sudo-test/src/docker.rs @@ -59,7 +59,7 @@ impl Container { pub fn new_with_hostname(image: &str, hostname: Option<&str>) -> Result { 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]); }