diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-01-26 19:30:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-31 14:38:32 +0000 |
commit | 8c51ca5cd6127cb0e491734bd1605756a11b43e9 (patch) | |
tree | e8521f2faf91f4a4c8b629205e74661d97eba4a6 | |
parent | cebf67086f6818ec1b20452f324f8c9da08ada43 (diff) | |
download | poky-8c51ca5cd6127cb0e491734bd1605756a11b43e9.tar.gz |
selftest: split wic tests cases
Split tests to run wic only once per test case.
This should fix failures caused by result images left
from the previous wic run.
(From OE-Core rev: 71e3c631bac859d00cef05bbf7bd901a96bac520)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/wic.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index 9784a6818e..24093d1d53 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py | |||
@@ -273,12 +273,15 @@ class Wic(oeSelfTest): | |||
273 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 273 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) |
274 | 274 | ||
275 | @testcase(1563) | 275 | @testcase(1563) |
276 | def test_skip_build_check(self): | 276 | def test_skip_build_check_short(self): |
277 | """Test skip build check""" | 277 | """Test -s option""" |
278 | self.assertEqual(0, runCmd("wic create directdisk " | 278 | self.assertEqual(0, runCmd("wic create directdisk " |
279 | "--image-name=core-image-minimal " | 279 | "--image-name=core-image-minimal " |
280 | "-s -o %s" % self.resultdir).status) | 280 | "-s -o %s" % self.resultdir).status) |
281 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 281 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) |
282 | |||
283 | def test_skip_build_check_long(self): | ||
284 | """Test --skip-build-check option""" | ||
282 | self.assertEqual(0, runCmd("wic create directdisk " | 285 | self.assertEqual(0, runCmd("wic create directdisk " |
283 | "--image-name=core-image-minimal " | 286 | "--image-name=core-image-minimal " |
284 | "--skip-build-check " | 287 | "--skip-build-check " |
@@ -286,12 +289,15 @@ class Wic(oeSelfTest): | |||
286 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 289 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) |
287 | 290 | ||
288 | @testcase(1564) | 291 | @testcase(1564) |
289 | def test_build_rootfs(self): | 292 | def test_build_rootfs_short(self): |
290 | """Test build rootfs""" | 293 | """Test -f option""" |
291 | self.assertEqual(0, runCmd("wic create directdisk " | 294 | self.assertEqual(0, runCmd("wic create directdisk " |
292 | "--image-name=core-image-minimal " | 295 | "--image-name=core-image-minimal " |
293 | "-f -o %s" % self.resultdir).status) | 296 | "-f -o %s" % self.resultdir).status) |
294 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 297 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) |
298 | |||
299 | def test_build_rootfs_long(self): | ||
300 | """Test --build-rootfs option""" | ||
295 | self.assertEqual(0, runCmd("wic create directdisk " | 301 | self.assertEqual(0, runCmd("wic create directdisk " |
296 | "--image-name=core-image-minimal " | 302 | "--image-name=core-image-minimal " |
297 | "--build-rootfs " | 303 | "--build-rootfs " |
@@ -328,14 +334,16 @@ class Wic(oeSelfTest): | |||
328 | self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars))) | 334 | self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars))) |
329 | 335 | ||
330 | @testcase(1496) | 336 | @testcase(1496) |
331 | def test_bmap(self): | 337 | def test_bmap_short(self): |
332 | """Test generation of .bmap file""" | 338 | """Test generation of .bmap file -m option""" |
333 | cmd = "wic create directdisk -e core-image-minimal -m -o %s" % self.resultdir | 339 | cmd = "wic create directdisk -e core-image-minimal -m -o %s" % self.resultdir |
334 | status = runCmd(cmd).status | 340 | status = runCmd(cmd).status |
335 | self.assertEqual(0, status) | 341 | self.assertEqual(0, status) |
336 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) | 342 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) |
337 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) | 343 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) |
338 | rmtree(self.resultdir) | 344 | |
345 | def test_bmap_long(self): | ||
346 | """Test generation of .bmap file --bmap option""" | ||
339 | cmd = "wic create directdisk -e core-image-minimal --bmap -o %s" % self.resultdir | 347 | cmd = "wic create directdisk -e core-image-minimal --bmap -o %s" % self.resultdir |
340 | status = runCmd(cmd).status | 348 | status = runCmd(cmd).status |
341 | self.assertEqual(0, status) | 349 | self.assertEqual(0, status) |
@@ -374,14 +382,19 @@ class Wic(oeSelfTest): | |||
374 | self.assertTrue(content[var]) | 382 | self.assertTrue(content[var]) |
375 | 383 | ||
376 | @testcase(1559) | 384 | @testcase(1559) |
377 | def test_image_vars_dir(self): | 385 | def test_image_vars_dir_short(self): |
378 | """Test image vars directory selection""" | 386 | """Test image vars directory selection -v option""" |
379 | image = 'core-image-minimal' | 387 | image = 'core-image-minimal' |
380 | imgenvdir = self._get_image_env_path(image) | 388 | imgenvdir = self._get_image_env_path(image) |
381 | 389 | ||
382 | self.assertEqual(0, runCmd("wic create directdisk " | 390 | self.assertEqual(0, runCmd("wic create directdisk " |
383 | "--image-name=%s -v %s -o %s" | 391 | "--image-name=%s -v %s -o %s" |
384 | % (image, imgenvdir, self.resultdir)).status) | 392 | % (image, imgenvdir, self.resultdir)).status) |
393 | |||
394 | def test_image_vars_dir_long(self): | ||
395 | """Test image vars directory selection --vars option""" | ||
396 | image = 'core-image-minimal' | ||
397 | imgenvdir = self._get_image_env_path(image) | ||
385 | self.assertEqual(0, runCmd("wic create directdisk " | 398 | self.assertEqual(0, runCmd("wic create directdisk " |
386 | "--image-name=%s " | 399 | "--image-name=%s " |
387 | "--vars %s " | 400 | "--vars %s " |