From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 9/9] testsuite: Update testsuite qemu-related documentation
Date: Wed, 8 Feb 2023 16:45:11 +0100 [thread overview]
Message-ID: <20230208154511.1884-10-ubely@ilbers.de> (raw)
In-Reply-To: <20230208154511.1884-1-ubely@ilbers.de>
Added examples of avocado tests that run custom commands and scripts
under previously qemu image built.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/README.md | 41 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/testsuite/README.md b/testsuite/README.md
index 4f2a8da8..50698da5 100644
--- a/testsuite/README.md
+++ b/testsuite/README.md
@@ -48,6 +48,43 @@ $ avocado run ../testsuite/citest.py -t startvm,fast -p time_to_wait=300
$ avocado run ../testsuite/citest.py -t startvm,full -p time_to_wait=300
```
-# Other
+# Running qemu images
-There is a tool start_vm.py which is the replacement for the bash script in isar/scripts directory.
+## Manual running
+
+There is a tool `start_vm.py` which is the replacement for the bash script in
+`isar/scripts` directory. It can be used to run image previously built:
+
+```
+./start_vm.py -a amd64 -b /build -d bullseye -i isar-image-base
+```
+
+# Tests for running commands under qemu images
+
+Package `isar-image-ci` configures `ci` user with non-interactive SSH access
+to the machine. Image `isar-image-ci` preinstalls this package.
+
+Example of test that runs qemu image and executes remote command under it:
+
+```
+ def test_getty_target(self):
+ self.init()
+ self.vm_start('amd64','bookworm', \
+ image='isar-image-ci',
+ cmd='systemctl is-active getty.target')
+```
+
+To run something more complex than simple command, custom test script
+can be executed instead of command:
+
+```
+ def test_getty_target(self):
+ self.init()
+ self.vm_start('amd64','bookworm', \
+ image='isar-image-ci',
+ script='test_getty_target.sh')
+```
+
+The default location of custom scripts is `isar/testsuite/`. It can be changed
+by passing `-p test_script_dir="custom_path"` to `avocado run`
+arguments.
--
2.20.1
next prev 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 ` [PATCH v2 8/9] testsuite: Run custom commands and scripts on some qemu targets Uladzimir Bely
2023-02-08 15:45 ` Uladzimir Bely [this message]
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-10-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