diff --git a/tests/image-stream/bz2.spec.js b/tests/image-stream/bz2.spec.js index 339b1c2c..b79e042d 100644 --- a/tests/image-stream/bz2.spec.js +++ b/tests/image-stream/bz2.spec.js @@ -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')); diff --git a/tests/image-stream/data/bz2/etcher-test-9.img.bz2 b/tests/image-stream/data/bz2/etcher-test-9.img.bz2 new file mode 100644 index 00000000..1f13cba0 Binary files /dev/null and b/tests/image-stream/data/bz2/etcher-test-9.img.bz2 differ diff --git a/tests/image-stream/data/dmg/etcher-test-adc.dmg b/tests/image-stream/data/dmg/etcher-test-adc.dmg new file mode 100644 index 00000000..e7828e78 Binary files /dev/null and b/tests/image-stream/data/dmg/etcher-test-adc.dmg differ diff --git a/tests/image-stream/data/dmg/etcher-test-bz2.dmg b/tests/image-stream/data/dmg/etcher-test-bz2.dmg new file mode 100644 index 00000000..1c634fdd Binary files /dev/null and b/tests/image-stream/data/dmg/etcher-test-bz2.dmg differ diff --git a/tests/image-stream/data/dmg/etcher-test-lzfse.dmg b/tests/image-stream/data/dmg/etcher-test-lzfse.dmg new file mode 100644 index 00000000..66370e18 Binary files /dev/null and b/tests/image-stream/data/dmg/etcher-test-lzfse.dmg differ diff --git a/tests/image-stream/data/zip/zip-bzip2.zip b/tests/image-stream/data/zip/zip-bzip2.zip new file mode 100644 index 00000000..435c4530 Binary files /dev/null and b/tests/image-stream/data/zip/zip-bzip2.zip differ diff --git a/tests/image-stream/data/zip/zip-deflate.zip b/tests/image-stream/data/zip/zip-deflate.zip new file mode 100644 index 00000000..8014c145 Binary files /dev/null and b/tests/image-stream/data/zip/zip-deflate.zip differ diff --git a/tests/image-stream/data/zip/zip-lzma.zip b/tests/image-stream/data/zip/zip-lzma.zip new file mode 100644 index 00000000..c4712ef4 Binary files /dev/null and b/tests/image-stream/data/zip/zip-lzma.zip differ diff --git a/tests/image-stream/data/zip/zip-ppmd.zip b/tests/image-stream/data/zip/zip-ppmd.zip new file mode 100644 index 00000000..7e606e6f Binary files /dev/null and b/tests/image-stream/data/zip/zip-ppmd.zip differ diff --git a/tests/image-stream/dmg.spec.js b/tests/image-stream/dmg.spec.js index 98fb4632..b957fa43 100644 --- a/tests/image-stream/dmg.spec.js +++ b/tests/image-stream/dmg.spec.js @@ -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() { diff --git a/tests/image-stream/zip.spec.js b/tests/image-stream/zip.spec.js index 7c24a43d..475c3f9b 100644 --- a/tests/image-stream/zip.spec.js +++ b/tests/image-stream/zip.spec.js @@ -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() {