File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -584,4 +584,30 @@ 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 ( ) . write_all ( b"dest-device: /dev/sda" ) . unwrap ( ) ;
593+
594+ let config = InstallConfig :: from_args ( & [
595+ "--config-file" ,
596+ f. path ( ) . to_str ( ) . unwrap ( ) ,
597+ "--firstboot-args" ,
598+ "ip=dhcp" ,
599+ ] )
600+ . unwrap ( ) ;
601+
602+ // Verify firstboot-args is defined
603+ assert ! ( config. firstboot_args. is_some( ) ) ;
604+ assert_eq ! ( config. firstboot_args. as_ref( ) . unwrap( ) , "ip=dhcp" ) ;
605+
606+ // Test expand_config_files to verify manual addition
607+ let expanded = config. expand_config_files ( ) . unwrap ( ) ;
608+
609+ // Should still have firstboot-args
610+ assert ! ( expanded. firstboot_args. is_some( ) ) ;
611+ assert_eq ! ( expanded. firstboot_args. unwrap( ) , "ip=dhcp" ) ;
612+ }
587613}
You can’t perform that action at this time.
0 commit comments