[OE-core] [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Burton, Ross ross.burton at intel.com
Fri Nov 24 15:28:21 UTC 2017


Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu (wic.Wic)
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent call
last):
  File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py",
line 32, in wrapped_f
    return func(*args, **kwargs)
  File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",
line 58, in wrapped_f
    return func(*args, **kwargs)
  File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",
line 639, in test_qemu
    self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3
/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' !=
'/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
  /dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
?               ++
+ /dev/sda4 /uuid



On 17 November 2017 at 16:08, Tom Rini <trini at konsulko.com> wrote:
>
> - Add a '/uuid' 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>
> ---
>  meta-selftest/recipes-test/images/wic-image-minimal.wks | 1 +
>  meta/lib/oeqa/selftest/cases/wic.py                     | 9 ++++++---
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/meta-selftest/recipes-test/images/wic-image-minimal.wks
b/meta-selftest/recipes-test/images/wic-image-minimal.wks
> index 9410b684bed8..2fb34c4ef40a 100644
> --- a/meta-selftest/recipes-test/images/wic-image-minimal.wks
> +++ b/meta-selftest/recipes-test/images/wic-image-minimal.wks
> @@ -5,5 +5,6 @@
>  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 /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda
--fstype=ext4 --label core --align 1024
> +part /uuid --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda
--fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid
2c71ef06-a81d-4735-9d3a-379b69c6bdba
>
>  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 651d575dc3b2..969ee1054d8b 100644
> --- a/meta/lib/oeqa/selftest/cases/wic.py
> +++ b/meta/lib/oeqa/selftest/cases/wic.py
> @@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0
--fstype=ext4 --exclude-path bin/ --r
>          self.assertEqual(0, bitbake('wic-image-minimal').status)
>          self.remove_config(config)
>
> -        with runqemu('wic-image-minimal', ssh=False) as qemu:
> -            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
> +        with runqemu('wic-image-minimal', ssh=False,
runqemuparams="nographic") as qemu:
> +            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
> +            status, output = qemu.run_serial(cmd)
> +            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2
/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')
> +            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/uuid\text4\tdefaults\t0\t0')
>
>      @only_for_arch(['i586', 'i686', 'x86_64'])
>      @OETestID(1852)
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20171124/25925535/attachment-0002.html>


More information about the Openembedded-core mailing list