* [PATCH 0/2] Cover installer image with tests
@ 2025-02-11 14:10 Uladzimir Bely
2025-02-11 14:10 ` [PATCH 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
2025-02-11 14:10 ` [PATCH 2/2] testsuite: Add tests for " Uladzimir Bely
0 siblings, 2 replies; 3+ messages in thread
From: Uladzimir Bely @ 2025-02-11 14:10 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 was helpful for
developing patch 2 implementing missing tests for the installer.
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/cibase.py | 36 ++++++++++++++++++++++++++++++++++++
testsuite/citest.py | 20 ++++++++++++++++++++
3 files changed, 63 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/20250211141754.5442-1-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] kas: Allow isar-image-ci to be embedded into installer image.
2025-02-11 14:10 [PATCH 0/2] Cover installer image with tests Uladzimir Bely
@ 2025-02-11 14:10 ` Uladzimir Bely
2025-02-11 14:10 ` [PATCH 2/2] testsuite: Add tests for " Uladzimir Bely
1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2025-02-11 14:10 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/20250211141754.5442-2-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] testsuite: Add tests for installer image
2025-02-11 14:10 [PATCH 0/2] Cover installer image with tests Uladzimir Bely
2025-02-11 14:10 ` [PATCH 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
@ 2025-02-11 14:10 ` Uladzimir Bely
1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2025-02-11 14:10 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 written.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/cibase.py | 36 ++++++++++++++++++++++++++++++++++++
testsuite/citest.py | 20 ++++++++++++++++++++
2 files changed, 56 insertions(+)
diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 075535b1..6c66a193 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -77,6 +77,42 @@ class CIBaseTest(CIBuilder):
process.run('gpgconf --kill gpg-agent')
shutil.rmtree(gnupg_home, True)
+ def perform_installer_build_test(self, target, distro, machine, **kwargs):
+ self.configure(**kwargs)
+
+ # append ci_build.conf
+ with open(self.build_dir + '/conf/ci_build.conf', 'a') as f:
+ f.write('\n#Installer mage build configuration\n')
+ f.write(f'DISTRO ?= "{distro}"\n');
+ f.write(f'MACHINE ?= "{machine}"\n');
+ f.write('BBMULTICONFIG += "isar-installer installer-target"\n')
+ f.write('INSTALLER_TARGET_IMAGE = "isar-image-ci"\n')
+ f.write('INSTALLER_UNATTENDED = "1"\n')
+ f.write('INSTALLER_TARGET_DEVICE = "/dev/sda"\n')
+ f.write('INSTALLER_TARGET_OVERWRITE = "OVERWRITE"\n')
+
+ self.log.info("Starting build...")
+
+ self.bitbake(target, **kwargs)
+
+ def perform_installer_run_test(self, arch, distro, **kwargs):
+ install_target = CIUtils.getVars('DEPLOY_DIR_IMAGE') + '/install.wic'
+
+ # Create empty file installer will write to
+ with open(install_target, 'w') as f:
+ size = 4294967296 # 4GiB should be enough for the target
+ f.write("\0" * size)
+
+ # append ci_build.conf
+ with open(self.build_dir + '/conf/ci_build.conf', 'a') as f:
+ f.write('\n#Installer image boot configuration\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')
+
+ # Machine boots from sdb, writes image to sda and reboots to sda then
+ self.vm_start(arch, distro, image='isar-image-installer')
+
def perform_ccache_test(self, targets, **kwargs):
def ccache_stats(dir, field):
# Look ccache source's 'src/core/Statistic.hpp' for field meanings
diff --git a/testsuite/citest.py b/testsuite/citest.py
index ee965278..2de547ad 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -122,6 +122,26 @@ class CcacheTest(CIBaseTest):
self.perform_ccache_test(targets)
+class InstallerTest(CIBaseTest):
+
+ """
+ Installer test
+
+ :avocado: tags=installer,full
+ """
+
+ def test_installer_build(self):
+ self.init()
+ target = "mc:isar-installer:isar-image-installer"
+ distro = "debian-bookworm"
+ machine = "qemuamd64"
+ self.perform_installer_build_test(target, distro, machine)
+
+ def test_installer_run(self):
+ self.init()
+ self.perform_installer_run_test('amd64', 'bookworm')
+
+
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/20250211141754.5442-3-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-11 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-11 14:10 [PATCH 0/2] Cover installer image with tests Uladzimir Bely
2025-02-11 14:10 ` [PATCH 1/2] kas: Allow isar-image-ci to be embedded into installer image Uladzimir Bely
2025-02-11 14:10 ` [PATCH 2/2] testsuite: Add tests for " Uladzimir Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox