summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2014-09-23 09:34:58 (GMT)
committerNeil Williams <neil.williams@linaro.org>2014-09-23 09:34:58 (GMT)
commit1f905e5882c8079090473c2c9b91ce5bef2aca5e (patch)
tree94c40e69d186dc4cb0268b24a4ddc5e8cae3e657
parentd4b24f62e54fa1ce9076cd160aad939e447ed179 (diff)
parent79af4755f4fcdc4661e6ec1e0f493f5d1fbf2c26 (diff)
downloadlava-dispatcher-1f905e5882c8079090473c2c9b91ce5bef2aca5e.tar.gz
lava-dispatcher-1f905e5882c8079090473c2c9b91ce5bef2aca5e.tar.xz
Merge branch 'staging' into release
2014.08.2 production release
-rw-r--r--lava_dispatcher/config.py40
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf17
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf20
-rw-r--r--lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf17
-rw-r--r--lava_dispatcher/device/fastboot.py5
-rw-r--r--lava_dispatcher/device/fastmodel.py19
-rw-r--r--lava_dispatcher/device/jtag.py23
-rw-r--r--lava_dispatcher/device/jtag_drivers.py8
-rw-r--r--lava_dispatcher/pipeline/actions/deploy/download.py6
-rw-r--r--lava_dispatcher/utils.py5
10 files changed, 106 insertions, 54 deletions
diff --git a/lava_dispatcher/config.py b/lava_dispatcher/config.py
index 43e4fc4..9342a9b 100644
--- a/lava_dispatcher/config.py
+++ b/lava_dispatcher/config.py
@@ -162,25 +162,6 @@ class DeviceSchema(schema.Schema):
password = schema.StringOption(default=None)
login_commands = schema.ListOption(default=None)
- simulator_version_command = schema.StringOption()
- simulator_command = schema.StringOption()
- simulator_command_flag = schema.StringOption(default=" -C ")
- simulator_axf_files = schema.ListOption()
- simulator_kernel_files = schema.ListOption(default=None)
- simulator_kernel = schema.StringOption(default=None)
- simulator_initrd_files = schema.ListOption(default=None)
- simulator_initrd = schema.StringOption(default=None)
- simulator_dtb_files = schema.ListOption(default=None)
- simulator_dtb = schema.StringOption(default=None)
- simulator_uefi_files = schema.ListOption(default=None)
- simulator_bl1_files = schema.ListOption(default=None)
- simulator_bl1 = schema.StringOption(default=None)
- simulator_bl2_files = schema.ListOption(default=None)
- simulator_bl2 = schema.StringOption(default=None)
- simulator_bl31_files = schema.ListOption(default=None)
- simulator_bl31 = schema.StringOption(default=None)
- simulator_boot_wrapper = schema.StringOption(default=None)
-
android_disable_suspend = schema.BoolOption(default=True)
android_adb_over_usb = schema.BoolOption(default=False)
android_adb_over_tcp = schema.BoolOption(default=True)
@@ -241,6 +222,27 @@ class DeviceSchema(schema.Schema):
master_password = schema.StringOption(default=None)
master_login_commands = schema.ListOption(default=None)
+ # for fastmodel devices
+ simulator_version_command = schema.StringOption()
+ simulator_command = schema.StringOption()
+ simulator_command_flag = schema.StringOption(default=" -C ")
+ simulator_axf_files = schema.ListOption()
+ simulator_kernel_files = schema.ListOption(default=None)
+ simulator_kernel = schema.StringOption(default=None)
+ simulator_initrd_files = schema.ListOption(default=None)
+ simulator_initrd = schema.StringOption(default=None)
+ simulator_dtb_files = schema.ListOption(default=None)
+ simulator_dtb = schema.StringOption(default=None)
+ simulator_uefi_files = schema.ListOption(default=None)
+ simulator_uefi_vars = schema.StringOption(default="uefi-vars.fd")
+ simulator_bl1_files = schema.ListOption(default=None)
+ simulator_bl1 = schema.StringOption(default=None)
+ simulator_bl2_files = schema.ListOption(default=None)
+ simulator_bl2 = schema.StringOption(default=None)
+ simulator_bl31_files = schema.ListOption(default=None)
+ simulator_bl31 = schema.StringOption(default=None)
+ simulator_boot_wrapper = schema.StringOption(default=None)
+
# for dummy devices
dummy_driver = schema.StringOption(default=None)
dummy_schroot_chroot = schema.StringOption(default="default")
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf
index c7d7374..d1a138e 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base-aemv8a.conf
@@ -120,10 +120,13 @@ boot_options =
bp.pl011_uart0.untimed_fifos
bp.secureflashloader.fname
bp.flashloader0.fname
- bp.virtioblockdevice.image_path
- bp.hostbridge.interfaceName
- bp.smsc_91c111.enabled
- bp.smsc_91c111.mac_address
+ bp.flashloader1.fname
+ bp.flashloader1.fnameWrite
+ bp.virtioblockdevice.image_path
+ bp.hostbridge.interfaceName
+ bp.smsc_91c111.enabled
+ bp.smsc_91c111.mac_address
+
[pctl.startup]
default = 0.0.0.0
@@ -152,6 +155,12 @@ allowed = 0,1
[bp.flashloader0.fname]
default = {UEFI}
+[bp.flashloader1.fname]
+default = {UEFI_VARS}
+
+[bp.flashloader1.fnameWrite]
+default = {UEFI_VARS}
+
[bp.secureflashloader.fname]
default = {BL1}
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf
index a77813c..2d691a0 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x1-a53x1.conf
@@ -118,10 +118,13 @@ boot_options =
bp.pl011_uart0.untimed_fifos
bp.secureflashloader.fname
bp.flashloader0.fname
- bp.virtioblockdevice.image_path
- bp.hostbridge.interfaceName
- bp.smsc_91c111.enabled
- bp.smsc_91c111.mac_address
+ bp.flashloader1.fname
+ bp.flashloader1.fnameWrite
+ bp.virtioblockdevice.image_path
+ bp.hostbridge.interfaceName
+ bp.smsc_91c111.enabled
+ bp.smsc_91c111.mac_address
+
[pctl.startup]
default = 0.0.0.0
@@ -142,15 +145,18 @@ allowed = 0,1
[bp.flashloader0.fname]
default = {UEFI}
+[bp.flashloader1.fname]
+default = {UEFI_VARS}
+
+[bp.flashloader1.fnameWrite]
+default = {UEFI_VARS}
+
[bp.secureflashloader.fname]
default = {BL1}
[bp.virtioblockdevice.image_path]
default = {IMG}
-[bp.virtioblockdevice.image_path]
-default = {IMG}
-
[bp.hostbridge.interfaceName]
default = "%(interfaceName)s"
diff --git a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf
index 0c62434..fbd8219 100644
--- a/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf
+++ b/lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_fvp_base_cortex-a57x4-a53x4.conf
@@ -118,10 +118,13 @@ boot_options =
bp.pl011_uart0.untimed_fifos
bp.secureflashloader.fname
bp.flashloader0.fname
- bp.virtioblockdevice.image_path
- bp.hostbridge.interfaceName
- bp.smsc_91c111.enabled
- bp.smsc_91c111.mac_address
+ bp.flashloader1.fname
+ bp.flashloader1.fnameWrite
+ bp.virtioblockdevice.image_path
+ bp.hostbridge.interfaceName
+ bp.smsc_91c111.enabled
+ bp.smsc_91c111.mac_address
+
[pctl.startup]
default = 0.0.0.0
@@ -142,6 +145,12 @@ allowed = 0,1
[bp.flashloader0.fname]
default = {UEFI}
+[bp.flashloader1.fname]
+default = {UEFI_VARS}
+
+[bp.flashloader1.fnameWrite]
+default = {UEFI_VARS}
+
[bp.secureflashloader.fname]
default = {BL1}
diff --git a/lava_dispatcher/device/fastboot.py b/lava_dispatcher/device/fastboot.py
index e5e2761..ce12793 100644
--- a/lava_dispatcher/device/fastboot.py
+++ b/lava_dispatcher/device/fastboot.py
@@ -23,6 +23,7 @@
import contextlib
import logging
import subprocess
+import pexpect
from lava_dispatcher.device.target import Target
import lava_dispatcher.device.fastboot_drivers as drivers
@@ -78,7 +79,7 @@ class FastbootTarget(Target):
bootloader, firmware, bl1, bl2, bl31, rootfstype,
bootloadertype, self._target_type, self.scratch_dir)
deployed = True
- except subprocess.CalledProcessError as e:
+ except (subprocess.CalledProcessError, pexpect.TIMEOUT) as e:
msg = "Deployment failed: %s" % e
logging.error(msg)
attempts += 1
@@ -100,7 +101,7 @@ class FastbootTarget(Target):
bootloadertype, self._target_type,
self.scratch_dir)
deployed = True
- except subprocess.CalledProcessError as e:
+ except (subprocess.CalledProcessError, pexpect.TIMEOUT) as e:
msg = "Deployment failed: %s" % e
logging.error(msg)
attempts += 1
diff --git a/lava_dispatcher/device/fastmodel.py b/lava_dispatcher/device/fastmodel.py
index c29cc1c..191f064 100644
--- a/lava_dispatcher/device/fastmodel.py
+++ b/lava_dispatcher/device/fastmodel.py
@@ -24,6 +24,8 @@ import cStringIO
import logging
import os
import subprocess
+import signal
+import pexpect
import lava_dispatcher.device.boot_options as boot_options
@@ -55,6 +57,7 @@ from lava_dispatcher.utils import (
extract_ramdisk,
create_ramdisk,
ensure_directory,
+ touch,
)
from lava_dispatcher import deployment_data
@@ -75,6 +78,7 @@ class FastModelTarget(Target):
self._dtb = None
self._initrd = None
self._uefi = None
+ self._uefi_vars = None
self._bl1 = None
self._bl2 = None
self._bl31 = None
@@ -122,6 +126,10 @@ class FastModelTarget(Target):
self._uefi = \
self._copy_first_find_from_list(subdir, odir,
self.config.simulator_uefi_files)
+ if self.config.simulator_uefi_vars and self._uefi_vars is None:
+ # Create file for flashloader1
+ self._uefi_vars = os.path.join(odir, self.config.simulator_uefi_vars)
+ touch(self._uefi_vars)
# These are common to both AXF and UEFI
# Extract the kernel from the image
@@ -179,6 +187,8 @@ class FastModelTarget(Target):
if self._uefi is None and self.config.simulator_uefi_files:
raise RuntimeError('No UEFI binary found, %r' %
self.config.simulator_uefi_files)
+ if self._uefi_vars is None:
+ logging.warning('No uefi-vars.fd found')
# These are common to both AXF and UEFI
if self._sd_image is None:
@@ -361,6 +371,12 @@ class FastModelTarget(Target):
os.chmod(os.path.join(root, f), 0o777)
def power_off(self, proc):
+ try:
+ logging.info('Requesting graceful shutdown')
+ self._sim_proc.kill(signal.SIGTERM)
+ self._sim_proc.expect('FlashLoader: Saved', timeout=10)
+ except pexpect.TIMEOUT:
+ logging.info('Unable to gracefully shutdown')
super(FastModelTarget, self).power_off(proc)
finalize_process(self._sim_proc)
self._sim_proc = None
@@ -403,7 +419,8 @@ class FastModelTarget(Target):
sim_cmd = '%s %s' % (self.config.simulator_command, options)
sim_cmd = sim_cmd.format(
AXF=self._axf, IMG=self._sd_image, KERNEL=self._kernel,
- DTB=self._dtb, INITRD=self._initrd, UEFI=self._uefi, BL1=self._bl1)
+ DTB=self._dtb, INITRD=self._initrd, UEFI=self._uefi, BL1=self._bl1,
+ UEFI_VARS=self._uefi_vars)
# the simulator proc only has stdout/stderr about the simulator
# we hook up into a telnet port which emulates a serial console
diff --git a/lava_dispatcher/device/jtag.py b/lava_dispatcher/device/jtag.py
index c12f493..8f012bc 100644
--- a/lava_dispatcher/device/jtag.py
+++ b/lava_dispatcher/device/jtag.py
@@ -69,17 +69,20 @@ class JtagTarget(Target):
def power_on(self):
self._boot_cmds = self._load_boot_cmds(default=self._default_boot_cmds,
boot_tags=self._boot_tags)
- proc = self.driver.connect(self._boot_cmds)
- self._auto_login(proc)
- self._wait_for_prompt(proc, self.config.test_image_prompts,
+ if self.proc is not None:
+ logging.warning('Device already powered on, powering off first')
+ self.power_off(self.proc)
+ self.proc = None
+ self.proc = self.driver.connect(self._boot_cmds)
+ self._auto_login(self.proc)
+ self._wait_for_prompt(self.proc, self.config.test_image_prompts,
self.config.boot_linaro_timeout)
- proc.sendline("")
- proc.sendline('cat /proc/net/pnp > /etc/resolv.conf',
- send_char=self.config.send_char)
- proc.sendline('export PS1="%s"' % self.tester_ps1,
- send_char=self.config.send_char)
+ self.proc.sendline("")
+ self.proc.sendline('cat /proc/net/pnp > /etc/resolv.conf',
+ send_char=self.config.send_char)
+ self.proc.sendline('export PS1="%s"' % self.tester_ps1,
+ send_char=self.config.send_char)
self._booted = True
- self.proc = proc
return self.proc
def power_off(self, proc):
@@ -92,7 +95,7 @@ class JtagTarget(Target):
def file_system(self, partition, directory):
# If we are using NFS
- if self._boot_tags['{NFSROOTFS}']:
+ if '{NFSROOTFS}' in self._boot_tags:
path = self._boot_tags['{NFSROOTFS}'] + directory
logging.info("NFSROOTFS=%s", path)
ensure_directory(path)
diff --git a/lava_dispatcher/device/jtag_drivers.py b/lava_dispatcher/device/jtag_drivers.py
index cb0e2e7..3c7b4c4 100644
--- a/lava_dispatcher/device/jtag_drivers.py
+++ b/lava_dispatcher/device/jtag_drivers.py
@@ -206,10 +206,6 @@ class stmc(BaseDriver):
if not success:
raise CriticalError("The STMC fails to reboot after hard reset")
- # Setup the serial-relay
- if not self.stmc_serial_relay():
- raise CriticalError("Unable to setup the serial relay. The STMC is not working properly")
-
# Hard reset platform
if self.config.hard_reset_command:
logging.info("Hard resetting platform")
@@ -217,6 +213,10 @@ class stmc(BaseDriver):
else:
raise CriticalError("Must have a hard_reset_command defined")
+ # Setup the serial-relay
+ if not self.stmc_serial_relay():
+ raise CriticalError("Unable to setup the serial relay. The STMC is not working properly")
+
# Connect to the STMC serial relay
logging.info("Connecting to STMC serial relay")
proc = connect_to_serial(self.context)
diff --git a/lava_dispatcher/pipeline/actions/deploy/download.py b/lava_dispatcher/pipeline/actions/deploy/download.py
index 48e9989..2ff48be 100644
--- a/lava_dispatcher/pipeline/actions/deploy/download.py
+++ b/lava_dispatcher/pipeline/actions/deploy/download.py
@@ -121,7 +121,7 @@ class DownloaderAction(RetryAction):
opener = urllib2.build_opener(*handlers)
if self.cookies:
- opener.addheaders.append(('Cookie', cookies))
+ opener.addheaders.append(('Cookie', self.cookies))
try:
url = urllib2.quote(self.url.geturl(), safe=":/")
@@ -135,7 +135,7 @@ class DownloaderAction(RetryAction):
def _file_stream(self):
fd = None
try:
- fd = open(url.path, 'rb')
+ fd = open(self.url.path, 'rb')
yield fd
finally:
if fd:
@@ -187,7 +187,7 @@ class DownloaderAction(RetryAction):
self.url = urlparse.urlparse(self.parameters['image'])
if self.url.scheme == 'scp':
self.reader = self._scp_stream
- elif self.url.scheme == 'http' or url.scheme == 'https':
+ elif self.url.scheme == 'http' or self.url.scheme == 'https':
self.reader = self._http_stream
elif self.url.scheme == 'file':
self.reader = self._file_stream
diff --git a/lava_dispatcher/utils.py b/lava_dispatcher/utils.py
index 355cff7..7b4816f 100644
--- a/lava_dispatcher/utils.py
+++ b/lava_dispatcher/utils.py
@@ -74,6 +74,11 @@ def copy_file(src, dest):
shutil.copy(src, dest)
+def touch(path):
+ with open(path, 'a'):
+ os.utime(path, None)
+
+
def rmtree(directory):
subprocess.call(['rm', '-rf', directory])