public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v3 0/3] expand-on-first-boot CI testing
@ 2022-11-16 14:36 Henning Schild
  2022-11-16 14:36 ` [PATCH v3 1/3] CI: improve cibuilder readability Henning Schild
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Henning Schild @ 2022-11-16 14:36 UTC (permalink / raw)
  To: isar-users; +Cc: Uladzimir Bely, Henning Schild

changes since v2:
 - add python namespace prefix for the bitbake get functions
 - install only in images that use WKS_FILEs that have the "gap"

changes since v1:
 - complete rewrite to not focus only on the tests but rather the
   feature for all examples

This first was only about testing but meanwhile has a focus on enabling
the expand feature in all example images anyhow, and later look for
traces of that happening in CI test where we can.
We install the application in any image and in the wic images add some
scratch space at the end. That will enable improved interactive use of
all those wic images, so makes sense apart from any testing.
Later use the log reading feature of the qemu tests to look for traces
of successful resizing for non ubuntu images. In ubuntu the
console_loglevel is not verbose enough to find traces.

Henning Schild (3):
  CI: improve cibuilder readability
  meta-isar: install expand-on-first-boot in most images and add space
  CI: expect a message about filesystem resize vom expand script

 meta-isar/conf/machine/qemuamd64.conf         |  1 +
 meta-isar/conf/machine/virtualbox.conf        |  1 +
 meta-isar/conf/machine/vmware.conf            |  1 +
 .../conf/multiconfig/qemuarm-bookworm.conf    |  1 +
 .../lib/wic/canned-wks/sdimage-efi-sd.wks     |  2 ++
 .../lib/wic/canned-wks/sdimage-efi.wks        |  2 ++
 testsuite/cibuilder.py                        | 26 +++++++++++++++----
 7 files changed, 29 insertions(+), 5 deletions(-)

-- 
2.37.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/3] CI: improve cibuilder readability
  2022-11-16 14:36 [PATCH v3 0/3] expand-on-first-boot CI testing Henning Schild
@ 2022-11-16 14:36 ` Henning Schild
  2022-11-16 14:36 ` [PATCH v3 2/3] meta-isar: install expand-on-first-boot in most images and add space Henning Schild
  2022-11-16 14:36 ` [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script Henning Schild
  2 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2022-11-16 14:36 UTC (permalink / raw)
  To: isar-users; +Cc: Uladzimir Bely, Henning Schild

What was called "servive_prompt" is not a prompt nor a service. Document
what that is and rename the variable.

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

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index d5c83b222d50..07a9edc56d9c 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -229,7 +229,8 @@ class CIBuilder(Test):
         self.log.info('QEMU boot line: ' + str(cmdline))
 
         login_prompt = b'isar login:'
-        service_prompt = b'Just an example'
+        # the printk of recipes-kernel/example-module
+        module_output = b'Just an example'
 
         timeout = time.time() + int(time_to_wait)
 
@@ -263,7 +264,7 @@ class CIBuilder(Test):
         if os.path.exists(output_file) and os.path.getsize(output_file) > 0:
             with open(output_file, "rb") as f1:
                 data = f1.read()
-                if service_prompt in data and login_prompt in data:
+                if module_output in data and login_prompt in data:
                     return
                 else:
                     app_log.error(data.decode(errors='replace'))
-- 
2.37.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 2/3] meta-isar: install expand-on-first-boot in most images and add space
  2022-11-16 14:36 [PATCH v3 0/3] expand-on-first-boot CI testing Henning Schild
  2022-11-16 14:36 ` [PATCH v3 1/3] CI: improve cibuilder readability Henning Schild
@ 2022-11-16 14:36 ` Henning Schild
  2022-11-16 14:36 ` [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script Henning Schild
  2 siblings, 0 replies; 7+ messages in thread
From: Henning Schild @ 2022-11-16 14:36 UTC (permalink / raw)
  To: isar-users; +Cc: Uladzimir Bely, Henning Schild

Here we take the most common and generic images and add some empty space
at the end of then.
This will enable better interactive use of our example images since
people will have some space to install some more packages. While the
space seems fixed it really is open end if the mass storage happens to be
bigger, because we install expand-on-first-boot as well.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta-isar/conf/machine/qemuamd64.conf                   | 1 +
 meta-isar/conf/machine/virtualbox.conf                  | 1 +
 meta-isar/conf/machine/vmware.conf                      | 1 +
 meta-isar/conf/multiconfig/qemuarm-bookworm.conf        | 1 +
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks | 2 ++
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks    | 2 ++
 6 files changed, 8 insertions(+)

diff --git a/meta-isar/conf/machine/qemuamd64.conf b/meta-isar/conf/machine/qemuamd64.conf
index eca2628c4ae5..785a104b8fc9 100644
--- a/meta-isar/conf/machine/qemuamd64.conf
+++ b/meta-isar/conf/machine/qemuamd64.conf
@@ -14,6 +14,7 @@ WKS_FILE_ubuntu-focal ?= "sdimage-efi-sd"
 IMAGER_INSTALL_remove_ubuntu-focal = "${GRUB_BOOTLOADER_INSTALL}"
 
 IMAGE_INSTALL += "sshd-regen-keys"
+IMAGE_INSTALL += "expand-on-first-boot"
 
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "q35"
diff --git a/meta-isar/conf/machine/virtualbox.conf b/meta-isar/conf/machine/virtualbox.conf
index de3d04c3c4b4..8c3e9bacbf9b 100644
--- a/meta-isar/conf/machine/virtualbox.conf
+++ b/meta-isar/conf/machine/virtualbox.conf
@@ -10,6 +10,7 @@ KERNEL_NAME ?= "amd64"
 WKS_FILE ?= "sdimage-efi"
 
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
+IMAGE_INSTALL += "expand-on-first-boot"
 
 VMDK_SUBFORMAT = "monolithicSparse"
 IMAGE_FSTYPES ?= "ova"
diff --git a/meta-isar/conf/machine/vmware.conf b/meta-isar/conf/machine/vmware.conf
index fba639b19350..42503374742c 100644
--- a/meta-isar/conf/machine/vmware.conf
+++ b/meta-isar/conf/machine/vmware.conf
@@ -12,6 +12,7 @@ WKS_FILE ?= "sdimage-efi"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
 
 OVF_TEMPLATE_FILE ?= "vm-img-vmware.ovf.tmpl"
+IMAGE_INSTALL += "expand-on-first-boot"
 
 VMDK_SUBFORMAT = "streamOptimized"
 IMAGE_FSTYPES ?= "ova"
diff --git a/meta-isar/conf/multiconfig/qemuarm-bookworm.conf b/meta-isar/conf/multiconfig/qemuarm-bookworm.conf
index 126935b06fda..0b9ecb664545 100644
--- a/meta-isar/conf/multiconfig/qemuarm-bookworm.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-bookworm.conf
@@ -7,3 +7,4 @@ IMAGE_FSTYPES_append = " wic"
 WKS_FILE ?= "sdimage-efi-sd"
 
 IMAGER_INSTALL += "${SYSTEMD_BOOTLOADER_INSTALL}"
+IMAGE_INSTALL += "expand-on-first-boot"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
index 754fbc46f8e4..e6b7128eb3ae 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi-sd.wks
@@ -6,4 +6,6 @@ part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot" --ondi
 
 part / --source rootfs --ondisk sda --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
 
+part --source empty --no-table --ondisk sda --size 256M
+
 bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
index f3addbc7515d..5e555b3cc472 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
@@ -6,4 +6,6 @@ part /boot --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk s
 
 part / --source rootfs --ondisk sda --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
 
+part --source empty --no-table --ondisk sda --size 256M
+
 bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
-- 
2.37.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script
  2022-11-16 14:36 [PATCH v3 0/3] expand-on-first-boot CI testing Henning Schild
  2022-11-16 14:36 ` [PATCH v3 1/3] CI: improve cibuilder readability Henning Schild
  2022-11-16 14:36 ` [PATCH v3 2/3] meta-isar: install expand-on-first-boot in most images and add space Henning Schild
@ 2022-11-16 14:36 ` Henning Schild
  2022-11-17 18:44   ` Anton Mikanovich
  2 siblings, 1 reply; 7+ messages in thread
From: Henning Schild @ 2022-11-16 14:36 UTC (permalink / raw)
  To: isar-users; +Cc: Uladzimir Bely, Henning Schild

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(-)

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)
-- 
2.37.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script
  2022-11-16 14:36 ` [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script Henning Schild
@ 2022-11-17 18:44   ` Anton Mikanovich
  2022-11-18 20:17     ` Henning Schild
  0 siblings, 1 reply; 7+ messages in thread
From: Anton Mikanovich @ 2022-11-17 18:44 UTC (permalink / raw)
  To: isar-users, Henning Schild

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?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script
  2022-11-17 18:44   ` Anton Mikanovich
@ 2022-11-18 20:17     ` Henning Schild
  2022-11-21  8:00       ` Anton Mikanovich
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Schild @ 2022-11-18 20:17 UTC (permalink / raw)
  To: Anton Mikanovich; +Cc: isar-users

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script
  2022-11-18 20:17     ` Henning Schild
@ 2022-11-21  8:00       ` Anton Mikanovich
  0 siblings, 0 replies; 7+ messages in thread
From: Anton Mikanovich @ 2022-11-21  8:00 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-21  8:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 14:36 [PATCH v3 0/3] expand-on-first-boot CI testing Henning Schild
2022-11-16 14:36 ` [PATCH v3 1/3] CI: improve cibuilder readability Henning Schild
2022-11-16 14:36 ` [PATCH v3 2/3] meta-isar: install expand-on-first-boot in most images and add space Henning Schild
2022-11-16 14:36 ` [PATCH v3 3/3] CI: expect a message about filesystem resize vom expand script Henning Schild
2022-11-17 18:44   ` Anton Mikanovich
2022-11-18 20:17     ` Henning Schild
2022-11-21  8:00       ` Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox