This patch adds tests to check if the wic partition files
are copied to the deploydir if requested.
testsuite/cibase.py | 10 ++++++++++
testsuite/cibuilder.py | 5 ++++-
testsuite/citest.py | 23 +++++++++++++++++++++++
3 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 722d7bd2..6239b4de 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -17,6 +17,16 @@ class CIBaseTest(CIBuilder):
self.bitbake(targets, **kwargs)
+ def perform_wic_partition_test(self, targets, wic_deploy_parts, **kwargs):
+ self.configure(wic_deploy_parts=wic_deploy_parts, **kwargs)
+ self.bitbake(targets, **kwargs)
+
+ partition_files = set(glob.glob(f'{self.build_dir}/tmp/deploy/images/*/*.wic.p1'))
+ if wic_deploy_parts and len(partition_files) == 0:
+ self.fail('Found raw wic partitions in DEPLOY_DIR')
+ if not wic_deploy_parts and len(partition_files) != 0:
+ self.fail('Did not find raw wic partitions in DEPLOY_DIR')
+
def perform_repro_test(self, targets, signed=False, **kwargs):
gpg_pub_key = os.path.dirname(__file__) + '/keys/base-apt/test_pub.key'
gpg_priv_key = os.path.dirname(__file__) + '/keys/base-apt/test_priv.key'
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index dfb0a376..d5c83b22 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -54,7 +54,7 @@ class CIBuilder(Test):
def configure(self, compat_arch=True, cross=None, debsrc_cache=False,
container=False, ccache=False, sstate=False, offline=False,
- gpg_pub_key=None, **kwargs):
+ gpg_pub_key=None, wic_deploy_parts=False, **kwargs):
# write configuration file and set bitbake_args
# can run multiple times per test case
self.check_init()
@@ -77,6 +77,7 @@ class CIBuilder(Test):
f' ccache = {ccache}\n'
f' sstate = {sstate}\n'
f' gpg_pub_key = {gpg_pub_key}\n'
+ f' wic_deploy_parts = {wic_deploy_parts}\n'
f'===================================================')
# determine bitbake_args
@@ -105,6 +106,8 @@ class CIBuilder(Test):
f.write('IMAGE_INSTALL_remove = "example-module-${KERNEL_NAME} enable-fsck"\n')
if gpg_pub_key:
f.write('BASE_REPO_KEY="file://' + gpg_pub_key + '"\n')
+ if wic_deploy_parts:
+ f.write('WIC_DEPLOY_PARTITIONS = "1"\n')
if distro_apt_premir:
f.write('DISTRO_APT_PREMIRRORS = "%s"\n' % distro_apt_premir)
if ccache:
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 6c8eb26e..8381f21c 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -223,6 +223,29 @@ class RebuildTest(CIBaseTest):
finally:
self.restorefile(dpkgbase_file)
+class WicTest(CIBaseTest):
+
+ """
+ Test creation of wic images
+
+ :avocado: tags=wic,full
+ """
+ def test_wic_nodeploy_partitions(self):
+ targets = ['mc:qemuarm64-bookworm:isar-image-base']
+
+ self.init()
+ self.delete_from_build_dir('tmp')
+ self.perform_wic_partition_test(targets,
+ wic_deploy_parts=False, debsrc_cache=True, compat_arch=False)
+
+ def test_wic_deploy_partitions(self):
+ targets = ['mc:qemuarm64-bookworm:isar-image-base']
+
+ self.init()
+ # reuse artifacts
+ self.perform_wic_partition_test(targets,
+ wic_deploy_parts=True, debsrc_cache=True, compat_arch=False)
+
class ContainerImageTest(CIBaseTest):
"""
--
2.30.2