Skip to content

Commit 62c4564

Browse files
traviercgwalters
authored andcommitted
lib/tests: Test zstd:chunked format
1 parent e30d232 commit 62c4564

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lib/tests/it/main.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,10 +1262,8 @@ async fn test_container_write_derive() -> Result<()> {
12621262
Ok(())
12631263
}
12641264

1265-
/// Test for zstd
1266-
/// We need to handle the case of modified hardlinks into /sysroot
1267-
#[tokio::test]
1268-
async fn test_container_zstd() -> Result<()> {
1265+
/// Implementation of a test case for non-gzip (i.e. zstd or zstd:chunked) compression
1266+
async fn test_non_gzip(format: &str) -> Result<()> {
12691267
let fixture = Fixture::new_v1()?;
12701268
let baseimg = &fixture.export_container().await?.0;
12711269
let basepath = &match baseimg.transport {
@@ -1277,7 +1275,7 @@ async fn test_container_zstd() -> Result<()> {
12771275
let st = tokio::process::Command::new("skopeo")
12781276
.args([
12791277
"copy",
1280-
"--dest-compress-format=zstd",
1278+
&format!("--dest-compress-format={format}"),
12811279
baseimg_ref.as_str(),
12821280
&format!("oci:{zstd_image_path}"),
12831281
])
@@ -1303,6 +1301,18 @@ async fn test_container_zstd() -> Result<()> {
13031301
Ok(())
13041302
}
13051303

1304+
/// Test for zstd
1305+
#[tokio::test]
1306+
async fn test_container_zstd() -> Result<()> {
1307+
test_non_gzip("zstd").await
1308+
}
1309+
1310+
/// Test for zstd:chunked
1311+
#[tokio::test]
1312+
async fn test_container_zstd_chunked() -> Result<()> {
1313+
test_non_gzip("zstd:chunked").await
1314+
}
1315+
13061316
/// Test for https://github.com/ostreedev/ostree-rs-ext/issues/405
13071317
/// We need to handle the case of modified hardlinks into /sysroot
13081318
#[tokio::test]

0 commit comments

Comments
 (0)