@@ -50,17 +50,20 @@ pub(crate) fn test_bootc_container_inspect() -> Result<()> {
5050 . expect ( "kernel.unified should be present" )
5151 . as_bool ( )
5252 . expect ( "kernel.unified should be a boolean" ) ;
53+
54+ let is_uki = std:: env:: var ( "BOOTC_boot_type" ) . is_ok_and ( |var| var == "uki" ) ;
55+
5356 if let Some ( variant) = std:: env:: var ( "BOOTC_variant" ) . ok ( ) {
54- match variant. as_str ( ) {
55- v @ "ostree" | v @ "composefs" => {
57+ match ( variant. as_str ( ) , is_uki ) {
58+ ( v @ "ostree" , _ ) | ( v @ "composefs" , false ) => {
5659 assert ! ( !unified, "Expected unified=false for variant {v}" ) ;
5760 // For traditional kernels, version should look like a uname (contains digits)
5861 assert ! (
5962 version. chars( ) . any( |c| c. is_ascii_digit( ) ) ,
6063 "version should contain version numbers for traditional kernel: {version}"
6164 ) ;
6265 }
63- "composefs-sealeduki-sdboot" => {
66+ ( "composefs" , true ) => {
6467 assert ! ( unified, "Expected unified=true for UKI variant" ) ;
6568 // For UKI, version is the filename without .efi extension (should not end with .efi)
6669 assert ! (
@@ -70,7 +73,7 @@ pub(crate) fn test_bootc_container_inspect() -> Result<()> {
7073 // Version should be non-empty after stripping extension
7174 assert ! ( !version. is_empty( ) , "version should not be empty for UKI" ) ;
7275 }
73- o => eprintln ! ( "notice: Unhandled variant for kernel check: {o}" ) ,
76+ o => eprintln ! ( "notice: Unhandled variant for kernel check: {o:? }" ) ,
7477 }
7578 }
7679
@@ -155,17 +158,19 @@ fn test_system_reinstall_help() -> Result<()> {
155158/// Verify that the values of `variant` and `base` from Justfile actually applied
156159/// to this container image.
157160fn test_variant_base_crosscheck ( ) -> Result < ( ) > {
161+ let is_uki = std:: env:: var ( "BOOTC_boot_type" ) . is_ok_and ( |var| var == "uki" ) ;
162+
158163 if let Some ( variant) = std:: env:: var ( "BOOTC_variant" ) . ok ( ) {
159164 // TODO add this to `bootc status` or so?
160165 let boot_efi = Utf8Path :: new ( "/boot/EFI" ) ;
161- match variant. as_str ( ) {
162- "composefs" | "ostree" => {
166+ match ( variant. as_str ( ) , is_uki ) {
167+ ( "composefs" , false ) | ( "ostree" , _ ) => {
163168 assert ! ( !boot_efi. try_exists( ) ?) ;
164169 }
165- "composefs-sealeduki-sdboot" => {
170+ ( "composefs" , true ) => {
166171 assert ! ( boot_efi. try_exists( ) ?) ;
167172 }
168- o => panic ! ( "Unhandled variant: {o}" ) ,
173+ o => panic ! ( "Unhandled variant: {o:? }" ) ,
169174 }
170175 }
171176 if let Some ( base) = std:: env:: var ( "BOOTC_base" ) . ok ( ) {
0 commit comments