From: Henning Schild <henning.schild@siemens.com>
To: Uladzimir Bely <ubely@ilbers.de>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 11/11] testsuite: Run custom commands on some qemu targets
Date: Tue, 24 Jan 2023 08:39:37 +0100 [thread overview]
Message-ID: <20230124083937.05f7de3d@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20230113071942.22506-12-ubely@ilbers.de>
Am Fri, 13 Jan 2023 08:19:42 +0100
schrieb Uladzimir Bely <ubely@ilbers.de>:
> For demonstaration purposes, build 'isar-image-ci' for some targets
> and add corresponding VM run tests with custom commands.
>
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
> testsuite/citest.py | 70
> ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 56
> insertions(+), 14 deletions(-)
>
> diff --git a/testsuite/citest.py b/testsuite/citest.py
> index 08a2a00e..527e254f 100755
> --- a/testsuite/citest.py
> +++ b/testsuite/citest.py
> @@ -69,8 +69,8 @@ class CrossTest(CIBaseTest):
> """
> def test_cross(self):
> targets = [
> - 'mc:qemuarm-buster:isar-image-base',
> - 'mc:qemuarm-bullseye:isar-image-base',
> + 'mc:qemuarm-buster:isar-image-ci',
> + 'mc:qemuarm-bullseye:isar-image-ci',
> 'mc:qemuarm64-bullseye:isar-image-base',
> 'mc:de0-nano-soc-bullseye:isar-image-base',
> 'mc:stm32mp15x-buster:isar-image-base'
> @@ -103,7 +103,7 @@ class CrossTest(CIBaseTest):
>
> def test_cross_bookworm(self):
> targets = [
> - 'mc:qemuarm-bookworm:isar-image-base',
> + 'mc:qemuarm-bookworm:isar-image-ci',
> 'mc:qemuarm64-bookworm:isar-image-base'
> ]
>
> @@ -158,9 +158,9 @@ class NoCrossTest(CIBaseTest):
> """
> def test_nocross(self):
> targets = [
> - 'mc:qemuarm-buster:isar-image-base',
> + 'mc:qemuarm-buster:isar-image-ci',
> 'mc:qemuarm-bullseye:isar-image-base',
> - 'mc:qemuarm64-bullseye:isar-image-base',
> + 'mc:qemuarm64-bullseye:isar-image-ci',
> 'mc:qemui386-buster:isar-image-base',
> 'mc:qemui386-bullseye:isar-image-base',
> 'mc:qemuamd64-buster:isar-image-base',
> @@ -175,7 +175,7 @@ class NoCrossTest(CIBaseTest):
> 'mc:bananapi-bullseye:isar-image-base',
> 'mc:nanopi-neo-bullseye:isar-image-base',
> 'mc:stm32mp15x-bullseye:isar-image-base',
> - 'mc:qemuamd64-focal:isar-image-base'
> + 'mc:qemuamd64-focal:isar-image-ci'
> ]
>
> self.init()
> @@ -202,7 +202,7 @@ class NoCrossTest(CIBaseTest):
> 'mc:qemuamd64-bookworm:isar-image-base',
> 'mc:qemuarm-bookworm:isar-image-base',
> 'mc:qemui386-bookworm:isar-image-base',
> - 'mc:qemumipsel-bookworm:isar-image-base',
> + 'mc:qemumipsel-bookworm:isar-image-ci',
> 'mc:hikey-bookworm:isar-image-base'
> ]
>
> @@ -301,11 +301,23 @@ class VmBootTestFast(CIBaseTest):
> """
> def test_arm_bullseye(self):
> self.init()
> - self.vm_start('arm','bullseye')
> + self.vm_start('arm','bullseye', \
> + image='isar-image-ci')
> +
> + def test_arm_bullseye_example_module(self):
> + self.init()
> + self.vm_start('arm','bullseye', \
> + image='isar-image-ci', cmd='lsmod | grep example_module')
I think when we add this, we should drop the log parsing on that one in
the same commit. In the end i would expect the only thing left to parse
will be that login prompt and we move all others to executing commands.
And again there is a weird mix of positional vs named args, like many
other lines in this commit.
> def test_arm_buster(self):
> self.init()
> - self.vm_start('arm','buster')
> + self.vm_start('arm','buster', \
> + image='isar-image-ci')
> +
> + def test_arm_buster_getty_target(self):
> + self.init()
> + self.vm_start('arm','buster', \
> + image='isar-image-ci', cmd='systemctl is-active
> getty.target')
> def test_arm64_bullseye(self):
> self.init()
> @@ -317,7 +329,13 @@ class VmBootTestFast(CIBaseTest):
>
> def test_arm_bookworm(self):
> self.init()
> - self.vm_start('arm','bookworm')
> + self.vm_start('arm','bookworm', \
> + image='isar-image-ci')
> +
> + def test_arm_bookworm_example_module(self):
> + self.init()
> + self.vm_start('arm','bookworm', \
> + image='isar-image-ci', cmd='lsmod | grep example_module')
All this is repeating over and over, maybe we can do better.
We could i.e. always run a default command after the parsing, that
could be "/bin/true". And some tests would set something more involved.
I also wonder how i would run multiple commands ... like a full "set
-e" shellscript without having to write several tests and booting many
times.
Maybe a
with start_vm as vm:
run_cmd1(vm)
run_cmd2(vm)
vm magically shuts down when leaving the "with"-scope
Henning
> class VmBootTestFull(CIBaseTest):
>
> @@ -332,11 +350,23 @@ class VmBootTestFull(CIBaseTest):
>
> def test_arm_buster(self):
> self.init()
> - self.vm_start('arm','buster')
> + self.vm_start('arm','buster', \
> + image='isar-image-ci')
> +
> + def test_arm_buster_example_module(self):
> + self.init()
> + self.vm_start('arm','buster', \
> + image='isar-image-ci', cmd='lsmod | grep example_module')
>
> def test_arm64_bullseye(self):
> self.init()
> - self.vm_start('arm64','bullseye')
> + self.vm_start('arm64','bullseye', \
> + image='isar-image-ci')
> +
> + def test_arm64_bullseye_getty_target(self):
> + self.init()
> + self.vm_start('arm64','bullseye', \
> + image='isar-image-ci', cmd='systemctl is-active
> getty.target')
> def test_amd64_bullseye(self):
> self.init()
> @@ -355,7 +385,13 @@ class VmBootTestFull(CIBaseTest):
>
> def test_amd64_focal(self):
> self.init()
> - self.vm_start('amd64','focal')
> + self.vm_start('amd64','focal', \
> + image='isar-image-ci')
> +
> + def test_amd64_focal_example_module(self):
> + self.init()
> + self.vm_start('amd64','focal', \
> + image='isar-image-ci', cmd='lsmod | grep example_module')
>
> def test_amd64_bookworm(self):
> self.init()
> @@ -371,4 +407,10 @@ class VmBootTestFull(CIBaseTest):
>
> def test_mipsel_bookworm(self):
> self.init()
> - self.vm_start('mipsel','bookworm')
> + self.vm_start('mipsel','bookworm', \
> + image='isar-image-ci')
> +
> + def test_mipsel_bookworm_getty_target(self):
> + self.init()
> + self.vm_start('mipsel','bookworm', \
> + image='isar-image-ci', cmd='systemctl is-active
> getty.target')
prev parent reply other threads:[~2023-01-24 7:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 7:19 [PATCH 00/11] Support running custom commands in VM Uladzimir Bely
2023-01-13 7:19 ` [PATCH 01/11] testsuite: Fix failing hostname service in qemu guest Uladzimir Bely
2023-01-13 7:19 ` [PATCH 02/11] testsuite: Allow custom image names in start_vm.py Uladzimir Bely
2023-01-24 6:59 ` Henning Schild
2023-01-13 7:19 ` [PATCH 03/11] testsuite: Fix terminal broken after run test executed Uladzimir Bely
2023-01-13 7:19 ` [PATCH 04/11] testsuite: Add SSH key pair for using in CI Uladzimir Bely
2023-01-13 7:19 ` [PATCH 05/11] image-account-extension: Add copy-ci-key flag for user Uladzimir Bely
2023-01-24 7:09 ` Henning Schild
2023-01-24 7:18 ` Henning Schild
2023-01-25 7:36 ` Uladzimir Bely
2023-01-25 8:45 ` Henning Schild
2023-01-13 7:19 ` [PATCH 06/11] meta-isar: Fix PCI bus initialization in qemuarm machine Uladzimir Bely
2023-02-08 13:03 ` Uladzimir Bely
2023-01-13 7:19 ` [PATCH 07/11] testsuite: Use random free port for qemu SSH forwarding Uladzimir Bely
2023-01-24 7:11 ` Henning Schild
2023-02-08 13:04 ` Uladzimir Bely
2023-01-13 7:19 ` [PATCH 08/11] testsuite: Support running custom commands in VM Uladzimir Bely
2023-01-24 7:14 ` Henning Schild
2023-01-24 7:14 ` Henning Schild
2023-01-13 7:19 ` [PATCH 09/11] meta-isar: Use a separate image recipe in CI Uladzimir Bely
2023-01-13 7:19 ` [PATCH 10/11] isar-image-ci: Make ethernet inerface auto bring up in ubuntu-focal Uladzimir Bely
2023-01-24 7:24 ` Henning Schild
2023-01-24 7:27 ` Henning Schild
2023-01-13 7:19 ` [PATCH 11/11] testsuite: Run custom commands on some qemu targets Uladzimir Bely
2023-01-24 7:39 ` Henning Schild [this message]
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=20230124083937.05f7de3d@md1za8fc.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=ubely@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