Skip to content

Commit 3ae23cb

Browse files
committed
install: add unit tests
1 parent f43c6ad commit 3ae23cb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/cmdline/install.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,4 +584,24 @@ dest-device: u
584584
.expand_config_files()
585585
.unwrap_err();
586586
}
587+
588+
/// Test that firstboot-args is manually added to args list when defined
589+
#[test]
590+
fn test_firstboot_args_manually_added() {
591+
let mut f = NamedTempFile::new().unwrap();
592+
f.as_file_mut()
593+
.write_all(b"dest-device: /dev/sda")
594+
.unwrap();
595+
596+
let config = InstallConfig::from_args(&[
597+
"--config-file",
598+
f.path().to_str().unwrap(),
599+
"--firstboot-args",
600+
"ip=dhcp",
601+
])
602+
.unwrap();
603+
604+
// Test expand_config_files to verify manual addition
605+
let expanded = config.expand_config_files().unwrap();
606+
}
587607
}

0 commit comments

Comments
 (0)