diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index bb4ac23ebf..d7a9b14658 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
| @@ -1905,6 +1905,42 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" | |||
| 1905 | self.assertIn("Source parameter 'fill' only works with the '--fixed-size' option, exiting.", result.output) | 1905 | self.assertIn("Source parameter 'fill' only works with the '--fixed-size' option, exiting.", result.output) |
| 1906 | self.assertNotEqual(0, result.status) | 1906 | self.assertNotEqual(0, result.status) |
| 1907 | 1907 | ||
| 1908 | def test_diskid_on_msdos_partition(self): | ||
| 1909 | """Test diksid on msdos partions""" | ||
| 1910 | img = 'core-image-minimal' | ||
| 1911 | diskid = "0xdeadbbef" | ||
| 1912 | with NamedTemporaryFile("w", suffix=".wks") as wks: | ||
| 1913 | wks.writelines(['bootloader --ptable msdos --diskid %s\n' % diskid, | ||
| 1914 | 'part /boot --size=100M --active --fstype=ext4 --label boot\n' | ||
| 1915 | 'part / --source rootfs --fstype=ext4 --label root\n']) | ||
| 1916 | wks.flush() | ||
| 1917 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) | ||
| 1918 | runCmd(cmd) | ||
| 1919 | wksname = os.path.splitext(os.path.basename(wks.name))[0] | ||
| 1920 | out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) | ||
| 1921 | self.assertEqual(1, len(out)) | ||
| 1922 | sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') | ||
| 1923 | result = runCmd("%s/usr/sbin/sfdisk -l %s | grep 'Disk identifier:'" % (sysroot, out[0])) | ||
| 1924 | self.assertEqual("Disk identifier: %s" % diskid.lower(), result.output) | ||
| 1925 | |||
| 1926 | def test_diskid_on_gpt_partition(self): | ||
| 1927 | """Test diksid on gpt partions""" | ||
| 1928 | img = 'core-image-minimal' | ||
| 1929 | diskid = "deadbeef-cafe-babe-f00d-cec2ea4eface" | ||
| 1930 | with NamedTemporaryFile("w", suffix=".wks") as wks: | ||
| 1931 | wks.writelines(['bootloader --ptable gpt --diskid %s\n' % diskid, | ||
| 1932 | 'part /boot --size=100M --active --fstype=ext4 --label boot\n' | ||
| 1933 | 'part / --source rootfs --fstype=ext4 --label root\n']) | ||
| 1934 | wks.flush() | ||
| 1935 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) | ||
| 1936 | runCmd(cmd) | ||
| 1937 | wksname = os.path.splitext(os.path.basename(wks.name))[0] | ||
| 1938 | out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) | ||
| 1939 | self.assertEqual(1, len(out)) | ||
| 1940 | sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') | ||
| 1941 | result = runCmd("%s/usr/sbin/sfdisk -l %s | grep 'Disk identifier:'" % (sysroot, out[0])) | ||
| 1942 | self.assertEqual("Disk identifier: %s" % diskid.upper(), result.output) | ||
| 1943 | |||
| 1908 | class ModifyTests(WicTestCase): | 1944 | class ModifyTests(WicTestCase): |
| 1909 | def test_wic_ls(self): | 1945 | def test_wic_ls(self): |
| 1910 | """Test listing image content using 'wic ls'""" | 1946 | """Test listing image content using 'wic ls'""" |
