[v3,3/3] CI: expect a message about filesystem resize vom expand script

Message ID 20221116143614.24348-4-henning.schild@siemens.com
State Superseded, archived
Headers show
Series expand-on-first-boot CI testing | expand

Commit Message

Henning Schild Nov. 16, 2022, 2:36 p.m. UTC
We have added the expand-on-first-boot recipe and some space to grow to
our example images. So now any image using wic should "expand" on its
first boot. And the kernel actually leaves a message for us to read, at
least on debian but not on ubuntu.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 testsuite/cibuilder.py | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

Comments

Anton Mikanovich Nov. 17, 2022, 6:44 p.m. UTC | #1
16.11.2022 17:36, Henning Schild wrote:
> We have added the expand-on-first-boot recipe and some space to grow to
> our example images. So now any image using wic should "expand" on its
> first boot. And the kernel actually leaves a message for us to read, at
> least on debian but not on ubuntu.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>

Hello Henning,

It looks like wic usage check do not work (for example on qemuarm-bullseye).
Did you test it on targets we have in CI?
Henning Schild Nov. 18, 2022, 8:17 p.m. UTC | #2
Am Thu, 17 Nov 2022 21:44:37 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:

> 16.11.2022 17:36, Henning Schild wrote:
> > We have added the expand-on-first-boot recipe and some space to
> > grow to our example images. So now any image using wic should
> > "expand" on its first boot. And the kernel actually leaves a
> > message for us to read, at least on debian but not on ubuntu.
> >
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>  
> 
> Hello Henning,
> 
> It looks like wic usage check do not work (for example on
> qemuarm-bullseye). Did you test it on targets we have in CI?
> 

My latest pipeline in your CI only pointed out an issue with a
container and a missing kernel, which seems to be an issue in "next"
anyhow.

I did some manual build tests to boot tests all ran on your infra.

Henning
Anton Mikanovich Nov. 21, 2022, 8 a.m. UTC | #3
18.11.2022 23:17, Henning Schild wrote:
> My latest pipeline in your CI only pointed out an issue with a
> container and a missing kernel, which seems to be an issue in "next"
> anyhow.
>
> I did some manual build tests to boot tests all ran on your infra.
>
> Henning

The fix for container tests (adduser/addgroup issue) has already applied
to next on Friday, so now you can rebase and recheck it with CI.

Patch

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 07a9edc56d9c..5667534d7f1d 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -231,6 +231,18 @@  class CIBuilder(Test):
         login_prompt = b'isar login:'
         # the printk of recipes-kernel/example-module
         module_output = b'Just an example'
+        # output we see when expand-on-first-boot runs on ext4
+        resize_output = b'resized filesystem to'
+        expecting_resize = False
+
+        bb_output = start_vm.get_bitbake_env(arch, distro).decode()
+        wks_file = start_vm.get_bitbake_var(bb_output, 'WKS_FILE')
+        if wks_file and "sdimage-efi" in wks_file:
+            bbdistro = start_vm.get_bitbake_var(bb_output, 'DISTRO')
+            # ubuntu is less verbose so we do not see the message
+            # /etc/sysctl.d/10-console-messages.conf
+            if bbdistro and "ubuntu" not in bbdistro:
+                expecting_resize = True
 
         timeout = time.time() + int(time_to_wait)
 
@@ -265,8 +277,11 @@  class CIBuilder(Test):
             with open(output_file, "rb") as f1:
                 data = f1.read()
                 if module_output in data and login_prompt in data:
-                    return
-                else:
-                    app_log.error(data.decode(errors='replace'))
+                    if expecting_resize:
+                        if resize_output in data:
+                            return
+                    else:
+                        return
+                app_log.error(data.decode(errors='replace'))
 
         self.fail('Log ' + output_file)