Commit cc16e4b3 authored by Rémi Duraffort's avatar Rémi Duraffort

mps2: fix validation and documentation

The parameters should include a dict called "images" that should contain
"recovery_image" and/or "test_binary".
Signed-off-by: Rémi Duraffort's avatarRémi Duraffort <remi.duraffort@linaro.org>
parent 32d18fa3
Pipeline #2082 passed with stages
in 5 minutes and 21 seconds
......@@ -67,8 +67,11 @@ the support for :ref:`deploy_to_vemsd`
.. _deploy_to_mps_recovery:
images
======
recovery_image
==============
--------------
Download the URL ready to be unpacked onto the USB filesystem of the
MPS2 device.
......@@ -76,7 +79,7 @@ MPS2 device.
.. _deploy_to_mps_recovery_url:
url *
-----
^^^^^
Specifies the URL to download. All downloads are check-summed using ``md5sum``
and ``sha256sum``
......@@ -96,7 +99,7 @@ URLs **must** use one of the supported schemes, the first element of the URL.
.. _deploy_to_mps_recovery_compression:
compression
-----------
^^^^^^^^^^^
If the image is compressed, the compression method **must** be specified.
......@@ -116,14 +119,14 @@ during download and then unpacked onto the filesystem of the VEMSD.
.. _deploy_to_mps_test_binary:
test_binary
===========
-----------
Download test binary to MPS device and rename if required.
.. _deploy_to_mps_binary_url:
url *
-----
^^^^^
Specifies the URL to download. All downloads are check-summed using ``md5sum``
and ``sha256sum``
......@@ -143,7 +146,7 @@ URLs **must** use one of the supported schemes, the first element of the URL.
.. _deploy_to_mps_binary_rename:
rename
------
^^^^^^
Renames the test_binary if required
......
......@@ -83,10 +83,12 @@ class MpsAction(DeployAction):
def validate(self):
super().validate()
if not self.valid:
return
if not self.parameters.get("recovery_image"):
if "images" not in self.parameters:
self.errors = "Missing 'images'"
return
images = self.parameters["images"]
if "recovery_image" not in images and "test_binary" not in images:
self.errors = "Missing 'recovery_image' or 'test_binary'"
def populate(self, parameters):
download_dir = self.mkdtemp()
......@@ -125,10 +127,8 @@ class DeployMPSTestBinary(Action):
def validate(self):
super().validate()
if not self.valid:
return
if not self.parameters["images"].get(self.param_key):
return
self.errors = "Missing '%s' in 'images'" % self.param_key
def run(self, connection, max_end_time):
connection = super().run(connection, max_end_time)
......
......@@ -338,11 +338,6 @@ class DeployVExpressRecoveryImage(Action):
description = "deploy vexpress recovery image to usb msd"
summary = "copy recovery image contents to vexpress usb mass storage device"
def validate(self):
super().validate()
if not self.valid:
return
def run(self, connection, max_end_time):
connection = super().run(connection, max_end_time)
mount_point = self.get_namespace_data(
......
......@@ -16,6 +16,23 @@
- {class: actions.deploy.vemsd.DeployVExpressRecoveryImage, name: deploy-vexpress-recovery-image}
- {class: actions.deploy.vemsd.UnmountVExpressMassStorageDevice, name: unmount-vexpress-usbmsd}
- {class: power.PowerOff, name: power-off}
- class: actions.deploy.mps.MpsAction
name: mps-deploy
pipeline:
- {class: connections.serial.DisconnectDevice, name: disconnect-device}
- class: power.ResetDevice
name: reset-device
pipeline:
- {class: power.PDUReboot, name: pdu-reboot}
- {class: utils.udev.WaitUSBMassStorageDeviceAction, name: wait-usb-mass-storage-device}
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- {class: actions.deploy.vemsd.MountVExpressMassStorageDevice, name: mount-vexpress-usbmsd}
- {class: actions.deploy.mps.DeployMPSTestBinary, name: deploy-mps-test-binary}
- {class: actions.deploy.vemsd.UnmountVExpressMassStorageDevice, name: unmount-vexpress-usbmsd}
- {class: power.PowerOff, name: power-off}
- class: actions.boot.minimal.MinimalBoot
name: minimal-boot
pipeline:
......
......@@ -32,13 +32,13 @@ actions:
compression: gz
namespace: target
# Single test
#- deploy:
# to: mps
# images:
# test_binary:
# url: http://example.com/example.elf
# rename: mbed.elf
# namespace: target
- deploy:
to: mps
images:
test_binary:
url: http://images.validation.linaro.org/people.linaro.org/~maria.hogberg/mbed/SOFTWARE/zephyr.elf
rename: mbed.elf
namespace: target
- boot:
method: minimal
timeout:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment