[oe-commits] [openembedded-core] 40/41: meta-selftest: wic: Add test for --use-uuid / --fsuuid
git at git.openembedded.org
git at git.openembedded.org
Mon Dec 18 18:05:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 6d9396b26218f3234701944f385d5c36face8121
Author: Tom Rini <trini at konsulko.com>
AuthorDate: Wed Dec 13 22:20:26 2017 -0500
meta-selftest: wic: Add test for --use-uuid / --fsuuid
- Mount a '/media' partition to wic-image-minimal.wks with a known UUID.
- In test_qemu, sort our output from checking the output of 'mount' as
it may not be stable. Also, do not check the exit code as passing any
output to cut ensures a 0 exit code.
- Check for a 'UUID=' line in /etc/fstab with out expected output.
Signed-off-by: Tom Rini <trini at konsulko.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta-selftest/recipes-test/images/wic-image-minimal.wks | 1 +
meta/lib/oeqa/selftest/cases/wic.py | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta-selftest/recipes-test/images/wic-image-minimal.wks b/meta-selftest/recipes-test/images/wic-image-minimal.wks
index 9410b68..ae69cb6 100644
--- a/meta-selftest/recipes-test/images/wic-image-minimal.wks
+++ b/meta-selftest/recipes-test/images/wic-image-minimal.wks
@@ -4,6 +4,7 @@
part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part /media --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid 2c71ef06-a81d-4735-9d3a-379b69c6bdba
part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024
bootloader --ptable gpt --timeout=0 --append="rootwait console=tty0"
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 651d575..ccbc82e 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -634,10 +634,13 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
self.remove_config(config)
with runqemu('wic-image-minimal', ssh=False) as qemu:
- cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+ cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(output, '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
+ cmd = "grep UUID= /etc/fstab"
status, output = qemu.run_serial(cmd)
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
- self.assertEqual(output, '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt')
+ self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0')
@only_for_arch(['i586', 'i686', 'x86_64'])
@OETestID(1852)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list