@@ -10,7 +10,7 @@ use std::{
10
10
11
11
use crate :: install;
12
12
13
- const TIMEOUT : u64 = 120000 ;
13
+ const TIMEOUT : u64 = 60000 ;
14
14
15
15
fn get_deployment_dir ( ) -> Result < std:: path:: PathBuf > {
16
16
let base_path = Path :: new ( "/ostree/deploy/default/deploy" ) ;
@@ -62,11 +62,14 @@ pub(crate) fn run(image: &str, testargs: libtest_mimic::Arguments) -> Result<()>
62
62
) ?;
63
63
64
64
// Basic flow stdout verification
65
+ p. exp_string (
66
+ format ! ( "Image {image} is already present locally, skipping pull." ) . as_str ( ) ,
67
+ ) ?;
65
68
p. exp_regex ( "Found only one user ([^:]+) with ([\\ d]+) SSH authorized keys." ) ?;
66
69
p. exp_string ( "Would you like to import its SSH authorized keys" ) ?;
67
70
p. exp_string ( "into the root user on the new bootc system?" ) ?;
68
71
p. exp_string ( "Then you can login as root@ using those keys. [Y/n]" ) ?;
69
- p. send_line ( "a " ) ?;
72
+ p. send_line ( "y " ) ?;
70
73
71
74
p. exp_string ( "Going to run command:" ) ?;
72
75
@@ -133,13 +136,35 @@ pub(crate) fn run(image: &str, testargs: libtest_mimic::Arguments) -> Result<()>
133
136
) ?;
134
137
135
138
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" ) ?;
137
141
p. exp_string ( "NOTICE: This will replace the installed operating system and reboot. Are you sure you want to continue? [y/N]" ) ?;
138
142
p. send_line ( "y" ) ?;
139
143
p. exp_string ( "Insufficient free space" ) ?;
140
144
p. exp_eof ( ) ?;
141
145
Ok ( ( ) )
142
146
} ) ,
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
+ } ) ,
143
168
] ;
144
169
145
170
libtest_mimic:: run ( & testargs, tests. into ( ) ) . exit ( )
0 commit comments