@@ -28,6 +28,10 @@ const FIELD_ADJUST: &str = "adjust";
2828const FIELD_FIXME_SKIP_IF_COMPOSEFS : & str = "fixme_skip_if_composefs" ;
2929const FIELD_FIXME_SKIP_IF_UKI : & str = "fixme_skip_if_uki" ;
3030
31+ /// For tests that should only run for composefs systems
32+ /// Ex. composefs-gc
33+ const FIELD_SKIP_IF_OSTREE : & str = "skip_if_ostree" ;
34+
3135// bcvk options
3236const BCVK_OPT_BIND_STORAGE_RO : & str = "--bind-storage-ro" ;
3337const ENV_BOOTC_UPGRADE_IMAGE : & str = "BOOTC_upgrade_image" ;
@@ -210,10 +214,11 @@ fn verify_ssh_connectivity(sh: &Shell, port: u16, key_path: &Utf8Path) -> Result
210214 )
211215}
212216
213- #[ derive( Debug ) ]
217+ #[ derive( Debug , Default ) ]
214218struct PlanMetadata {
215219 try_bind_storage : bool ,
216220 skip_if_composefs : bool ,
221+ skip_if_ostree : bool ,
217222 skip_if_uki : bool ,
218223}
219224
@@ -255,8 +260,7 @@ fn parse_plan_metadata(
255260 . and_modify ( |m| m. try_bind_storage = b)
256261 . or_insert ( PlanMetadata {
257262 try_bind_storage : b,
258- skip_if_uki : false ,
259- skip_if_composefs : false ,
263+ ..Default :: default ( )
260264 } ) ;
261265 }
262266 }
@@ -271,8 +275,7 @@ fn parse_plan_metadata(
271275 . and_modify ( |m| m. skip_if_composefs = b)
272276 . or_insert ( PlanMetadata {
273277 skip_if_composefs : b,
274- skip_if_uki : false ,
275- try_bind_storage : false ,
278+ ..Default :: default ( )
276279 } ) ;
277280 }
278281 }
@@ -287,8 +290,22 @@ fn parse_plan_metadata(
287290 . and_modify ( |m| m. skip_if_uki = b)
288291 . or_insert ( PlanMetadata {
289292 skip_if_uki : b,
290- skip_if_composefs : false ,
291- try_bind_storage : false ,
293+ ..Default :: default ( )
294+ } ) ;
295+ }
296+ }
297+
298+ if let Some ( skip_if_ostree) = plan_data. get ( & serde_yaml:: Value :: String ( format ! (
299+ "extra-{}" ,
300+ FIELD_SKIP_IF_OSTREE
301+ ) ) ) {
302+ if let Some ( b) = skip_if_ostree. as_bool ( ) {
303+ plan_metadata
304+ . entry ( plan_name. to_string ( ) )
305+ . and_modify ( |m| m. skip_if_ostree = b)
306+ . or_insert ( PlanMetadata {
307+ skip_if_ostree : b,
308+ ..Default :: default ( )
292309 } ) ;
293310 }
294311 }
@@ -602,6 +619,14 @@ pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> {
602619 . map ( |( _, v) | v. skip_if_composefs )
603620 . unwrap_or ( false )
604621 } ) ;
622+ } else {
623+ plans. retain ( |plan| {
624+ !plan_metadata
625+ . iter ( )
626+ . find ( |( key, _) | plan. ends_with ( key. as_str ( ) ) )
627+ . map ( |( _, v) | v. skip_if_ostree )
628+ . unwrap_or ( false )
629+ } ) ;
605630 }
606631
607632 if matches ! ( args. boot_type, crate :: BootType :: Uki ) {
@@ -1068,6 +1093,8 @@ struct TestDef {
10681093 try_bind_storage : bool ,
10691094 /// Whether to skip this test for composefs backend
10701095 skip_if_composefs : bool ,
1096+ /// Whether to skip this test for ostree backend
1097+ skip_if_ostree : bool ,
10711098 /// Whether to skip this test for images with UKI
10721099 skip_if_uki : bool ,
10731100 /// TMT fmf attributes to pass through (summary, duration, adjust, etc.)
@@ -1239,6 +1266,13 @@ fn generate_integration() -> Result<(String, String)> {
12391266 . and_then ( |v| v. as_bool ( ) )
12401267 . unwrap_or ( false ) ;
12411268
1269+ let skip_if_ostree = metadata
1270+ . extra
1271+ . as_mapping ( )
1272+ . and_then ( |m| m. get ( & serde_yaml:: Value :: String ( FIELD_SKIP_IF_OSTREE . to_string ( ) ) ) )
1273+ . and_then ( |v| v. as_bool ( ) )
1274+ . unwrap_or ( false ) ;
1275+
12421276 let skip_if_uki = metadata
12431277 . extra
12441278 . as_mapping ( )
@@ -1256,6 +1290,7 @@ fn generate_integration() -> Result<(String, String)> {
12561290 test_command,
12571291 try_bind_storage,
12581292 skip_if_composefs,
1293+ skip_if_ostree,
12591294 skip_if_uki,
12601295 tmt : metadata. tmt ,
12611296 } ) ;
@@ -1379,6 +1414,13 @@ fn generate_integration() -> Result<(String, String)> {
13791414 ) ;
13801415 }
13811416
1417+ if test. skip_if_ostree {
1418+ plan_value. insert (
1419+ serde_yaml:: Value :: String ( format ! ( "extra-{}" , FIELD_SKIP_IF_OSTREE ) ) ,
1420+ serde_yaml:: Value :: Bool ( true ) ,
1421+ ) ;
1422+ }
1423+
13821424 if test. skip_if_uki {
13831425 plan_value. insert (
13841426 serde_yaml:: Value :: String ( format ! ( "extra-{}" , FIELD_FIXME_SKIP_IF_UKI ) ) ,
0 commit comments