Commit 7b9c3e84 authored by Neil Williams's avatar Neil Williams 💬 Committed by Rémi Duraffort

Allow some deployments to not use deployment_data

Juno recovery image deployment cannot support any kind of
deployment_data. Declare this support so that the second UART
connection_namespace parameters check can be omitted.
Add a juno uboot unit test and update the device configuration
to reflect current juno templates.
Drop unused sample_job.

Change-Id: I089cbdd80191a84bc2e9dbfbdf3ea782734a5db7
parent b15eb55e
......@@ -66,6 +66,11 @@ class VExpressMsd(Deployment):
self.action.job = self.job
parent.add_action(self.action, parameters)
@classmethod
def uses_deployment_data(cls):
# recovery image deployment does not involve an OS
return False
@classmethod
def accepts(cls, device, parameters):
if 'to' not in parameters:
......
This diff is collapsed.
......@@ -186,6 +186,10 @@ class Deployment(object):
if 'methods' not in device['actions']['deploy']:
raise ConfigurationError('Device misconfiguration, no "methods" in device configuration deploy actions')
@classmethod
def uses_deployment_data(cls):
return True
@classmethod
def select(cls, device, parameters):
cls.deploy_check(device, parameters)
......
......@@ -60,7 +60,8 @@ def parse_action(job_data, name, device, pipeline, test_info, test_count):
parameters['stage'] = test_count - 1
LavaTest.select(device, parameters)(pipeline, parameters)
elif name == 'deploy':
if parameters['namespace'] in test_info:
candidate = Deployment.select(device, parameters)
if parameters['namespace'] in test_info and candidate.uses_deployment_data():
if any([testclass for testclass in test_info[parameters['namespace']] if testclass['class'].needs_deployment_data()]):
parameters.update({'deployment_data': get_deployment_data(parameters.get('os', ''))})
if 'preseed' in parameters:
......
- class: actions.deploy.vemsd.VExpressMsdAction
name: vexpress-fw-deploy
pipeline:
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- {class: actions.deploy.lxc.LxcCreateUdevRuleAction, name: lxc-create-udev-rule-action}
- {class: connections.serial.ConnectDevice, name: connect-device}
- class: power.ResetDevice
name: reset-device
pipeline:
- {class: power.PDUReboot, name: pdu-reboot}
- {class: actions.deploy.vemsd.ExtractVExpressRecoveryImage, name: extract-vexpress-recovery-image}
- {class: actions.deploy.vemsd.EnterVExpressMCC, name: enter-vexpress-mcc}
- {class: actions.deploy.vemsd.EnableVExpressMassStorage, name: enable-vexpress-usbmsd}
- {class: utils.udev.WaitUSBMassStorageDeviceAction, name: wait-usb-mass-storage-device}
- {class: actions.deploy.vemsd.MountVExpressMassStorageDevice, name: mount-vexpress-usbmsd}
- {class: actions.deploy.vemsd.DeployVExpressRecoveryImage, name: deploy-vexpress-recovery-image}
- {class: actions.deploy.vemsd.UnmountVExpressMassStorageDevice, name: unmount-vexpress-usbmsd}
- {class: actions.deploy.vemsd.VExpressFlashErase, name: erase-vexpress-flash}
- class: actions.deploy.nfs.NfsAction
name: nfs-deploy
pipeline:
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- {class: actions.deploy.apply_overlay.ExtractNfsRootfs, name: extract-nfsrootfs}
- class: actions.deploy.overlay.OverlayAction
name: lava-overlay
pipeline:
- {class: actions.deploy.overlay.SshAuthorize, name: ssh-authorize}
- {class: actions.deploy.overlay.VlandOverlayAction, name: lava-vland-overlay}
- {class: actions.deploy.overlay.MultinodeOverlayAction, name: lava-multinode-overlay}
- class: actions.deploy.testdef.TestDefinitionAction
name: test-definition
pipeline:
- {class: actions.deploy.testdef.GitRepoAction, name: git-repo-action}
- {class: actions.deploy.testdef.TestOverlayAction, name: test-overlay}
- {class: actions.deploy.testdef.TestInstallAction, name: test-install-overlay}
- {class: actions.deploy.testdef.TestRunnerAction, name: test-runscript-overlay}
- {class: actions.deploy.overlay.CompressOverlay, name: compress-overlay}
- {class: actions.deploy.overlay.PersistentNFSOverlay, name: persistent-nfs-overlay}
- {class: actions.deploy.apply_overlay.ExtractModules, name: extract-modules}
- {class: actions.deploy.apply_overlay.ApplyOverlayTftp, name: apply-overlay-tftp}
- {class: actions.deploy.environment.DeployDeviceEnvironment, name: deploy-device-env}
- class: actions.boot.u_boot.UBootAction
name: uboot-action
pipeline:
- {class: actions.boot.u_boot.UBootSecondaryMedia, name: uboot-from-media}
- {class: actions.boot.BootloaderCommandOverlay, name: bootloader-overlay}
- {class: connections.serial.ConnectDevice, name: connect-device}
- class: actions.boot.u_boot.UBootRetry
name: uboot-retry
pipeline:
- class: power.ResetDevice
name: reset-device
pipeline:
- {class: power.PDUReboot, name: pdu-reboot}
- {class: actions.boot.BootloaderInterruptAction, name: bootloader-interrupt}
- {class: actions.boot.BootloaderCommandsAction, name: bootloader-commands}
- {class: actions.boot.AutoLoginAction, name: auto-login-action}
- {class: shell.ExpectShellSession, name: expect-shell-connection}
- {class: actions.boot.environment.ExportDeviceEnvironment, name: export-device-env}
- class: actions.test.shell.TestShellRetry
name: lava-test-retry
pipeline:
- {class: actions.test.shell.TestShellAction, name: lava-test-shell}
- class: power.FinalizeAction
name: finalize
pipeline:
- {class: power.PowerOff, name: power-off}
- {class: power.ReadFeedback, name: read-feedback}
# Sample JOB definition for a juno u-boot NFS job
device_type: juno
job_name: Juno UBoot Debian NFS
job_name: juno-uboot-nfs
timeouts:
job:
minutes: 15
minutes: 30
action:
minutes: 5
priority: medium
visibility: public
context:
bootloader_prompt: juno#
actions:
- deploy:
timeout:
minutes: 2
to: nfs
os: oe
nfsrootfs:
url: http://releases.linaro.org/openembedded/juno-lsk/16.02/linaro-image-minimal-genericarmv8-20160222-790.rootfs.tar.gz
compression: gz
- boot:
method: u-boot
commands: nfs
parameters:
shutdown-message: "reboot: Restarting system"
prompts:
- '/ #'
- 'linaro-test'
- 'root@debian:~#'
- 'root@genericarmv8:~#'
- test:
failure_retry: 3
name: juno-basics
timeout:
minutes: 5
definitions:
- repository: git://git.linaro.org/lava-team/lava-functional-tests.git
from: git
path: lava-test-shell/smoke-tests-basic.yaml
name: smoke-tests
- deploy:
namespace: recovery
timeout:
minutes: 10
to: vemsd
recovery_image:
url: http://releases.linaro.org/members/arm/platforms/17.04/juno-latest-oe-uboot.zip
compression: zip
- deploy:
namespace: debian
timeout:
minutes: 2
to: nfs
os: debian
nfsrootfs:
url: http://people.linaro.org/~neil.williams/arm64/debian-jessie-arm64-rootfs.tar.gz
compression: gz
- boot:
namespace: debian
connection-namespace: recovery
method: u-boot
commands: norflash
auto_login:
login_prompt: 'login:'
username: root
prompts:
- root@(.*):~#
- test:
namespace: debian
connection-namespace: recovery
timeout:
minutes: 5
definitions:
- repository: http://git.linaro.org/lava-team/lava-functional-tests.git
from: git
path: lava-test-shell/smoke-tests-basic.yaml
name: smoke-tests
# Sample JOB definition for a juno u-boot tftp job
device_type: juno
job_name: juno-uboot-tftp
timeouts:
job:
minutes: 15
action:
minutes: 5
priority: medium
visibility: public
actions:
- deploy:
timeout:
minutes: 2
to: tftp
kernel:
url: http://images.validation.linaro.org/juno/kernel/Image
type: image
os: oe
dtb:
url: http://images.validation.linaro.org/juno/kernel/juno.dtb
nfsrootfs:
url: http://images.validation.linaro.org/releases.linaro.org/openembedded/juno-lsk/16.02/linaro-image-minimal-genericarmv8-20160222-790.rootfs.tar.gz
compression: gz
- boot:
method: u-boot
commands: tftp
parameters:
shutdown-message: "reboot: Restarting system"
prompts:
- '/ #'
- 'linaro-test'
- 'root@debian:~#'
- 'root@genericarmv8:~#'
- test:
failure_retry: 3
name: juno-basics
timeout:
minutes: 5
definitions:
- repository: http://git.linaro.org/lava-team/lava-functional-tests.git
from: git
path: lava-test-shell/smoke-tests-basic.yaml
name: smoke-tests
# Sample job to show uefi behaviour, drop from menu to shell, input shell commands.
device_type: juno
job_name: juno-uefi-shell-nfs
job_name: Juno UEFI shell using NFS
timeouts:
job:
minutes: 40
......@@ -13,14 +13,13 @@ priority: medium
visibility: public
actions:
- deploy:
namespace: recovery
timeout:
minutes: 10
to: vemsd
recovery_image:
url: http://images.validation.linaro.org/releases.linaro.org/members/arm/platforms/15.12/juno-latest-oe-uefi.zip
url: https://releases.linaro.org/members/arm/platforms/15.12/juno-latest-oe-uefi.zip
compression: zip
- deploy:
......
......@@ -69,6 +69,16 @@ class UBootFactory(Factory): # pylint: disable=too-few-public-methods
job.logger = DummyLogger()
return job
def create_juno_job(self, filename, output_dir='/tmp/'): # pylint: disable=no-self-use
device = NewDevice(os.path.join(os.path.dirname(__file__), '../devices/juno-01.yaml'))
juno_yaml = os.path.join(os.path.dirname(__file__), filename)
with open(juno_yaml) as sample_job_data:
parser = JobParser()
job = parser.parse(sample_job_data, device, 4212, None, "",
output_dir=output_dir)
job.logger = DummyLogger()
return job
def create_zcu102_job(self, filename, output_dir='/tmp/'): # pylint: disable=no-self-use
device = NewDevice(os.path.join(os.path.dirname(__file__), '../devices/xilinx-zcu102.yaml'))
zcu_yaml = os.path.join(os.path.dirname(__file__), filename)
......@@ -182,6 +192,12 @@ class TestUbootAction(StdoutTestCase): # pylint: disable=too-many-public-method
self.assertIn('compression', nfs.parameters['nfsrootfs'])
self.assertEqual(nfs.parameters['nfsrootfs']['compression'], 'gz')
def test_juno_uboot_nfs(self):
job = self.factory.create_juno_job('sample_jobs/juno-uboot-nfs.yaml')
job.validate()
description_ref = self.pipeline_reference('juno-uboot-nfs.yaml', job=job)
self.assertEqual(description_ref, job.pipeline.describe(False))
def test_overlay_action(self): # pylint: disable=too-many-locals
parameters = {
'device_type': 'beaglebone-black',
......
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