wic: update test case test_qemu

Submitted by Kang Kai on Jan. 4, 2019, 2:49 a.m. | Patch ID: 157564

Details

Message ID 20190104024910.674-1-kai.kang@windriver.com
State Master Next
Commit d525bbb528b06bef680d9f09158b2d17013d0606
Headers show

Commit Message

Kang Kai Jan. 4, 2019, 2:49 a.m.
From: Kai Kang <kai.kang@windriver.com>

It checks output of mount in wic test case test_qemu. But the outputs are
different between sysvinit and systemd. Add assertion for systemd.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 36ee5e5a14..a6bc566166 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -627,7 +627,10 @@  class Wic2(WicTestCase):
         with runqemu('wic-image-minimal', ssh=False) as qemu:
             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')
+            if 'sysvinit' in get_bb_var('DISTRO_FEATURES'):
+                self.assertEqual(output, '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
+            else:
+                self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\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))

Comments

Kang Kai Jan. 11, 2019, 9:22 a.m.
On 2019/1/4 上午10:49, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
>
> It checks output of mount in wic test case test_qemu. But the outputs are
> different between sysvinit and systemd. Add assertion for systemd.
>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>   meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
> index 36ee5e5a14..a6bc566166 100644
> --- a/meta/lib/oeqa/selftest/cases/wic.py
> +++ b/meta/lib/oeqa/selftest/cases/wic.py
> @@ -627,7 +627,10 @@ class Wic2(WicTestCase):
>           with runqemu('wic-image-minimal', ssh=False) as qemu:
>               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')
> +            if 'sysvinit' in get_bb_var('DISTRO_FEATURES'):
> +                self.assertEqual(output, '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
> +            else:
> +                self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\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))


Ping
Ross Burton Jan. 11, 2019, 1:15 p.m.
I'm wondering what the point of checking the output of mount is.  If we're
just checking that the image booted then the grep is sufficient right?

Ross

On Fri, 11 Jan 2019 at 09:22, Kang Kai <Kai.Kang@windriver.com> wrote:

> On 2019/1/4 上午10:49, kai.kang@windriver.com wrote:
> > From: Kai Kang <kai.kang@windriver.com>
> >
> > It checks output of mount in wic test case test_qemu. But the outputs are
> > different between sysvinit and systemd. Add assertion for systemd.
> >
> > Signed-off-by: Kai Kang <kai.kang@windriver.com>
> > ---
> >   meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/lib/oeqa/selftest/cases/wic.py
> b/meta/lib/oeqa/selftest/cases/wic.py
> > index 36ee5e5a14..a6bc566166 100644
> > --- a/meta/lib/oeqa/selftest/cases/wic.py
> > +++ b/meta/lib/oeqa/selftest/cases/wic.py
> > @@ -627,7 +627,10 @@ class Wic2(WicTestCase):
> >           with runqemu('wic-image-minimal', ssh=False) as qemu:
> >               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')
> > +            if 'sysvinit' in get_bb_var('DISTRO_FEATURES'):
> > +                self.assertEqual(output, '/dev/root /\r\n/dev/sda1
> /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
> > +            else:
> > +                self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2
> /\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))
>
>
> Ping
>
> --
> Kai Kang
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Kang Kai Jan. 14, 2019, 2:29 a.m.
On 2019/1/11 下午9:15, Burton, Ross wrote:
> I'm wondering what the point of checking the output of mount is.  If 
> we're just checking that the image booted then the grep is sufficient 
> right?


If just checking the wic image has been booted successfully, I think 
grep /boot is sufficient. V2 will be sent.

--Kai



>
> Ross
>
> On Fri, 11 Jan 2019 at 09:22, Kang Kai <Kai.Kang@windriver.com 
> <mailto:Kai.Kang@windriver.com>> wrote:
>
>     On 2019/1/4 上午10:49, kai.kang@windriver.com
>     <mailto:kai.kang@windriver.com> wrote:
>     > From: Kai Kang <kai.kang@windriver.com
>     <mailto:kai.kang@windriver.com>>
>     >
>     > It checks output of mount in wic test case test_qemu. But the
>     outputs are
>     > different between sysvinit and systemd. Add assertion for systemd.
>     >
>     > Signed-off-by: Kai Kang <kai.kang@windriver.com
>     <mailto:kai.kang@windriver.com>>
>     > ---
>     >   meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
>     >   1 file changed, 4 insertions(+), 1 deletion(-)
>     >
>     > diff --git a/meta/lib/oeqa/selftest/cases/wic.py
>     b/meta/lib/oeqa/selftest/cases/wic.py
>     > index 36ee5e5a14..a6bc566166 100644
>     > --- a/meta/lib/oeqa/selftest/cases/wic.py
>     > +++ b/meta/lib/oeqa/selftest/cases/wic.py
>     > @@ -627,7 +627,10 @@ class Wic2(WicTestCase):
>     >           with runqemu('wic-image-minimal', ssh=False) as qemu:
>     >               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')
>     > +            if 'sysvinit' in get_bb_var('DISTRO_FEATURES'):
>     > +                self.assertEqual(output, '/dev/root
>     /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
>     > +            else:
>     > +                self.assertEqual(output, '/dev/sda1
>     /boot\r\n/dev/sda2 /\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))
>
>
>     Ping
>
>     -- 
>     Kai Kang
>
>     -- 
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>