=== modified file 'lava_dispatcher/client/base.py'
@@ -59,7 +59,7 @@
index = 0
while index == 0:
index = self._connection.expect(
- ['.+', pexpect.EOF, pexpect.TIMEOUT], timeout=1)
+ ['.+', pexpect.EOF, pexpect.TIMEOUT], timeout=1,lava_no_logging=1)
def run(self, cmd, response=None, timeout=-1):
"""Run `cmd` and wait for a shell response.
@@ -93,7 +93,7 @@
self._connection.expect(self._prompt_str, timeout=timeout)
if self._wait_for_rc:
match_id = self._connection.expect(
- ['rc=(\d+\d?\d?)', pexpect.EOF, pexpect.TIMEOUT], timeout=2)
+ ['rc=(\d+\d?\d?)', pexpect.EOF, pexpect.TIMEOUT], timeout=2, lava_no_logging=1)
if match_id == 0:
rc = int(self._connection.match.groups()[0])
else:
=== modified file 'lava_dispatcher/client/master.py'
@@ -389,7 +389,7 @@
self.proc.hard_reboot()
self._in_master_shell(300)
self.proc.sendline('export PS1="$PS1 [rc=$(echo \$?)]: "')
- self.proc.expect(self.master_str, timeout=10)
+ self.proc.expect(self.master_str, timeout=10, lava_no_logging=1)
def _format_testpartition(self, session):
logging.info("Format testboot and testrootfs partitions")
@@ -530,7 +530,7 @@
"""
self.proc.sendline("")
match_id = self.proc.expect(
- [self.master_str, pexpect.TIMEOUT], timeout=timeout)
+ [self.master_str, pexpect.TIMEOUT], timeout=timeout, lava_no_logging=1)
if match_id == 1:
raise OperationFailed
logging.info("System is in master image now")
=== modified file 'lava_dispatcher/connection.py'
@@ -42,9 +42,29 @@
# pexpect-like interface.
def sendline(self, *args, **kw):
+ logging.debug("sendline : %s" %args[0])
return self.proc.sendline(*args, **kw)
+ def send(self, *args, **kw):
+ logging.debug("sendline : %s" %args[0])
+ return self.proc.send(*args, **kw)
+
def expect(self, *args, **kw):
+ # some expect should not be logged because it is so much noise.
+ if kw.has_key('lava_no_logging'):
+ del kw['lava_no_logging']
+ return self.proc.expect(*args, **kw)
+
+ if (kw.has_key('timeout')):
+ timeout = kw['timeout']
+ else:
+ timeout = self.proc.timeout
+
+ if len(args) == 1:
+ logging.debug("expect (%d): '%s'" %(timeout, args[0]))
+ else:
+ logging.debug("expect (%d): '%s'" %(timeout, str(args)))
+
return self.proc.expect(*args, **kw)
def sendcontrol(self, *args, **kw):
@@ -58,14 +78,14 @@
# Extra bits.
def _enter_uboot(self):
- self.proc.expect("Hit any key to stop autoboot")
- self.proc.sendline("")
+ self.expect("Hit any key to stop autoboot")
+ self.sendline("")
def soft_reboot(self):
- self.proc.sendline("reboot")
+ self.sendline("reboot")
# set soft reboot timeout 120s, or do a hard reset
logging.info("Rebooting the system")
- id = self.proc.expect(
+ id = self.expect(
['Restarting system.', 'The system is going down for reboot NOW',
'Will now restart', pexpect.TIMEOUT], timeout=120)
if id not in [0,1,2]:
@@ -97,8 +117,8 @@
logging.exception("_enter_uboot failed")
self.hard_reboot()
self._enter_uboot()
- self.proc.sendline(boot_cmds[0])
+ self.sendline(boot_cmds[0])
bootloader_prompt = re.escape(self.device_option('bootloader_prompt'))
for line in range(1, len(boot_cmds)):
- self.proc.expect(bootloader_prompt, timeout=300)
- self.proc.sendline(boot_cmds[line])
+ self.expect(bootloader_prompt, timeout=300)
+ self.sendline(boot_cmds[line])