@@ -52,59 +52,6 @@ mod tests {
5252 fn prepare ( & self , tmp_dir : & TempDir , network : & GuestNetworkConfig ) -> String ;
5353 }
5454
55- struct ClearCloudInit { }
56- impl CloudInit for ClearCloudInit {
57- fn prepare ( & self , tmp_dir : & TempDir , network : & GuestNetworkConfig ) -> String {
58- let cloudinit_file_path =
59- String :: from ( tmp_dir. path ( ) . join ( "cloudinit" ) . to_str ( ) . unwrap ( ) ) ;
60- let cloud_init_directory = tmp_dir
61- . path ( )
62- . join ( "cloud-init" )
63- . join ( "clear" )
64- . join ( "openstack" ) ;
65- fs:: create_dir_all ( cloud_init_directory. join ( "latest" ) )
66- . expect ( "Expect creating cloud-init directory to succeed" ) ;
67- let source_file_dir = std:: env:: current_dir ( )
68- . unwrap ( )
69- . join ( "resources" )
70- . join ( "cloud-init" )
71- . join ( "clear" )
72- . join ( "openstack" )
73- . join ( "latest" ) ;
74- fs:: copy (
75- source_file_dir. join ( "meta_data.json" ) ,
76- cloud_init_directory. join ( "latest" ) . join ( "meta_data.json" ) ,
77- )
78- . expect ( "Expect copying cloud-init meta_data.json to succeed" ) ;
79- let mut user_data_string = String :: new ( ) ;
80- fs:: File :: open ( source_file_dir. join ( "user_data" ) )
81- . unwrap ( )
82- . read_to_string ( & mut user_data_string)
83- . expect ( "Expected reading user_data file in to succeed" ) ;
84- user_data_string = user_data_string. replace ( "192.168.2.1" , & network. host_ip ) ;
85- user_data_string = user_data_string. replace ( "192.168.2.2" , & network. guest_ip ) ;
86-
87- user_data_string = user_data_string. replace ( "12:34:56:78:90:ab" , & network. guest_mac ) ;
88- fs:: File :: create ( cloud_init_directory. join ( "latest" ) . join ( "user_data" ) )
89- . unwrap ( )
90- . write_all ( user_data_string. as_bytes ( ) )
91- . expect ( "Expected writing out user_data to succeed" ) ;
92- std:: process:: Command :: new ( "mkdosfs" )
93- . args ( [ "-n" , "config-2" ] )
94- . args ( [ "-C" , cloudinit_file_path. as_str ( ) ] )
95- . arg ( "8192" )
96- . output ( )
97- . expect ( "Expect creating disk image to succeed" ) ;
98- std:: process:: Command :: new ( "mcopy" )
99- . arg ( "-o" )
100- . args ( [ "-i" , cloudinit_file_path. as_str ( ) ] )
101- . args ( [ "-s" , cloud_init_directory. to_str ( ) . unwrap ( ) , "::" ] )
102- . output ( )
103- . expect ( "Expect copying files to disk image to succeed" ) ;
104- cloudinit_file_path
105- }
106- }
107-
10855 struct UbuntuCloudInit { }
10956 impl CloudInit for UbuntuCloudInit {
11057 fn prepare ( & self , tmp_dir : & TempDir , network : & GuestNetworkConfig ) -> String {
@@ -627,7 +574,6 @@ mod tests {
627574
628575 const FOCAL_IMAGE_NAME : & str = "focal-server-cloudimg-amd64-raw.img" ;
629576 const JAMMY_IMAGE_NAME : & str = "jammy-server-cloudimg-amd64-raw.img" ;
630- const CLEAR_IMAGE_NAME : & str = "clear-28660-kvm.img" ;
631577
632578 #[ test]
633579 fn test_boot_qemu_focal ( ) {
@@ -639,11 +585,6 @@ mod tests {
639585 test_boot ( JAMMY_IMAGE_NAME , & UbuntuCloudInit { } , spawn_qemu)
640586 }
641587
642- #[ test]
643- fn test_boot_qemu_clear ( ) {
644- test_boot ( CLEAR_IMAGE_NAME , & ClearCloudInit { } , spawn_qemu)
645- }
646-
647588 #[ test]
648589 #[ cfg( not( feature = "coreboot" ) ) ]
649590 fn test_boot_ch_focal ( ) {
@@ -655,12 +596,6 @@ mod tests {
655596 fn test_boot_ch_jammy ( ) {
656597 test_boot ( JAMMY_IMAGE_NAME , & UbuntuCloudInit { } , spawn_ch)
657598 }
658-
659- #[ test]
660- #[ cfg( not( feature = "coreboot" ) ) ]
661- fn test_boot_ch_clear ( ) {
662- test_boot ( CLEAR_IMAGE_NAME , & ClearCloudInit { } , spawn_ch)
663- }
664599 }
665600 }
666601
0 commit comments