diff options
author | Maciej Borzecki <maciej.borzecki@rndity.com> | 2017-03-21 12:35:02 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-22 11:35:22 +0000 |
commit | 4453c21d68b7c90c088ed3e9a7c3667c2453a6be (patch) | |
tree | 10ba8ff9de5ffe0c3f77186dcccfd75d3f7c3805 | |
parent | 74c65b7528c8cb07f96dafcb75e52d171ad68a39 (diff) | |
download | poky-4453c21d68b7c90c088ed3e9a7c3667c2453a6be.tar.gz |
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.
(From OE-Core rev: 071785b01cdaa0d35808fa0b7308162cfebf54f1)
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/wic.py | 64 |
1 files 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): | |||
135 | 135 | ||
136 | @testcase(1211) | 136 | @testcase(1211) |
137 | def test_build_image_name(self): | 137 | def test_build_image_name(self): |
138 | """Test wic create directdisk --image-name=core-image-minimal""" | 138 | """Test wic create wictestdisk --image-name=core-image-minimal""" |
139 | cmd = "wic create directdisk --image-name=core-image-minimal -o %s" % self.resultdir | 139 | cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir |
140 | self.assertEqual(0, runCmd(cmd).status) | 140 | self.assertEqual(0, runCmd(cmd).status) |
141 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 141 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
142 | 142 | ||
143 | @testcase(1157) | 143 | @testcase(1157) |
144 | def test_gpt_image(self): | 144 | def test_gpt_image(self): |
@@ -230,31 +230,31 @@ class Wic(oeSelfTest): | |||
230 | @testcase(1264) | 230 | @testcase(1264) |
231 | def test_compress_gzip(self): | 231 | def test_compress_gzip(self): |
232 | """Test compressing an image with gzip""" | 232 | """Test compressing an image with gzip""" |
233 | self.assertEqual(0, runCmd("wic create directdisk " | 233 | self.assertEqual(0, runCmd("wic create wictestdisk " |
234 | "--image-name core-image-minimal " | 234 | "--image-name core-image-minimal " |
235 | "-c gzip -o %s" % self.resultdir).status) | 235 | "-c gzip -o %s" % self.resultdir).status) |
236 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct.gz"))) | 236 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz"))) |
237 | 237 | ||
238 | @testcase(1265) | 238 | @testcase(1265) |
239 | def test_compress_bzip2(self): | 239 | def test_compress_bzip2(self): |
240 | """Test compressing an image with bzip2""" | 240 | """Test compressing an image with bzip2""" |
241 | self.assertEqual(0, runCmd("wic create directdisk " | 241 | self.assertEqual(0, runCmd("wic create wictestdisk " |
242 | "--image-name=core-image-minimal " | 242 | "--image-name=core-image-minimal " |
243 | "-c bzip2 -o %s" % self.resultdir).status) | 243 | "-c bzip2 -o %s" % self.resultdir).status) |
244 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct.bz2"))) | 244 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2"))) |
245 | 245 | ||
246 | @testcase(1266) | 246 | @testcase(1266) |
247 | def test_compress_xz(self): | 247 | def test_compress_xz(self): |
248 | """Test compressing an image with xz""" | 248 | """Test compressing an image with xz""" |
249 | self.assertEqual(0, runCmd("wic create directdisk " | 249 | self.assertEqual(0, runCmd("wic create wictestdisk " |
250 | "--image-name=core-image-minimal " | 250 | "--image-name=core-image-minimal " |
251 | "--compress-with=xz -o %s" % self.resultdir).status) | 251 | "--compress-with=xz -o %s" % self.resultdir).status) |
252 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct.xz"))) | 252 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz"))) |
253 | 253 | ||
254 | @testcase(1267) | 254 | @testcase(1267) |
255 | def test_wrong_compressor(self): | 255 | def test_wrong_compressor(self): |
256 | """Test how wic breaks if wrong compressor is provided""" | 256 | """Test how wic breaks if wrong compressor is provided""" |
257 | self.assertEqual(2, runCmd("wic create directdisk " | 257 | self.assertEqual(2, runCmd("wic create wictestdisk " |
258 | "--image-name=core-image-minimal " | 258 | "--image-name=core-image-minimal " |
259 | "-c wrong -o %s" % self.resultdir, | 259 | "-c wrong -o %s" % self.resultdir, |
260 | ignore_status=True).status) | 260 | ignore_status=True).status) |
@@ -262,49 +262,49 @@ class Wic(oeSelfTest): | |||
262 | @testcase(1558) | 262 | @testcase(1558) |
263 | def test_debug_short(self): | 263 | def test_debug_short(self): |
264 | """Test -D option""" | 264 | """Test -D option""" |
265 | self.assertEqual(0, runCmd("wic create directdisk " | 265 | self.assertEqual(0, runCmd("wic create wictestdisk " |
266 | "--image-name=core-image-minimal " | 266 | "--image-name=core-image-minimal " |
267 | "-D -o %s" % self.resultdir).status) | 267 | "-D -o %s" % self.resultdir).status) |
268 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 268 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
269 | 269 | ||
270 | def test_debug_long(self): | 270 | def test_debug_long(self): |
271 | """Test --debug option""" | 271 | """Test --debug option""" |
272 | self.assertEqual(0, runCmd("wic create directdisk " | 272 | self.assertEqual(0, runCmd("wic create wictestdisk " |
273 | "--image-name=core-image-minimal " | 273 | "--image-name=core-image-minimal " |
274 | "--debug -o %s" % self.resultdir).status) | 274 | "--debug -o %s" % self.resultdir).status) |
275 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 275 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
276 | 276 | ||
277 | @testcase(1563) | 277 | @testcase(1563) |
278 | def test_skip_build_check_short(self): | 278 | def test_skip_build_check_short(self): |
279 | """Test -s option""" | 279 | """Test -s option""" |
280 | self.assertEqual(0, runCmd("wic create directdisk " | 280 | self.assertEqual(0, runCmd("wic create wictestdisk " |
281 | "--image-name=core-image-minimal " | 281 | "--image-name=core-image-minimal " |
282 | "-s -o %s" % self.resultdir).status) | 282 | "-s -o %s" % self.resultdir).status) |
283 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 283 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
284 | 284 | ||
285 | def test_skip_build_check_long(self): | 285 | def test_skip_build_check_long(self): |
286 | """Test --skip-build-check option""" | 286 | """Test --skip-build-check option""" |
287 | self.assertEqual(0, runCmd("wic create directdisk " | 287 | self.assertEqual(0, runCmd("wic create wictestdisk " |
288 | "--image-name=core-image-minimal " | 288 | "--image-name=core-image-minimal " |
289 | "--skip-build-check " | 289 | "--skip-build-check " |
290 | "--outdir %s" % self.resultdir).status) | 290 | "--outdir %s" % self.resultdir).status) |
291 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 291 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
292 | 292 | ||
293 | @testcase(1564) | 293 | @testcase(1564) |
294 | def test_build_rootfs_short(self): | 294 | def test_build_rootfs_short(self): |
295 | """Test -f option""" | 295 | """Test -f option""" |
296 | self.assertEqual(0, runCmd("wic create directdisk " | 296 | self.assertEqual(0, runCmd("wic create wictestdisk " |
297 | "--image-name=core-image-minimal " | 297 | "--image-name=core-image-minimal " |
298 | "-f -o %s" % self.resultdir).status) | 298 | "-f -o %s" % self.resultdir).status) |
299 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 299 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
300 | 300 | ||
301 | def test_build_rootfs_long(self): | 301 | def test_build_rootfs_long(self): |
302 | """Test --build-rootfs option""" | 302 | """Test --build-rootfs option""" |
303 | self.assertEqual(0, runCmd("wic create directdisk " | 303 | self.assertEqual(0, runCmd("wic create wictestdisk " |
304 | "--image-name=core-image-minimal " | 304 | "--image-name=core-image-minimal " |
305 | "--build-rootfs " | 305 | "--build-rootfs " |
306 | "--outdir %s" % self.resultdir).status) | 306 | "--outdir %s" % self.resultdir).status) |
307 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 307 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct"))) |
308 | 308 | ||
309 | @testcase(1268) | 309 | @testcase(1268) |
310 | def test_rootfs_indirect_recipes(self): | 310 | def test_rootfs_indirect_recipes(self): |
@@ -461,19 +461,19 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r | |||
461 | @testcase(1496) | 461 | @testcase(1496) |
462 | def test_bmap_short(self): | 462 | def test_bmap_short(self): |
463 | """Test generation of .bmap file -m option""" | 463 | """Test generation of .bmap file -m option""" |
464 | cmd = "wic create directdisk -e core-image-minimal -m -o %s" % self.resultdir | 464 | cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir |
465 | status = runCmd(cmd).status | 465 | status = runCmd(cmd).status |
466 | self.assertEqual(0, status) | 466 | self.assertEqual(0, status) |
467 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) | 467 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) |
468 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) | 468 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap"))) |
469 | 469 | ||
470 | def test_bmap_long(self): | 470 | def test_bmap_long(self): |
471 | """Test generation of .bmap file --bmap option""" | 471 | """Test generation of .bmap file --bmap option""" |
472 | cmd = "wic create directdisk -e core-image-minimal --bmap -o %s" % self.resultdir | 472 | cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir |
473 | status = runCmd(cmd).status | 473 | status = runCmd(cmd).status |
474 | self.assertEqual(0, status) | 474 | self.assertEqual(0, status) |
475 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) | 475 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) |
476 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) | 476 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap"))) |
477 | 477 | ||
478 | def _get_image_env_path(self, image): | 478 | def _get_image_env_path(self, image): |
479 | """Generate and obtain the path to <image>.env""" | 479 | """Generate and obtain the path to <image>.env""" |
@@ -514,21 +514,21 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r | |||
514 | image = 'core-image-minimal' | 514 | image = 'core-image-minimal' |
515 | imgenvdir = self._get_image_env_path(image) | 515 | imgenvdir = self._get_image_env_path(image) |
516 | 516 | ||
517 | self.assertEqual(0, runCmd("wic create directdisk " | 517 | self.assertEqual(0, runCmd("wic create wictestdisk " |
518 | "--image-name=%s -v %s -o %s" | 518 | "--image-name=%s -v %s -o %s" |
519 | % (image, imgenvdir, self.resultdir)).status) | 519 | % (image, imgenvdir, self.resultdir)).status) |
520 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) | 520 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) |
521 | 521 | ||
522 | def test_image_vars_dir_long(self): | 522 | def test_image_vars_dir_long(self): |
523 | """Test image vars directory selection --vars option""" | 523 | """Test image vars directory selection --vars option""" |
524 | image = 'core-image-minimal' | 524 | image = 'core-image-minimal' |
525 | imgenvdir = self._get_image_env_path(image) | 525 | imgenvdir = self._get_image_env_path(image) |
526 | self.assertEqual(0, runCmd("wic create directdisk " | 526 | self.assertEqual(0, runCmd("wic create wictestdisk " |
527 | "--image-name=%s " | 527 | "--image-name=%s " |
528 | "--vars %s " | 528 | "--vars %s " |
529 | "--outdir %s" | 529 | "--outdir %s" |
530 | % (image, imgenvdir, self.resultdir)).status) | 530 | % (image, imgenvdir, self.resultdir)).status) |
531 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) | 531 | self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct"))) |
532 | 532 | ||
533 | @testcase(1351) | 533 | @testcase(1351) |
534 | def test_wic_image_type(self): | 534 | def test_wic_image_type(self): |