Skip to content

Commit db3cdba

Browse files
Add option to disable network tests
`cargo xtask run` now takes a `--disable-network` arg that turns off the network protocol tests by not creating a network device. The purpose of this flag is to make the QEMU tests faster when iterating on something locally. Disabling the network stuff drops the time down from ~12.5s to ~4.5s. The extra time doesn't matter when running in CI, but for quick local testing it can add up.
1 parent 5939e57 commit db3cdba

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

xtask/src/opt.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ pub struct QemuOpt {
101101
#[clap(long, action)]
102102
pub disable_kvm: bool,
103103

104+
/// Disable network tests.
105+
#[clap(long, action)]
106+
pub disable_network: bool,
107+
104108
/// Disable some tests that don't work in the CI.
105109
#[clap(long, action)]
106110
pub ci: bool,

xtask/src/qemu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
523523

524524
// Attach network device with DHCP configured for PXE. Skip this for
525525
// examples since it slows down the boot some.
526-
let echo_service = if opt.example.is_none() {
526+
let echo_service = if !opt.disable_network && opt.example.is_none() {
527527
cmd.args([
528528
"-nic",
529529
"user,model=e1000,net=192.168.17.0/24,tftp=uefi-test-runner/tftp/,bootfile=fake-boot-file",

0 commit comments

Comments
 (0)