From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: henning.schild@siemens.com, jan.kiszka@siemens.com,
ibr@ilbers.de, amikan@ilbers.de, adriaan.schmidt@siemens.com,
Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v7 5/6] add test for wic partition deploy logic
Date: Tue, 27 Sep 2022 11:51:16 +0200 [thread overview]
Message-ID: <20220927095117.958474-6-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20220927095117.958474-1-felix.moessbauer@siemens.com>
This patch adds tests to check if the wic partition files
are copied to the deploydir if requested.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
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..e8cc299e 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -318,3 +318,26 @@ class VmBootTestFull(CIBaseTest):
def test_amd64_focal(self):
self.init()
self.vm_start('amd64','focal')
+
+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)
--
2.30.2
next prev parent reply other threads:[~2022-09-27 9:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 9:51 [PATCH v7 0/6] use xz and gzip on host (outside chroot) Felix Moessbauer
2022-09-27 9:51 ` [PATCH v7 1/6] do not crossbuild SDK for host-arch eq dist-arch Felix Moessbauer
2022-09-27 9:51 ` [PATCH v7 2/6] run imager in buildchroot-host on cross Felix Moessbauer
2022-09-27 9:51 ` [PATCH v7 3/6] Revert "wic: move out all files ending on "direct*"" Felix Moessbauer
2022-09-27 9:51 ` [PATCH v7 4/6] add option to control deploy of raw wic partitions Felix Moessbauer
2022-09-27 9:51 ` Felix Moessbauer [this message]
2022-09-27 9:51 ` [PATCH v7 6/6] add wic.xz image to qemuarm64-bookworm Felix Moessbauer
2022-10-07 18:53 ` [PATCH v7 0/6] use xz and gzip on host (outside chroot) Anton Mikanovich
2022-10-12 7:40 ` Uladzimir Bely
2022-10-13 10:45 ` MOESSBAUER, FELIX JONATHAN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220927095117.958474-6-felix.moessbauer@siemens.com \
--to=felix.moessbauer@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=amikan@ilbers.de \
--cc=henning.schild@siemens.com \
--cc=ibr@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox