mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 03:36:36 +00:00
test(image-stream): Test more compression methods (#1565)
* test(image-stream): Add more zip compression methods * test(image-stream): Add more dmg compression methods * test(image-stream): Add bz2 level 9 test Change-Type: patch
This commit is contained in:
parent
5f5a4b61b0
commit
f1ddf07a45
@ -29,9 +29,15 @@ describe('ImageStream: BZ2', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
|
||||
describe('.getFromFilePath()', function() {
|
||||
describe('compression method', function() {
|
||||
|
||||
describe('given a bz2 image', function() {
|
||||
describe('bzip2 level 9', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(BZ2_PATH, 'etcher-test-9.img.bz2'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
describe('bzip2 level 1', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(BZ2_PATH, 'etcher-test.img.bz2'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
|
BIN
tests/image-stream/data/bz2/etcher-test-9.img.bz2
Normal file
BIN
tests/image-stream/data/bz2/etcher-test-9.img.bz2
Normal file
Binary file not shown.
BIN
tests/image-stream/data/dmg/etcher-test-adc.dmg
Normal file
BIN
tests/image-stream/data/dmg/etcher-test-adc.dmg
Normal file
Binary file not shown.
BIN
tests/image-stream/data/dmg/etcher-test-bz2.dmg
Normal file
BIN
tests/image-stream/data/dmg/etcher-test-bz2.dmg
Normal file
Binary file not shown.
BIN
tests/image-stream/data/dmg/etcher-test-lzfse.dmg
Normal file
BIN
tests/image-stream/data/dmg/etcher-test-lzfse.dmg
Normal file
Binary file not shown.
BIN
tests/image-stream/data/zip/zip-bzip2.zip
Normal file
BIN
tests/image-stream/data/zip/zip-bzip2.zip
Normal file
Binary file not shown.
BIN
tests/image-stream/data/zip/zip-deflate.zip
Normal file
BIN
tests/image-stream/data/zip/zip-deflate.zip
Normal file
Binary file not shown.
BIN
tests/image-stream/data/zip/zip-lzma.zip
Normal file
BIN
tests/image-stream/data/zip/zip-lzma.zip
Normal file
Binary file not shown.
BIN
tests/image-stream/data/zip/zip-ppmd.zip
Normal file
BIN
tests/image-stream/data/zip/zip-ppmd.zip
Normal file
Binary file not shown.
@ -27,7 +27,40 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: DMG', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
describe('compression method', function() {
|
||||
|
||||
describe('NONE', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(DMG_PATH, 'etcher-test-raw.dmg'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
describe('UDCO (ADC)', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(DMG_PATH, 'etcher-test-adc.dmg'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
describe('UDZO (ZLIB)', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(DMG_PATH, 'etcher-test-zlib.dmg'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
describe('UDBZ (BZIP2)', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(DMG_PATH, 'etcher-test-bz2.dmg'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
// NOTE: Skipped, as LZFSE is not supported by `udif` module yet
|
||||
describe.skip('ULFO (LZFSE)', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(DMG_PATH, 'etcher-test-lzfse.dmg'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
context('zlib compressed', function() {
|
||||
|
||||
|
@ -69,6 +69,42 @@ describe('ImageStream: ZIP', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('compression method', function() {
|
||||
|
||||
context('DEFLATE', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(ZIP_PATH, 'zip-deflate.zip'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
// NOTE: These tests are intentionally skipped, as the
|
||||
// zip library we're currently using only supports deflate
|
||||
context.skip('DEFLATE64', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(ZIP_PATH, 'zip-deflate64.zip'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
context.skip('PPMD', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(ZIP_PATH, 'zip-ppmd.zip'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
context.skip('BZIP2', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(ZIP_PATH, 'zip-bzip2.zip'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
context.skip('LZMA', function() {
|
||||
tester.extractFromFilePath(
|
||||
path.join(ZIP_PATH, 'zip-lzma.zip'),
|
||||
path.join(IMAGES_PATH, 'etcher-test.img'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('.getImageMetadata()', function() {
|
||||
|
||||
it('should return the correct metadata', function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user