From: "'cedric.hombourger@siemens.com' via isar-users" <isar-users@googlegroups.com>
To: "wzh@ilbers.de" <wzh@ilbers.de>
Cc: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH 2/4] CI: add smoke-tests for switch to dracut in isar-image-ci
Date: Tue, 11 Nov 2025 16:05:02 +0000 [thread overview]
Message-ID: <cbd23429b532e3829a9a84f5fd6507182325ce34.camel@siemens.com> (raw)
In-Reply-To: <9b0a6eb6-efaa-4656-b5a6-95b83e0af247@ilbers.de>
On Tue, 2025-11-11 at 14:58 +0100, Zhihang Wei wrote:
> On 11/7/25 14:42, cedric.hombourger@siemens.com wrote:
> > On Fri, 2025-11-07 at 14:09 +0100, Zhihang Wei wrote:
> > > On 11/1/25 12:13, 'Cedric Hombourger' via isar-users wrote:
> > > > Use IMAGE_PREINSTALL to install dracut in the isar-image-ci
> > > > image and verify that it builds and boots. We also check that
> > > > a dracut-shutdown service is active (as an indication that
> > > > the system was booted using a dracut initrd). A single test
> > > > is provided as well as cross-{machine,distro} tests.
> > > >
> > > > Signed-off-by: Cedric Hombourger<cedric.hombourger@siemens.com>
> > > > ---
> > > > testsuite/citest.py | 58
> > > > +++++++++++++++++++++++++++++++++++++++++++++
> > > > 1 file changed, 58 insertions(+)
> > > >
> > > > diff --git a/testsuite/citest.py b/testsuite/citest.py
> > > > index a1214e9c..23900a6c 100755
> > > > --- a/testsuite/citest.py
> > > > +++ b/testsuite/citest.py
> > > > @@ -278,6 +278,64 @@ class KernelTests(CIBaseTest):
> > > > self.perform_build_test(targets, image_install='
> > > > '.join(modules), lines=lines)
> > > >
> > > >
> > > > +class InitRdBaseTest(CIBaseTest):
> > > > + """
> > > > + Helper class for InitRd build tests
> > > > + """
> > > > +
> > > > + DRACUT_CONF = [
> > > > + "IMAGE_PREINSTALL:append = ' dracut'",
> > > > + "IMAGE_INSTALL:remove = 'enable-fsck'",
> > > > + ]
> > > > +
> > > > + def dracut_in_image(self, targets):
> > > > + machine = 'qemuamd64'
> > > > + distro = 'bookworm'
> > > > + image = 'isar-image-ci'
> > > > + self.init()
> > > > + self.perform_build_test(targets,
> > > > lines=InitRdBaseTest.DRACUT_CONF)
> > > > +
> > > > + for target in targets:
> > > > + config = target.split(':')
> > > > + machine = config[1].split('-')[0]
> > > > + distro = config[1].split('-')[1]
> > > > + image = config[2]
> > > > +
> > > > + # systems booted via a dracut initrd have a
> > > > dracut-
> > > > shutdown service
> > > > + # check its presence
> > > > + self.vm_start(
> > > > + machine.removeprefix('qemu'), distro,
> > > > image=image,
> > > > + cmd="systemctl is-active dracut-shutdown"
> > > > + )
> > > > +
> > > > +
> > > I would suggest to move the definition of class
> > > InitRdBaseTest(CIBaseTest)
> > > to cibase.py. In citest.py there should only be definition of
> > > tests
> > > that we
> > > can directly run.
> > Are we sure we want to do this? While that's an easy change, I fear
> > that it would negatively impact readability of the tests that are
> > defined below. cibase is really at the framework level. The above
> > class
> > is getting into the specifics.
> That's true. Let's keep it as it is. It will be applied after the
> dracut
> patch
> set.
> >
> > We will anyhow need to revisit the structure of our test. If we are
> > successful in getting more test-case contributions (as I am really
> > hoping and now pushing for), then we would end-up with an enormous
> > citest.py file. We will need to break it down.
> >
> The reason for having a single citest.py file is that we couldn’t
> quickly find
> a way to make Avocado list all test cases spread across multiple py
> files
the following works for me:
avocado list . # make sure there is a dot argument
I can add that hint to ci_shell to make sure we are all aware?
> without having to specify each file explicitly on the command line.
> So, the
> current architecture is to have a plain overview of all TCs in
> citest.py and
> their implementations in cibase.py (which also breaks locality).
> If you know a way to start avocado with one location (e.g., a
> directory), we
> could evaluate the "one TC -- one py file" approach.
> > I would therefore like to give us some time to re-think the overall
> > structure of our testsuite/.
> >
> > Is that agreeable?
> >
> > > > +class InitRdTest(InitRdBaseTest):
> > > > + """
> > > > + Tests for initrd generation
> > > > + :avocado: tags=initrd,single,full
> > > > + """
> > > > +
> > > > + def test_dracut_in_image(self):
> > > > + """Test switch to dracut in an image recipe."""
> > > > + self.dracut_in_image(['mc:qemuamd64-bookworm:isar-
> > > > image-
> > > > ci'])
> > > > +
> > > > +
> > > > +class InitRdCrossTests(InitRdBaseTest):
> > > > + """
> > > > + Tests for initrd generation
> > > > + :avocado: tags=initrd,full
> > > > + """
> > > > +
> > > > + def test_dracut_in_image(self):
> > > > + """Test switch to dracut in an image recipe."""
> > > > + self.dracut_in_image([
> > > > + 'mc:qemuamd64-bookworm:isar-image-ci',
> > > > + 'mc:qemuamd64-trixie:isar-image-ci',
> > > > + 'mc:qemuarm64-bookworm:isar-image-ci',
> > > > + 'mc:qemuarm64-trixie:isar-image-ci'
> > > > + ])
> > > > +
> > > > +
> > > > class WicTest(CIBaseTest):
> > > >
> > > > """
> > > Thanks for adding new test cases. I have tested the v7 dracut
> > > patch
> > > set
> > > against these test cases and others in current CI, didn't show
> > > any
> > > error.
> > > We'll continue with this patch set after dracut can be applied.
> > >
> > > Best regards,
> > > Zhihang
>
--
Cedric Hombourger
Siemens AG
www.siemens.com
--
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/cbd23429b532e3829a9a84f5fd6507182325ce34.camel%40siemens.com.
next prev parent reply other threads:[~2025-11-11 16:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-01 11:13 [PATCH 0/4] Add test-cases for dracut-based initrds 'Cedric Hombourger' via isar-users
2025-11-01 11:13 ` [PATCH 1/4] CI: support negative build tests 'Cedric Hombourger' via isar-users
2025-11-01 11:13 ` [PATCH 2/4] CI: add smoke-tests for switch to dracut in isar-image-ci 'Cedric Hombourger' via isar-users
2025-11-07 13:09 ` Zhihang Wei
2025-11-07 13:42 ` 'cedric.hombourger@siemens.com' via isar-users
2025-11-11 13:58 ` Zhihang Wei
2025-11-11 14:09 ` 'Jan Kiszka' via isar-users
2025-11-11 16:05 ` 'cedric.hombourger@siemens.com' via isar-users [this message]
2025-11-01 11:13 ` [PATCH 3/4] CI: add build tests for isar-dracut initrd images 'Cedric Hombourger' via isar-users
2025-11-01 11:13 ` [PATCH 4/4] CI: check if the build fails when dracut fails 'Cedric Hombourger' via isar-users
2025-11-12 16:37 ` [PATCH 0/4] Add test-cases for dracut-based initrds Zhihang Wei
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=cbd23429b532e3829a9a84f5fd6507182325ce34.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=cedric.hombourger@siemens.com \
--cc=wzh@ilbers.de \
/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