From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH 1/3] testsuite: Check availability of script to run over ssh
Date: Tue, 28 Feb 2023 08:47:36 +0100 [thread overview]
Message-ID: <20230228074738.16304-2-ubely@ilbers.de> (raw)
In-Reply-To: <20230228074738.16304-1-ubely@ilbers.de>
Running local scripts on remote machine over ssh is implemented as
`cat <script> | ssh ...". This always returns PASSED in case script
not found at specified location since the error code `cat` produces
in this case is masked by `ssh` command that finishes OK.
This fix is intended for downstreams that set custom script location
by passing `-p test_script_dir=<path>` to avocado arguments.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
testsuite/cibuilder.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 0f84ccaf..d3d90a22 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -244,6 +244,10 @@ class CIBuilder(Test):
script_dir = self.params.get('test_script_dir',
default=os.path.abspath(os.path.dirname(__file__))) + '/'
script_path = script_dir + script
+ if not os.path.exists(script_path):
+ self.log.error('Script not found: ' + script_path)
+ return 2
+
rc = subprocess.call('cat ' + script_path + ' | ' + str(cmd_prefix), shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return rc
--
2.20.1
next prev parent reply other threads:[~2023-02-28 7:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 7:47 [PATCH 0/3] Creating custom testcases based on Isar one Uladzimir Bely
2023-02-28 7:47 ` Uladzimir Bely [this message]
2023-02-28 7:47 ` [PATCH 2/3] testsuite: Move test scripts to their own subdirectory Uladzimir Bely
2023-02-28 7:47 ` [PATCH 3/3] testsuite: Document custom testcase for downstreams Uladzimir Bely
2023-02-28 10:16 ` Henning Schild
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=20230228074738.16304-2-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