diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 78de2fcfd0..bb4ac23ebf 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -1678,21 +1678,28 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" | |||
1678 | testfile.write("test") | 1678 | testfile.write("test") |
1679 | testfile.close() | 1679 | testfile.close() |
1680 | 1680 | ||
1681 | with NamedTemporaryFile("w", suffix=".wks") as wks: | 1681 | oldpath = os.environ['PATH'] |
1682 | wks.writelines(['part / --source extra_partition --ondisk sda --fstype=ext4 --label foo --align 4 --size 5M\n', | 1682 | os.environ['PATH'] = get_bb_var("PATH", "wic-tools") |
1683 | 'part / --source extra_partition --ondisk sda --fstype=ext4 --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', | 1683 | |
1684 | 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n']) | 1684 | try: |
1685 | wks.flush() | 1685 | with NamedTemporaryFile("w", suffix=".wks") as wks: |
1686 | _, wicimg = self._get_wic(wks.name) | 1686 | wks.writelines(['part / --source extra_partition --ondisk sda --fstype=ext4 --label foo --align 4 --size 5M\n', |
1687 | 'part / --source extra_partition --ondisk sda --fstype=ext4 --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', | ||
1688 | 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n']) | ||
1689 | wks.flush() | ||
1690 | _, wicimg = self._get_wic(wks.name) | ||
1687 | 1691 | ||
1688 | result = runCmd("wic ls %s | wc -l" % wicimg) | 1692 | result = runCmd("wic ls %s | wc -l" % wicimg) |
1689 | self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) | 1693 | self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) |
1690 | 1694 | ||
1691 | for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): | 1695 | for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): |
1692 | result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) | 1696 | result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) |
1693 | self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) | 1697 | self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) |
1694 | 1698 | ||
1695 | self.remove_config(config) | 1699 | self.remove_config(config) |
1700 | |||
1701 | finally: | ||
1702 | os.environ['PATH'] = oldpath | ||
1696 | 1703 | ||
1697 | def test_fs_types(self): | 1704 | def test_fs_types(self): |
1698 | """Test filesystem types for empty and not empty partitions""" | 1705 | """Test filesystem types for empty and not empty partitions""" |