* [PATCH v3 0/2] Cover installer image with tests
@ 2025-02-20 12:09 Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Uladzimir Bely @ 2025-02-20 12:09 UTC (permalink / raw)
To: isar-users
We had an implementation of isar-installer that was not covered
by our testsuite.
Patch 1 improves some installer things in kas that were helpful for
developing patches 2/3 implementing CI tests for the installer.
Changes since v2:
- Reuse perform_build_test functionality for installer build test.
Changes since v1:
- Reuse vm_start functionality for installer run test;
- Add ssh run test to check for final root partition.
Uladzimir Bely (2):
kas: Allow isar-image-ci to be embedded into installer image.
testsuite: Add tests for installer image
kas/image/Kconfig | 8 +++++++-
testsuite/cibuilder.py | 22 ++++++++++++++++++++++
testsuite/citest.py | 27 +++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
--
2.45.3
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250220121150.14318-1-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/2] kas: Allow isar-image-ci to be embedded into installer image.
2025-02-20 12:09 [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
@ 2025-02-20 12:09 ` Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 2/2] testsuite: Add tests for " Uladzimir Bely
2025-02-27 7:50 ` [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
2 siblings, 0 replies; 4+ messages in thread
From: Uladzimir Bely @ 2025-02-20 12:09 UTC (permalink / raw)
To: isar-users
Also, this fixes typo for isar-image-debug embedding.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
kas/image/Kconfig | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kas/image/Kconfig b/kas/image/Kconfig
index 0c0a664c..d602c369 100644
--- a/kas/image/Kconfig
+++ b/kas/image/Kconfig
@@ -48,6 +48,11 @@ config INSTALL_IMAGE_BASE
help
Embed the basic Isar image into the installer image.
+config INSTALL_IMAGE_CI
+ bool "CI image"
+ help
+ Embed the Isar CI image into the installer image.
+
config INSTALL_IMAGE_DEBUG
bool "Debug image"
help
@@ -65,7 +70,8 @@ endchoice
config INSTALLER_TARGET_IMAGE
string
default "isar-image-base" if INSTALL_IMAGE_BASE
- default "isar-image-base" if INSTALL_IMAGE_DEBUG
+ default "isar-image-ci" if INSTALL_IMAGE_CI
+ default "isar-image-debug" if INSTALL_IMAGE_DEBUG
config INSTALL_UNATTENDED
bool "Run installer unattended"
--
2.45.3
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250220121150.14318-2-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] testsuite: Add tests for installer image
2025-02-20 12:09 [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
@ 2025-02-20 12:09 ` Uladzimir Bely
2025-02-27 7:50 ` [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
2 siblings, 0 replies; 4+ messages in thread
From: Uladzimir Bely @ 2025-02-20 12:09 UTC (permalink / raw)
To: isar-users
The idea is to pass to qemu two wic files (hard drives):
- sda: empty wic file;
- sdb: the image with installer.
When run, first boot is done from sdb (since sda is empty), then
installer flashes target image to sda and reboots the system.
Second boot is automatically done from sda drive just populated.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/cibuilder.py | 22 ++++++++++++++++++++++
testsuite/citest.py | 27 +++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index b5b6a093..52eb35e8 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -109,6 +109,10 @@ class CIBuilder(Test):
source_date_epoch=None,
use_apt_snapshot=False,
image_install=None,
+ installer_image=None,
+ installer_machine=None,
+ installer_distro=None,
+ installer_device=None,
**kwargs,
):
# write configuration file and set bitbake_args
@@ -155,6 +159,7 @@ class CIBuilder(Test):
f" sstate_dir = {sstate_dir}\n"
f" ccache_dir = {ccache_dir}\n"
f" image_install = {image_install}\n"
+ f" installer_image = {installer_image}\n"
f"==================================================="
)
@@ -216,6 +221,23 @@ class CIBuilder(Test):
f.write('IMAGE_INSTALL = "%s"\n' % image_install)
if fail_on_cleanup == '1':
f.write('ISAR_FAIL_ON_CLEANUP = "1"\n')
+ if installer_image:
+ install_target = self.build_dir + '/installer.wic'
+ # Create empty file installer will write to
+ with open(install_target, 'w') as wic:
+ size = 4294967296 # 4GiB should be enough for the target
+ wic.write("\0" * size)
+
+ f.write('BBMULTICONFIG += "isar-installer installer-target"\n')
+ f.write('INSTALLER_UNATTENDED = "1"\n')
+ f.write('INSTALLER_TARGET_OVERWRITE = "OVERWRITE"\n')
+ f.write(f'INSTALLER_TARGET_IMAGE = "{installer_image}"\n')
+ f.write(f'INSTALLER_TARGET_DEVICE = "{installer_device}"\n')
+ f.write(f'DISTRO ?= "{installer_distro}"\n')
+ f.write(f'MACHINE ?= "{installer_machine}"\n')
+ f.write(f'QEMU_DISK_ARGS = "-bios /usr/share/ovmf/OVMF.fd"\n')
+ f.write(f'QEMU_DISK_ARGS += "-hda {install_target}"\n')
+ f.write(f'QEMU_DISK_ARGS += "-hdb ##ROOTFS_IMAGE##"\n')
# include ci_build.conf in local.conf
with open(self.build_dir + '/conf/local.conf', 'r+') as f:
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 47f49263..0f73b635 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -122,6 +122,33 @@ class CcacheTest(CIBaseTest):
self.perform_ccache_test(targets)
+class InstallerTest(CIBaseTest):
+
+ """
+ Installer test
+
+ :avocado: tags=installer,full
+ """
+
+ def test_installer_build(self):
+ self.init()
+ self.perform_build_test("mc:isar-installer:isar-image-installer",
+ installer_image="isar-image-ci",
+ installer_machine="qemuamd64",
+ installer_distro="debian-bookworm",
+ installer_device="/dev/sda")
+
+ def test_installer_run(self):
+ self.init()
+ self.vm_start('amd64', 'bookworm', image='isar-image-installer',
+ keep=True)
+
+ def test_installer_root_partition(self):
+ self.init()
+ self.vm_start('amd64', 'bookworm', image='isar-image-installer',
+ cmd='findmnt -n -o SOURCE / | grep -q sda2')
+
+
class CrossTest(CIBaseTest):
"""
--
2.45.3
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250220121150.14318-3-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 0/2] Cover installer image with tests
2025-02-20 12:09 [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 2/2] testsuite: Add tests for " Uladzimir Bely
@ 2025-02-27 7:50 ` Uladzimir Bely
2 siblings, 0 replies; 4+ messages in thread
From: Uladzimir Bely @ 2025-02-27 7:50 UTC (permalink / raw)
To: isar-users
On Thu, 2025-02-20 at 15:09 +0300, Uladzimir Bely wrote:
> We had an implementation of isar-installer that was not covered
> by our testsuite.
>
> Patch 1 improves some installer things in kas that were helpful for
> developing patches 2/3 implementing CI tests for the installer.
>
> Changes since v2:
> - Reuse perform_build_test functionality for installer build test.
>
> Changes since v1:
> - Reuse vm_start functionality for installer run test;
> - Add ssh run test to check for final root partition.
>
> Uladzimir Bely (2):
> kas: Allow isar-image-ci to be embedded into installer image.
> testsuite: Add tests for installer image
>
> kas/image/Kconfig | 8 +++++++-
> testsuite/cibuilder.py | 22 ++++++++++++++++++++++
> testsuite/citest.py | 27 +++++++++++++++++++++++++++
> 3 files changed, 56 insertions(+), 1 deletion(-)
>
> --
> 2.45.3
>
Applied to next.
--
Best regards,
Uladzimir.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/1df549c1f29bca7cc314fb2b03957acb97aa8871.camel%40ilbers.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-27 7:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-20 12:09 [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
2025-02-20 12:09 ` [PATCH v3 2/2] testsuite: Add tests for " Uladzimir Bely
2025-02-27 7:50 ` [PATCH v3 0/2] Cover installer image with tests Uladzimir Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox