Commit 548a6bb1 authored by Neil Williams's avatar Neil Williams 💬

LAVA-1224 - support for Xilinx ZCU102

NFS support is pending but ramdisk test shell jobs now work.

Change-Id: Ic167f1570170a24594e854ea7a8392cf24d24443
parent a9f22a9c
constants:
# OS shutdown message
# Override: set as the shutdown-message parameter of an Action.
# SHUTDOWN_MESSAGE
shutdown-message: 'The system is going down for reboot NOW'
# Kernel starting message
# BOOT_MESSAGE
boot-message: 'Booting Linux'
# CPU reset messages
# CPU_RESET_MESSAGES
cpu-reset-messages:
- 'Resetting CPU'
- 'Must RESET board to recover'
# Default shell prompt for AutoLogin
# DEFAULT_SHELL_PROMPT
default-shell-prompt: 'lava-test: # '
# u-boot auto boot prompt
# UBOOT_AUTOBOOT_PROMPT
uboot-autoboot-prompt: 'Hit any key to stop autoboot'
# u-boot interrupt character
# UBOOT_INTERRUPT_CHARACTER = ' '
uboot-interrupt-character: ' '
# GRUB_BOOT_PROMPT
grub-autoboot-prompt: 'Press enter to boot the selected OS'
grub-interrupt-character: 'c'
commands:
hard_reset: 'sleep 5'
connections:
uart0:
connect: telnet localhost 7030
tags:
- primary
- telnet
uart1:
connect: None
uart2:
connect: None
uart3:
connect: None
parameters:
# interfaces or device_ip or device_mac
pass: # sata_uuid_sd_uuid_usb_uuid
image:
kernel: '0x80000'
ramdisk: '0x10000000'
dtb: '0x14000000'
booti:
kernel: '0x80000'
ramdisk: '0x10000000'
dtb: '0x14000000'
device_type: xilinx-zcu102
actions:
deploy:
parameters:
add_header: u-boot
mkimage_arch: arm # string to pass to mkimage -A when adding UBoot headers
append_dtb: False
use_xip: False
connections:
lxc:
serial:
methods:
lxc:
tftp:
nbd:
ssh:
options:
- '-o'
- 'Compression=yes'
- '-o'
- 'PasswordAuthentication=no'
- '-o'
- 'LogLevel=FATAL'
host: ''
port: 22
user: root
identity_file: dynamic_vm_keys/lava
boot:
connections:
lxc:
serial:
methods:
minimal:
ssh:
u-boot:
parameters:
mkimage_arch: arm
bootloader_prompt: ZynqMP>
interrupt_prompt: Hit any key to stop autoboot
# character needed to interrupt u-boot, single whitespace by default
interrupt_char: ""
boot_message: Booting Linux
# method specific stanza
nfs:
commands:
- setenv autoload no
- setenv initrd_high 0xffffffff
- setenv fdt_high 0xffffffff
- setenv loadkernel 'tftpb {KERNEL_ADDR} {KERNEL}'
- setenv loadinitrd 'tftpb {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'
- setenv loadfdt 'tftpb {DTB_ADDR} {DTB}'
# Always quote the entire string if the command includes a colon to support correct YAML.
- "setenv nfsargs 'setenv bootargs root=/dev/nfs rw
nfsroot={NFS_SERVER_IP}:{NFSROOTFS},tcp,hard,intr ip=dhcp'"
- setenv bootcmd 'dhcp; setenv serverip {SERVER_IP}; run loadkernel; run loadinitrd; run nfsargs; run loadfdt; booti {KERNEL_ADDR} {RAMDISK_ADDR} {DTB_ADDR}'
- run bootcmd
nbd:
commands:
- setenv autoload no
- setenv initrd_high 0xffffffff
- setenv fdt_high 0xffffffff
- setenv loadkernel 'tftpb {KERNEL_ADDR} {KERNEL}'
- setenv loadinitrd 'tftpb {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'
- setenv loadfdt 'tftpb {DTB_ADDR} {DTB}'
# Always quote the entire string if the command includes a colon to support correct YAML.
- "setenv nbdbasekargs 'verbose earlyprintk systemd.log_color=false ${extraargs} rw'"
- setenv nbdkbootargs ' ip=dhcp nbd.server={NBDSERVERIP} nbd.port={NBDSERVERPORT} root=/dev/ram0 ramdisk_size=16384 rootdelay=7 ip=dhcp'
- setenv bootargs verbose rw ${nbdbasekargs} ${nbdkbootargs}
- setenv loadnbd 'setenv serverip {SERVER_IP}; run loadkernel; run loadfdt; run loadinitrd';
- setenv verify no
- setenv bootcmd 'dhcp; run loadnbd; printenv; {BOOTX}'
- run bootcmd
ramdisk:
commands:
- setenv autoload no
- setenv initrd_high 0xffffffff
- setenv fdt_high 0xffffffff
- setenv loadkernel 'tftpb {KERNEL_ADDR} {KERNEL}'
- setenv loadinitrd 'tftpb {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'
- setenv loadfdt 'tftpb {DTB_ADDR} {DTB}'
- "setenv bootargs ' root=/dev/ram0 ip=dhcp'"
- setenv bootcmd 'dhcp; setenv serverip {SERVER_IP}; run loadkernel; run loadinitrd; run loadfdt; booti {KERNEL_ADDR} {RAMDISK_ADDR} {DTB_ADDR}'
- run bootcmd
usb:
commands:
- usb start
- setenv autoload no
- "setenv loadkernel 'load usb 0:{ROOT_PART} {KERNEL_ADDR} {KERNEL}'"
- "setenv loadinitrd 'load usb 0:{ROOT_PART} {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'"
- "setenv loadfdt 'load usb 0:{ROOT_PART} {DTB_ADDR} {DTB}'"
- "setenv bootargs ' root={ROOT} ip=dhcp'"
- setenv bootcmd 'run loadkernel; run loadinitrd; run loadfdt; booti {KERNEL_ADDR} {RAMDISK_ADDR} {DTB_ADDR}'
- run bootcmd
sata:
commands:
- scsi scan
- setenv autoload no
- "setenv loadkernel 'load scsi {ROOT_PART} {KERNEL_ADDR} {KERNEL}'"
- "setenv loadinitrd 'load scsi {ROOT_PART} {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'"
- "setenv loadfdt 'load scsi {ROOT_PART} {DTB_ADDR} {DTB}'"
- "setenv bootargs ' root={ROOT} ip=dhcp'"
- setenv bootcmd 'run loadkernel; run loadinitrd; run loadfdt; booti {KERNEL_ADDR} {RAMDISK_ADDR} {DTB_ADDR}'
- run bootcmd
timeouts:
actions:
apply-overlay-image:
minutes: 2
dd-image:
minutes: 10
download-retry:
minutes: 5
http-download:
minutes: 5
lava-test-shell:
minutes: 3
nfs-deploy:
minutes: 10
power-off:
seconds: 5
bootloader-commands:
minutes: 3
bootloader-interrupt:
seconds: 30
u-boot-interrupt:
seconds: 30
umount-retry:
seconds: 45
auto-login-action:
minutes: 2
bootloader-action:
minutes: 3
uboot-action:
minutes: 3
uboot-retry:
minutes: 3
bootloader-retry:
minutes: 3
boot-qemu-image:
minutes: 2
boot-image-retry:
minutes: 2
connections:
dd-image:
minutes: 10
uboot-retry:
seconds: 30
bootloader-commands:
seconds: 30
auto-login-action:
minutes: 2
bootloader-interrupt:
seconds: 30
u-boot-interrupt:
seconds: 30
lava-test-shell:
seconds: 10
- class: actions.deploy.tftp.TftpAction
name: tftp-deploy
pipeline:
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- class: actions.deploy.download.DownloaderAction
name: download-retry
pipeline:
- {class: actions.deploy.download.HttpDownloadAction, name: http-download}
- class: actions.deploy.apply_overlay.PrepareOverlayTftp
name: prepare-tftp-overlay
pipeline:
- {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.ExtractRamdisk, name: extract-overlay-ramdisk}
- {class: actions.deploy.apply_overlay.ExtractModules, name: extract-modules}
- {class: actions.deploy.apply_overlay.ApplyOverlayTftp, name: apply-overlay-tftp}
- class: actions.deploy.prepare.PrepareKernelAction
name: prepare-kernel
pipeline:
- {class: actions.deploy.prepare.UBootPrepareKernelAction, name: uboot-prepare-kernel}
- {class: actions.deploy.apply_overlay.ConfigurePreseedFile, name: configure-preseed-file}
- {class: actions.deploy.apply_overlay.CompressRamdisk, name: compress-ramdisk}
- {class: actions.deploy.lxc.LxcCreateUdevRuleAction, name: lxc-create-udev-rule-action}
- {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.u_boot.UBootInterrupt, name: u-boot-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}
device_type: xilinx-zcu102
job_name: U-Boot ramdisk snapshots
timeouts:
job:
minutes: 15
action:
minutes: 5
connection:
minutes: 2
priority: medium
visibility: public
metadata:
original.build: http://snapshots.linaro.org/openembedded/lite/rocko/zcu102-zynqmp/1/poky/
actions:
- deploy:
timeout:
minutes: 4
to: tftp
kernel:
url: http://images.validation.linaro.org/snapshots.linaro.org/openembedded/lite/rocko/zcu102-zynqmp/1/poky/Image--4.9-xilinx-v2017.3+git0+f1b1e077d6-r0-zcu102-zynqmp-20180118171031.bin
type: image
modules:
url: http://images.validation.linaro.org/snapshots.linaro.org/openembedded/lite/rocko/zcu102-zynqmp/1/poky/modules--4.9-xilinx-v2017.3+git0+f1b1e077d6-r0-zcu102-zynqmp-20180118171031.tgz
compression: gz
ramdisk:
url: http://images.validation.linaro.org/snapshots.linaro.org/openembedded/lite/rocko/zcu102-zynqmp/1/poky/core-image-minimal-zcu102-zynqmp-20180118171031.rootfs.cpio.gz.u-boot
# the bootloader needs a u-boot header on the modified ramdisk
add-header: u-boot
header: u-boot
compression: gz
os: oe
dtb:
url: http://images.validation.linaro.org/snapshots.linaro.org/openembedded/lite/rocko/zcu102-zynqmp/1/poky/Image--4.9-xilinx-v2017.3+git0+f1b1e077d6-r0-zynqmp-zcu102-rev1.0-20180118171031.dtb
- boot:
method: u-boot
commands: ramdisk
auto_login:
login_prompt: 'login:'
username: root
prompts:
- 'root@zcu102-zynqmp:'
timeout:
minutes: 2
- test:
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
......@@ -69,6 +69,16 @@ class UBootFactory(Factory): # pylint: disable=too-few-public-methods
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)
with open(zcu_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
class TestUbootAction(StdoutTestCase): # pylint: disable=too-many-public-methods
......@@ -410,6 +420,13 @@ class TestUbootAction(StdoutTestCase): # pylint: disable=too-many-public-method
self.assertEqual(nfs.parameters['nfsrootfs']['prefix'], 'jessie/')
self.assertEqual(nfs.param_key, 'nfsrootfs')
def test_zcu102(self):
job = self.factory.create_zcu102_job('sample_jobs/zcu102-ramdisk.yaml')
job.validate()
self.assertEqual(job.pipeline.errors, [])
description_ref = self.pipeline_reference('zcu102-ramdisk.yaml', job=job)
self.assertEqual(description_ref, job.pipeline.describe(False))
class TestKernelConversion(StdoutTestCase):
......
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