@@ -1261,6 +1261,47 @@ async fn test_container_write_derive() -> Result<()> {
1261
1261
Ok ( ( ) )
1262
1262
}
1263
1263
1264
+ /// Test for zstd
1265
+ /// We need to handle the case of modified hardlinks into /sysroot
1266
+ #[ tokio:: test]
1267
+ async fn test_container_zstd ( ) -> Result < ( ) > {
1268
+ let fixture = Fixture :: new_v1 ( ) ?;
1269
+ let baseimg = & fixture. export_container ( ) . await ?. 0 ;
1270
+ let basepath = & match baseimg. transport {
1271
+ Transport :: OciDir => fixture. path . join ( baseimg. name . as_str ( ) ) ,
1272
+ _ => unreachable ! ( ) ,
1273
+ } ;
1274
+ let baseimg_ref = format ! ( "oci:{basepath}" ) ;
1275
+ let zstd_image_path = & fixture. path . join ( "zstd.oci" ) ;
1276
+ let st = tokio:: process:: Command :: new ( "skopeo" )
1277
+ . args ( [
1278
+ "copy" ,
1279
+ "--dest-compress-format=zstd" ,
1280
+ baseimg_ref. as_str ( ) ,
1281
+ & format ! ( "oci:{zstd_image_path}" ) ,
1282
+ ] )
1283
+ . status ( )
1284
+ . await ?;
1285
+ assert ! ( st. success( ) ) ;
1286
+
1287
+ let zstdref = & OstreeImageReference {
1288
+ sigverify : SignatureSource :: ContainerPolicyAllowInsecure ,
1289
+ imgref : ImageReference {
1290
+ transport : Transport :: OciDir ,
1291
+ name : zstd_image_path. to_string ( ) ,
1292
+ } ,
1293
+ } ;
1294
+ let mut imp =
1295
+ store:: ImageImporter :: new ( fixture. destrepo ( ) , zstdref, Default :: default ( ) ) . await ?;
1296
+ let prep = match imp. prepare ( ) . await . context ( "Init prep derived" ) ? {
1297
+ store:: PrepareResult :: AlreadyPresent ( _) => panic ! ( "should not be already imported" ) ,
1298
+ store:: PrepareResult :: Ready ( r) => r,
1299
+ } ;
1300
+ let _ = imp. import ( prep) . await . unwrap ( ) ;
1301
+
1302
+ Ok ( ( ) )
1303
+ }
1304
+
1264
1305
/// Test for https://github.com/ostreedev/ostree-rs-ext/issues/405
1265
1306
/// We need to handle the case of modified hardlinks into /sysroot
1266
1307
#[ tokio:: test]
0 commit comments