summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler <tyler.baker@linaro.org>2014-10-03 03:49:40 (GMT)
committerLinaro Code Review <review@review.linaro.org>2014-10-03 03:53:26 (GMT)
commit95d232c2c61ee727b69f6e2012a77883ab2d6d63 (patch)
treef5a6f3c85876c792d016ffadb4937e6e8803262b
parentb3fab45a90f743da4ba1d15860958611e3a24744 (diff)
downloadlava-dispatcher-95d232c2c61ee727b69f6e2012a77883ab2d6d63.tar.gz
lava-dispatcher-95d232c2c61ee727b69f6e2012a77883ab2d6d63.tar.xz
enable sensible and configurable bootloader and kernel load timeouts
Change-Id: Ie7279c64d595c9e4075a7f3ed2e1f445343c734c
-rw-r--r--lava_dispatcher/config.py2
-rw-r--r--lava_dispatcher/device/bootloader.py2
-rw-r--r--lava_dispatcher/device/ipmi_tftp.py2
-rw-r--r--lava_dispatcher/device/jtag_drivers.py4
-rw-r--r--lava_dispatcher/device/master.py2
-rw-r--r--lava_dispatcher/device/target.py3
6 files changed, 9 insertions, 6 deletions
diff --git a/lava_dispatcher/config.py b/lava_dispatcher/config.py
index f13c419..76195d3 100644
--- a/lava_dispatcher/config.py
+++ b/lava_dispatcher/config.py
@@ -52,6 +52,8 @@ class DeviceSchema(schema.Schema):
boot_part_android_org = schema.IntOption()
boot_retries = schema.IntOption(default=3)
bootloader_prompt = schema.StringOption()
+ bootloader_timeout = schema.IntOption(default=120)
+ image_boot_msg_timeout = schema.IntOption(default=120)
send_char = schema.BoolOption(default=True)
test_image_prompts = schema.ListOption(default=["\(initramfs\)",
"linaro-test",
diff --git a/lava_dispatcher/device/bootloader.py b/lava_dispatcher/device/bootloader.py
index e1f2361..9b0d241 100644
--- a/lava_dispatcher/device/bootloader.py
+++ b/lava_dispatcher/device/bootloader.py
@@ -313,7 +313,7 @@ class BootloaderTarget(MasterImageTarget):
self.proc.sendline(self.config.pre_boot_cmd,
send_char=self.config.send_char)
self._customize_bootloader(self.proc, boot_cmds)
- self.proc.expect(self.config.image_boot_msg, timeout=300)
+ self.proc.expect(self.config.image_boot_msg, self.config.image_boot_msg_timeout)
self._auto_login(self.proc)
self._wait_for_prompt(self.proc, self.config.test_image_prompts,
self.config.boot_linaro_timeout)
diff --git a/lava_dispatcher/device/ipmi_tftp.py b/lava_dispatcher/device/ipmi_tftp.py
index c62910e..e2c95fc 100644
--- a/lava_dispatcher/device/ipmi_tftp.py
+++ b/lava_dispatcher/device/ipmi_tftp.py
@@ -183,7 +183,7 @@ class IpmiPxeTarget(Target):
self._enter_bootloader(self.proc)
boot_cmds = self._load_boot_cmds(default='boot_cmds_master')
self._customize_bootloader(self.proc, boot_cmds)
- self.proc.expect(self.config.image_boot_msg, timeout=300)
+ self.proc.expect(self.config.image_boot_msg, self.config.image_boot_msg_timeout)
self._wait_for_prompt(self.proc, self.config.test_image_prompts,
self.config.boot_linaro_timeout)
self.proc.sendline('export PS1="%s"' % self.MASTER_PS1)
diff --git a/lava_dispatcher/device/jtag_drivers.py b/lava_dispatcher/device/jtag_drivers.py
index 3c7b4c4..22ed8c9 100644
--- a/lava_dispatcher/device/jtag_drivers.py
+++ b/lava_dispatcher/device/jtag_drivers.py
@@ -175,7 +175,7 @@ class stmc(BaseDriver):
# Ask the master to deliver the image
self.context.transport.request_send('lava_ms_boot', None)
- proc.expect(self.config.image_boot_msg, timeout=300)
+ proc.expect(self.config.image_boot_msg, self.config.image_boot_msg_timeout)
return proc
else:
boot_cmds.insert(0, self._stmc_command)
@@ -225,5 +225,5 @@ class stmc(BaseDriver):
logging.info("Delivering images with STMC")
self.context.run_command(jtag_command, failok=False)
- proc.expect(self.config.image_boot_msg, timeout=300)
+ proc.expect(self.config.image_boot_msg, self.config.image_boot_msg_timeout)
return proc
diff --git a/lava_dispatcher/device/master.py b/lava_dispatcher/device/master.py
index 83968d8..975f54d 100644
--- a/lava_dispatcher/device/master.py
+++ b/lava_dispatcher/device/master.py
@@ -419,7 +419,7 @@ class MasterImageTarget(Target):
boot_cmds = self._load_boot_cmds(default='boot_cmds_master',
boot_tags=self.master_boot_tags)
self._customize_bootloader(self.proc, boot_cmds)
- self.proc.expect(self.config.image_boot_msg, timeout=300)
+ self.proc.expect(self.config.image_boot_msg, self.config.image_boot_msg_timeout)
self._auto_login(self.proc, is_master=True)
self._wait_for_prompt(self.proc, self.config.master_str, timeout=300)
diff --git a/lava_dispatcher/device/target.py b/lava_dispatcher/device/target.py
index 83a4194..00ec1af 100644
--- a/lava_dispatcher/device/target.py
+++ b/lava_dispatcher/device/target.py
@@ -467,7 +467,8 @@ class Target(object):
connection.empty_buffer()
def _enter_bootloader(self, connection):
- if connection.expect(self.config.interrupt_boot_prompt) != 0:
+ if connection.expect(self.config.interrupt_boot_prompt,
+ self.config.bootloader_timeout) != 0:
raise Exception("Failed to enter bootloader")
if self.config.interrupt_boot_control_character:
connection.sendcontrol(self.config.interrupt_boot_control_character)