Skip to content

Commit

Permalink
lib/tests: Test zstd:chunked format
Browse files Browse the repository at this point in the history
  • Loading branch information
travier authored and cgwalters committed Apr 29, 2024
1 parent e30d232 commit 62c4564
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,10 +1262,8 @@ async fn test_container_write_derive() -> Result<()> {
Ok(())
}

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

/// Test for zstd
#[tokio::test]
async fn test_container_zstd() -> Result<()> {
test_non_gzip("zstd").await
}

/// Test for zstd:chunked
#[tokio::test]
async fn test_container_zstd_chunked() -> Result<()> {
test_non_gzip("zstd:chunked").await
}

/// Test for https://github.com/ostreedev/ostree-rs-ext/issues/405
/// We need to handle the case of modified hardlinks into /sysroot
#[tokio::test]
Expand Down

0 comments on commit 62c4564

Please sign in to comment.