diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 528: wait for prompt properly in lava-test-shell

Message ID 20130114205714.25880.96851.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Antonio Terceiro Jan. 14, 2013, 8:57 p.m. UTC
Merge authors:
  Antonio Terceiro (terceiro)
Related merge proposals:
  https://code.launchpad.net/~terceiro/lava-dispatcher/wait-for-prompt/+merge/143143
  proposed by: Antonio Terceiro (terceiro)
------------------------------------------------------------
revno: 528 [merge]
committer: Antonio Terceiro <antonio.terceiro@linaro.org>
branch nick: trunk
timestamp: Mon 2013-01-14 17:55:48 -0300
message:
  wait for prompt properly in lava-test-shell
modified:
  lava_dispatcher/actions/lava_test_shell.py
  lava_dispatcher/client/base.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
--- lava_dispatcher/actions/lava_test_shell.py	2013-01-09 20:57:25 +0000
+++ lava_dispatcher/actions/lava_test_shell.py	2013-01-14 16:29:38 +0000
@@ -454,7 +454,7 @@ 
         signal_director = SignalDirector(self.client, testdefs_by_uuid)
 
         with target.runner() as runner:
-            runner.run("") # make sure we have a shell prompt
+            runner.wait_for_prompt(timeout)
             runner._connection.sendline("%s/bin/lava-test-runner" % target.deployment_data['lava_test_dir'])
             start = time.time()
             if timeout == -1:

=== modified file 'lava_dispatcher/client/base.py'
--- lava_dispatcher/client/base.py	2013-01-02 18:55:32 +0000
+++ lava_dispatcher/client/base.py	2013-01-14 16:29:38 +0000
@@ -87,6 +87,9 @@ 
         self.match_id = None
         self.match = None
 
+    def wait_for_prompt(self, timeout = -1):
+        wait_for_prompt(self._connection, self._prompt_str, timeout)
+
     def run(self, cmd, response=None, timeout=-1, failok=False):
         """Run `cmd` and wait for a shell response.
 
@@ -121,7 +124,7 @@ 
             self.match_id = None
             self.match = None
 
-        wait_for_prompt(self._connection, self._prompt_str, timeout)
+        self.wait_for_prompt(timeout)
 
         if self._prompt_str_includes_rc:
             rc = int(self._connection.match.group(1))