@@ -10,7 +10,7 @@ use std::{
1010
1111use crate :: install;
1212
13- const TIMEOUT : u64 = 120000 ;
13+ const TIMEOUT : u64 = 60000 ;
1414
1515fn get_deployment_dir ( ) -> Result < std:: path:: PathBuf > {
1616 let base_path = Path :: new ( "/ostree/deploy/default/deploy" ) ;
@@ -62,11 +62,14 @@ pub(crate) fn run(image: &str, testargs: libtest_mimic::Arguments) -> Result<()>
6262 ) ?;
6363
6464 // Basic flow stdout verification
65+ p. exp_string (
66+ format ! ( "Image {image} is already present locally, skipping pull." ) . as_str ( ) ,
67+ ) ?;
6568 p. exp_regex ( "Found only one user ([^:]+) with ([\\ d]+) SSH authorized keys." ) ?;
6669 p. exp_string ( "Would you like to import its SSH authorized keys" ) ?;
6770 p. exp_string ( "into the root user on the new bootc system?" ) ?;
6871 p. exp_string ( "Then you can login as root@ using those keys. [Y/n]" ) ?;
69- p. send_line ( "a " ) ?;
72+ p. send_line ( "y " ) ?;
7073
7174 p. exp_string ( "Going to run command:" ) ?;
7275
@@ -133,13 +136,35 @@ pub(crate) fn run(image: &str, testargs: libtest_mimic::Arguments) -> Result<()>
133136 ) ?;
134137
135138 p. exp_regex ( "Found only one user ([^:]+) with ([\\ d]+) SSH authorized keys." ) ?;
136- p. send_line ( "a" ) ?;
139+ p. exp_string ( "[Y/n]" ) ?;
140+ p. send_line ( "y" ) ?;
137141 p. exp_string ( "NOTICE: This will replace the installed operating system and reboot. Are you sure you want to continue? [y/N]" ) ?;
138142 p. send_line ( "y" ) ?;
139143 p. exp_string ( "Insufficient free space" ) ?;
140144 p. exp_eof ( ) ?;
141145 Ok ( ( ) )
142146 } ) ,
147+ Trial :: test ( "image pull check" , move || {
148+ let sh = & xshell:: Shell :: new ( ) ?;
149+ install:: reset_root ( sh, image) ?;
150+
151+ // Run system-reinstall-bootc
152+ let mut p: PtySession = rexpect:: spawn (
153+ "/usr/bin/system-reinstall-bootc quay.io/centos-bootc/centos-bootc:stream10" ,
154+ Some ( 600000 ) , // Increase timeout for pulling the image
155+ ) ?;
156+
157+ p. exp_string ( "Image quay.io/centos-bootc/centos-bootc:stream10 is not present locally, pulling it now." ) ?;
158+ p. exp_regex ( "Found only one user ([^:]+) with ([\\ d]+) SSH authorized keys." ) ?;
159+ p. exp_string ( "[Y/n]" ) ?;
160+ p. send_line ( "y" ) ?;
161+ p. exp_string ( "NOTICE: This will replace the installed operating system and reboot. Are you sure you want to continue? [y/N]" ) ?;
162+ p. send_line ( "y" ) ?;
163+ p. exp_string ( "Operation complete, rebooting in 10 seconds. Press Ctrl-C to cancel reboot, or press enter to continue immediately." ) ?;
164+ p. send_control ( 'c' ) ?;
165+ p. exp_eof ( ) ?;
166+ Ok ( ( ) )
167+ } ) ,
143168 ] ;
144169
145170 libtest_mimic:: run ( & testargs, tests. into ( ) ) . exit ( )
0 commit comments