diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/wic.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index dcb88bacad..825312e5a5 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py | |||
@@ -381,11 +381,28 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r | |||
381 | self.assertEqual(0, runCmd("dd if=%s of=%s skip=%d count=%d" % | 381 | self.assertEqual(0, runCmd("dd if=%s of=%s skip=%d count=%d" % |
382 | (wicimg, part_file, start, length)).status) | 382 | (wicimg, part_file, start, length)).status) |
383 | 383 | ||
384 | def extract_files(debugfs_output): | ||
385 | # extract file names from the output of debugfs -R 'ls -p', | ||
386 | # which looks like this: | ||
387 | # | ||
388 | # /2/040755/0/0/.//\n | ||
389 | # /2/040755/0/0/..//\n | ||
390 | # /11/040700/0/0/lost+found^M//\n | ||
391 | # /12/040755/1002/1002/run//\n | ||
392 | # /13/040755/1002/1002/sys//\n | ||
393 | # /14/040755/1002/1002/bin//\n | ||
394 | # /80/040755/1002/1002/var//\n | ||
395 | # /92/040755/1002/1002/tmp//\n | ||
396 | # | ||
397 | # NOTE the occasional ^M in file names | ||
398 | return [line.split('/')[5].strip() for line in \ | ||
399 | debugfs_output.strip().split('/\n')] | ||
400 | |||
384 | # Test partition 1, should contain the normal root directories, except | 401 | # Test partition 1, should contain the normal root directories, except |
385 | # /usr. | 402 | # /usr. |
386 | res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part1")) | 403 | res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part1")) |
387 | self.assertEqual(0, res.status) | 404 | self.assertEqual(0, res.status) |
388 | files = [line.split('/')[5] for line in res.output.split('\n')] | 405 | files = extract_files(res.output) |
389 | self.assertIn("etc", files) | 406 | self.assertIn("etc", files) |
390 | self.assertNotIn("usr", files) | 407 | self.assertNotIn("usr", files) |
391 | 408 | ||
@@ -393,7 +410,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r | |||
393 | # directories. | 410 | # directories. |
394 | res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part2")) | 411 | res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part2")) |
395 | self.assertEqual(0, res.status) | 412 | self.assertEqual(0, res.status) |
396 | files = [line.split('/')[5] for line in res.output.split('\n')] | 413 | files = extract_files(res.output) |
397 | self.assertNotIn("etc", files) | 414 | self.assertNotIn("etc", files) |
398 | self.assertNotIn("usr", files) | 415 | self.assertNotIn("usr", files) |
399 | self.assertIn("share", files) | 416 | self.assertIn("share", files) |
@@ -402,14 +419,14 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r | |||
402 | # directory, but not the files inside it. | 419 | # directory, but not the files inside it. |
403 | res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part3")) | 420 | res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part3")) |
404 | self.assertEqual(0, res.status) | 421 | self.assertEqual(0, res.status) |
405 | files = [line.split('/')[5] for line in res.output.split('\n')] | 422 | files = extract_files(res.output) |
406 | self.assertNotIn("etc", files) | 423 | self.assertNotIn("etc", files) |
407 | self.assertNotIn("usr", files) | 424 | self.assertNotIn("usr", files) |
408 | self.assertIn("share", files) | 425 | self.assertIn("share", files) |
409 | self.assertIn("bin", files) | 426 | self.assertIn("bin", files) |
410 | res = runCmd("debugfs -R 'ls -p bin' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part3")) | 427 | res = runCmd("debugfs -R 'ls -p bin' %s 2>/dev/null" % os.path.join(self.resultdir, "selftest_img.part3")) |
411 | self.assertEqual(0, res.status) | 428 | self.assertEqual(0, res.status) |
412 | files = [line.split('/')[5] for line in res.output.split('\n')] | 429 | files = extract_files(res.output) |
413 | self.assertIn(".", files) | 430 | self.assertIn(".", files) |
414 | self.assertIn("..", files) | 431 | self.assertIn("..", files) |
415 | self.assertEqual(2, len(files)) | 432 | self.assertEqual(2, len(files)) |