feat: Add zstd support

This commit is contained in:
Peter Fern 2025-11-02 11:22:25 +11:00
parent 75bca91334
commit bca575224f
4 changed files with 22 additions and 4 deletions

View file

@ -48,6 +48,21 @@ func TestAssembleCommand(t *testing.T) {
},
want: "bash -c 'set -euo pipefail && wget --no-verbose -O - \"https://example.com/image.xz\" | xz -cd | dd of=/dev/sda bs=4M && sync'",
},
{
name: "local zstd",
options: UploadOptions{
ImageCompression: CompressionZSTD,
},
want: "bash -c 'set -euo pipefail && zstd -cd | dd of=/dev/sda bs=4M && sync'",
},
{
name: "remote zstd",
options: UploadOptions{
ImageURL: mustParseURL("https://example.com/image.zst"),
ImageCompression: CompressionZSTD,
},
want: "bash -c 'set -euo pipefail && wget --no-verbose -O - \"https://example.com/image.zst\" | zstd -cd | dd of=/dev/sda bs=4M && sync'",
},
{
name: "local bz2",
options: UploadOptions{