Skip to contentSkip to conversation

wic: update test case test_qemu

PATCH Superseded [email protected] 2 participants 4 messages Jan 4, 2019 – Jan 14, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic: update test case test_qemu

From: Kai Kang <[email protected]>

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

---
 meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/wic.py +4 -1
index 36ee5e5a14..a6bc566166 100644
@@ -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))
Signature · 1 line
2.18.0
author
#1 lore raw
Quoted 16 lines · On 2019/1/4 上午10:49, [email protected] wrote:

From: Kai Kang <[email protected]>

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

---
  meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/wic.py +0 -0
index 36ee5e5a14..a6bc566166 100644
@@ -627,7 +627,10 @@ class Wic2(WicTestCase):
          with runqemu('wic-image-minimal', ssh=False) as qemu:

meta/lib/oeqa/selftest/cases/wic.py class Wic2(WicTestCase): · line 636

Quoted 10 lines
meta/lib/oeqa/selftest/cases/wic.py +4 -1
              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

Signature · 1 line
Kai Kang
#2 lore raw

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

Quoted 45 lines · Kang Kai

Review

Quoted 11 lines · On 2019/1/4 上午10:49, [email protected] wrote:

From: Kai Kang <[email protected]>

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

---
  meta/lib/oeqa/selftest/cases/wic.py | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/lib/oeqa/selftest/cases/wic.py

meta/lib/oeqa/selftest/cases/wic.py class Wic2(WicTestCase): · line 630

Quoted 8 lines

index 36ee5e5a14..a6bc566166 100644

meta/lib/oeqa/selftest/cases/wic.py +0 -1
@@ -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')

meta/lib/oeqa/selftest/cases/wic.py class Wic2(WicTestCase): · line 631

Quoted 2 lines
meta/lib/oeqa/selftest/cases/wic.py +2 -0
+            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')

meta/lib/oeqa/selftest/cases/wic.py class Wic2(WicTestCase): · line 633

Quoted 2 lines
meta/lib/oeqa/selftest/cases/wic.py +2 -0
+            else:
+                self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')

meta/lib/oeqa/selftest/cases/wic.py class Wic2(WicTestCase):

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
              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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#3 lore raw
Quoted 1 line · Ross

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

Quoted 55 lines

Ross

On Fri, 11 Jan 2019 at 09:22, Kang Kai <[email protected] <mailto:[email protected]>> wrote:

    On 2019/1/4 上午10:49, [email protected]
    <mailto:[email protected]> wrote:
    > From: Kai Kang <[email protected]
    <mailto:[email protected]>>
    >
    > 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 <[email protected]
    <mailto:[email protected]>>
    > ---
    >   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
    [email protected]
    <mailto:[email protected]>
    http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Kai Kang