summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-06-23 11:19:49 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-26 14:08:02 +0100
commit0ffc5c38ef28605abf815a47eb41923802d31df7 (patch)
treef12d1696b5264da395b4653f75a1de2cb0879a7e /meta
parent42b86a1654452348036c5d348d2fa5fe27e98245 (diff)
downloadopenembedded-core-0ffc5c38ef28605abf815a47eb41923802d31df7.tar.gz
openembedded-core-0ffc5c38ef28605abf815a47eb41923802d31df7.tar.bz2
openembedded-core-0ffc5c38ef28605abf815a47eb41923802d31df7.zip
wic: oe-selftest: Test image compressing
Added 4 new testcases for 'wic --compress-with <compressor>' functionality. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/wic.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 47b70fda2b..53855625b8 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -103,3 +103,33 @@ class Wic(oeSelfTest):
def test11_help_kickstart(self):
"""Test wic help kickstart"""
self.assertEqual(0, runCmd('wic help kickstart').status)
+
+ def test12_compress_gzip(self):
+ """Test compressing an image with gzip"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c gzip").status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "directdisk-*.direct.gz")))
+
+ def test13_compress_gzip(self):
+ """Test compressing an image with bzip2"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c bzip2").status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "directdisk-*.direct.bz2")))
+
+ def test14_compress_gzip(self):
+ """Test compressing an image with xz"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c xz").status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "directdisk-*.direct.xz")))
+
+ def test15_wrong_compressor(self):
+ """Test how wic breaks if wrong compressor is provided"""
+ self.assertEqual(2, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c wrong", ignore_status=True).status)