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 2/4] testsuite: Add an interface to run commands over ssh
Date: Wed, 24 May 2023 04:45:12 +0200	[thread overview]
Message-ID: <20230524024514.17042-3-ubely@ilbers.de> (raw)
In-Reply-To: <20230524024514.17042-1-ubely@ilbers.de>

Added ssh_start function for using in top-level tests for running
tests on hardware targets.

In contrast to vm_start one, it doesn't run qemu machine for testing,
but assumes that the machine is already running and can be reached
over SSH connection.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 testsuite/cibuilder.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index a4edb578..a0c5711f 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -311,6 +311,28 @@ class CIBuilder(Test):
         return rc
 
 
+    def ssh_start(self, user='ci', host='localhost', port=22,
+                  cmd=None, script=None):
+        self.log.info('===================================================')
+        self.log.info('Running Isar SSH test for `%s@%s:%s`' % (user, host, port))
+        self.log.info('Remote command is `%s`' % (cmd))
+        self.log.info('Remote script is `%s`' % (script))
+        self.log.info('Isar build folder is: ' + self.build_dir)
+        self.log.info('===================================================')
+
+        self.check_init()
+
+        if cmd is not None or script is not None:
+            rc = self.remote_run(user, host, port, cmd, script)
+
+            if rc != 0:
+                self.fail('Failed with rc=%s' % rc)
+
+            return
+
+        self.fail('No command to run specified')
+
+
     def vm_start(self, arch='amd64', distro='buster',
                  enforce_pcbios=False, skip_modulecheck=False,
                  image='isar-image-base', cmd=None, script=None):
-- 
2.20.1


  parent reply	other threads:[~2023-05-24  2:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24  2:45 [PATCH 0/4] Basic hardware testing support Uladzimir Bely
2023-05-24  2:45 ` [PATCH 1/4] cibuilder.py: Refactor vm_start related functions Uladzimir Bely
2023-05-24  2:45 ` Uladzimir Bely [this message]
2023-05-24  2:45 ` [PATCH 3/4] testsuite: Separate common part of kas-based test example Uladzimir Bely
2023-05-24  2:45 ` [PATCH 4/4] testsute: Provide an example of hardware test Uladzimir Bely
2023-05-24  3:06 ` [PATCH 0/4] Basic hardware testing support MOESSBAUER, Felix
2023-05-24  4:30   ` Florian Bezdeka
2023-05-24 11:37     ` Jan Kiszka
2023-05-31 21:01 ` 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=20230524024514.17042-3-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