public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 8/9] testsuite: Run custom commands and scripts on some qemu targets
Date: Wed,  8 Feb 2023 16:45:10 +0100	[thread overview]
Message-ID: <20230208154511.1884-9-ubely@ilbers.de> (raw)
In-Reply-To: <20230208154511.1884-1-ubely@ilbers.de>

For demonstaration purposes, build 'isar-image-ci' for some targets
and add corresponding VM run tests with custom commands and scripts.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 testsuite/citest.py              | 105 ++++++++++++++++++++++++++-----
 testsuite/test_example_module.sh |   5 ++
 testsuite/test_getty_target.sh   |   7 +++
 3 files changed, 103 insertions(+), 14 deletions(-)
 create mode 100644 testsuite/test_example_module.sh
 create mode 100644 testsuite/test_getty_target.sh

diff --git a/testsuite/citest.py b/testsuite/citest.py
index 975cb064..17a90244 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -123,8 +123,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:de0-nano-soc-bullseye:isar-image-base',
             'mc:stm32mp15x-buster:isar-image-base'
                   ]
@@ -156,7 +156,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'
                   ]
 
@@ -198,9 +198,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',
@@ -214,7 +214,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()
@@ -241,7 +241,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'
                   ]
 
@@ -340,15 +340,48 @@ 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')
+
+    def test_arm_bullseye_getty_target(self):
+        self.init()
+        self.vm_start('arm','bullseye', \
+            image='isar-image-ci', script='test_getty_target.sh')
 
     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_arm_buster_example_module(self):
+        self.init()
+        self.vm_start('arm','buster', \
+            image='isar-image-ci', script='test_example_module.sh')
 
     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')
+
+    def test_arm_bookworm_getty_target(self):
+        self.init()
+        self.vm_start('arm','bookworm', \
+            image='isar-image-ci', script='test_getty_target.sh')
 
 class VmBootTestFull(CIBaseTest):
 
@@ -363,11 +396,33 @@ 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_arm_buster_getty_target(self):
+        self.init()
+        self.vm_start('arm','buster', \
+            image='isar-image-ci', script='test_getty_target.sh')
 
     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_arm64_bullseye_example_module(self):
+        self.init()
+        self.vm_start('arm64','bullseye', \
+            image='isar-image-ci', script='test_example_module.sh')
 
     def test_i386_buster(self):
         self.init()
@@ -382,7 +437,18 @@ 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_focal_getty_target(self):
+        self.init()
+        self.vm_start('amd64','focal', \
+            image='isar-image-ci', script='test_getty_target.sh')
 
     def test_amd64_bookworm(self):
         self.init()
@@ -398,4 +464,15 @@ 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')
+
+    def test_mipsel_bookworm_example_module(self):
+        self.init()
+        self.vm_start('mipsel','bookworm', \
+            image='isar-image-ci', script='test_example_module.sh')
diff --git a/testsuite/test_example_module.sh b/testsuite/test_example_module.sh
new file mode 100644
index 00000000..175030d1
--- /dev/null
+++ b/testsuite/test_example_module.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+lsmod | grep '^example_module '
diff --git a/testsuite/test_getty_target.sh b/testsuite/test_getty_target.sh
new file mode 100644
index 00000000..38c0fc1e
--- /dev/null
+++ b/testsuite/test_getty_target.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+sleep 10
+
+systemctl is-active getty.target
-- 
2.20.1


  parent reply	other threads:[~2023-02-08 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 15:45 [PATCH v2 0/9] Support running custom commands in VM Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 1/9] testsuite: Fix failing hostname service in qemu guest Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 2/9] testsuite: Add SSH key pair for using in CI Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 3/9] meta-isar: Add a recipe that configures ci user Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 4/9] meta-isar: Use a separate image recipe in CI Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 5/9] testsuite: Allow custom image names in start_vm.py Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 6/9] testsuite: Support running custom commands in VM Uladzimir Bely
2023-02-08 15:45 ` [PATCH v2 7/9] testsuite: Support running custom scripts " Uladzimir Bely
2023-02-08 15:45 ` Uladzimir Bely [this message]
2023-02-08 15:45 ` [PATCH v2 9/9] testsuite: Update testsuite qemu-related documentation Uladzimir Bely
2023-02-21 10:56 ` [PATCH v2 0/9] Support running custom commands in VM Uladzimir Bely

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=20230208154511.1884-9-ubely@ilbers.de \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.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