public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/8] oeqa/controllers/masterimage: add a serial control command
Date: Wed, 30 Apr 2014 13:31:59 +0100	[thread overview]
Message-ID: <58a9e0919e4b5a40dcc321f01b093ef3b3f3f5b2.1398861075.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1398861075.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1398861075.git.paul.eggleton@linux.intel.com>

From: Stefan Stanacar <stefanx.stanacar@intel.com>

Similar to power control command, this depends on a user's setup to get to
the serial port of a board. For a local connected board this could just be:

TEST_SERIALCONTROL_CMD = "picocom /dev/ttyUSB0 -b 115200"

and for a serial console server: "telnet 10.11.12.13 7003" or some conmux
command.

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oeqa/controllers/masterimage.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py
index e8d321f..c6fc7d6 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -70,10 +70,12 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
         # the command should take as the last argument "off" and "on" and "cycle" (off, on)
         self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD", True) or None
         self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS") or ""
+
+        self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD", True) or None
+        self.serialcontrol_args = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or ""
+
         self.origenv = os.environ
-        if self.powercontrol_cmd:
-            if self.powercontrol_args:
-                self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
+        if self.powercontrol_cmd or self.serialcontrol_cmd:
             # the external script for controlling power might use ssh
             # ssh + keys means we need the original user env
             bborigenv = d.getVar("BB_ORIGENV", False) or {}
@@ -81,7 +83,14 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
                 val = bborigenv.getVar(key, True)
                 if val is not None:
                     self.origenv[key] = str(val)
+
+        if self.powercontrol_cmd:
+            if self.powercontrol_args:
+                self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
             self.power_ctl("on")
+        if self.serialcontrol_cmd:
+            if self.serialcontrol_args:
+                self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args)
 
     def power_ctl(self, msg):
         if self.powercontrol_cmd:
@@ -172,4 +181,3 @@ class GummibootTarget(MasterImageHardwareTarget):
         self.power_cycle(self.master)
         # there are better ways than a timeout but this should work for now
         time.sleep(120)
-
-- 
1.9.0



  parent reply	other threads:[~2014-04-30 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 12:31 [PATCH 0/8] Automated hardware testing improvements Paul Eggleton
2014-04-30 12:31 ` [PATCH 1/8] oeqa/controllers/masterimage: add a base class for hw targets Paul Eggleton
2014-04-30 12:31 ` [PATCH 2/8] oeqa/targetcontrol: restart method shouldn't be abstract Paul Eggleton
2014-04-30 12:31 ` Paul Eggleton [this message]
2014-04-30 12:32 ` [PATCH 4/8] oeqa/controllers/masterimage: more robust master image startup Paul Eggleton
2014-04-30 12:32 ` [PATCH 5/8] classes/testimage: if start fails, don't try to stop Paul Eggleton
2014-04-30 12:32 ` [PATCH 6/8] scripts/contrib/serdevtry: add script to handle transient serial terminals Paul Eggleton
2014-04-30 12:32 ` [PATCH 7/8] scripts/contrib/dialog-power-control: add a trivial power prompt script Paul Eggleton
2014-04-30 12:32 ` [PATCH 8/8] oeqa: add proper handling for command errors where needed Paul Eggleton

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=58a9e0919e4b5a40dcc321f01b093ef3b3f3f5b2.1398861075.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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