From 071785b01cdaa0d35808fa0b7308162cfebf54f1 Mon Sep 17 00:00:00 2001 From: Maciej Borzecki Date: Tue, 21 Mar 2017 12:35:02 +0100 Subject: selftest: wic: replace directdisk with wictestdisk where possible Use wictestdisk instead of directdisk thus allowing more tests to be run on non-x86 compatible machines. Signed-off-by: Maciej Borzecki Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/wic.py | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index 825312e5a5..0fdd0e65eb 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py @@ -135,10 +135,10 @@ class Wic(oeSelfTest): @testcase(1211) def test_build_image_name(self): - """Test wic create directdisk --image-name=core-image-minimal""" - cmd = "wic create directdisk --image-name=core-image-minimal -o %s" % self.resultdir + """Test wic create wictestdisk --image-name=core-image-minimal""" + cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir self.assertEqual(0, runCmd(cmd).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) @testcase(1157) def test_gpt_image(self): @@ -230,31 +230,31 @@ class Wic(oeSelfTest): @testcase(1264) def test_compress_gzip(self): """Test compressing an image with gzip""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name core-image-minimal " "-c gzip -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct.gz"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz"))) @testcase(1265) def test_compress_bzip2(self): """Test compressing an image with bzip2""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "-c bzip2 -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct.bz2"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2"))) @testcase(1266) def test_compress_xz(self): """Test compressing an image with xz""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "--compress-with=xz -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct.xz"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz"))) @testcase(1267) def test_wrong_compressor(self): """Test how wic breaks if wrong compressor is provided""" - self.assertEqual(2, runCmd("wic create directdisk " + self.assertEqual(2, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "-c wrong -o %s" % self.resultdir, ignore_status=True).status) @@ -262,49 +262,49 @@ class Wic(oeSelfTest): @testcase(1558) def test_debug_short(self): """Test -D option""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "-D -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) def test_debug_long(self): """Test --debug option""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "--debug -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) @testcase(1563) def test_skip_build_check_short(self): """Test -s option""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "-s -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) def test_skip_build_check_long(self): """Test --skip-build-check option""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "--skip-build-check " "--outdir %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) @testcase(1564) def test_build_rootfs_short(self): """Test -f option""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "-f -o %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) def test_build_rootfs_long(self): """Test --build-rootfs option""" - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=core-image-minimal " "--build-rootfs " "--outdir %s" % self.resultdir).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) @testcase(1268) def test_rootfs_indirect_recipes(self): @@ -461,19 +461,19 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r @testcase(1496) def test_bmap_short(self): """Test generation of .bmap file -m option""" - cmd = "wic create directdisk -e core-image-minimal -m -o %s" % self.resultdir + cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir status = runCmd(cmd).status self.assertEqual(0, status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap"))) def test_bmap_long(self): """Test generation of .bmap file --bmap option""" - cmd = "wic create directdisk -e core-image-minimal --bmap -o %s" % self.resultdir + cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir status = runCmd(cmd).status self.assertEqual(0, status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap"))) def _get_image_env_path(self, image): """Generate and obtain the path to .env""" @@ -514,21 +514,21 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r image = 'core-image-minimal' imgenvdir = self._get_image_env_path(image) - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=%s -v %s -o %s" % (image, imgenvdir, self.resultdir)).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) def test_image_vars_dir_long(self): """Test image vars directory selection --vars option""" image = 'core-image-minimal' imgenvdir = self._get_image_env_path(image) - self.assertEqual(0, runCmd("wic create directdisk " + self.assertEqual(0, runCmd("wic create wictestdisk " "--image-name=%s " "--vars %s " "--outdir %s" % (image, imgenvdir, self.resultdir)).status) - self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) + self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) @testcase(1351) def test_wic_image_type(self): -- cgit v1.2.3