Commit abb9869f authored by Neil Williams's avatar Neil Williams 💬

Unit tests for 960 AOSP support

Change-Id: Ib93d7699e3da07e1904fb90c0270ab2ec659f1e5
parent ce1421a3
- class: actions.deploy.lxc.LxcAction
name: lxc-deploy
pipeline:
- {class: actions.deploy.lxc.LxcCreateAction, name: lxc-create-action}
- {class: actions.deploy.lxc.LxcCreateUdevRuleAction, name: lxc-create-udev-rule-action}
- {class: actions.boot.lxc.LxcStartAction, name: boot-lxc}
- {class: actions.deploy.lxc.LxcAptUpdateAction, name: lxc-apt-update}
- {class: actions.deploy.lxc.LxcAptInstallAction, name: lxc-apt-install}
- {class: actions.boot.lxc.LxcStopAction, name: lxc-stop}
- {class: actions.deploy.environment.DeployDeviceEnvironment, name: deploy-device-env}
- class: actions.deploy.overlay.OverlayAction
name: lava-overlay
pipeline:
- {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.ApplyLxcOverlay, name: apply-lxc-overlay}
- class: actions.boot.lxc.BootLxcAction
name: lxc-boot
pipeline:
- {class: actions.boot.lxc.LxcStartAction, name: boot-lxc}
- {class: actions.boot.lxc.LxcAddStaticDevices, name: lxc-add-static}
- {class: connections.lxc.ConnectLxc, name: connect-lxc}
- {class: shell.ExpectShellSession, name: expect-shell-connection}
- {class: actions.boot.environment.ExportDeviceEnvironment, name: export-device-env}
- class: actions.deploy.fastboot.FastbootAction
name: fastboot-deploy
pipeline:
- {class: connections.serial.ConnectDevice, name: connect-device}
- class: power.ResetDevice
name: reset-device
pipeline:
- {class: power.PDUReboot, name: pdu-reboot}
- 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.fastboot.FastbootFlashOrderAction
name: fastboot-flash-order-action
pipeline:
- {class: power.ReadFeedback, name: read-feedback}
- {class: actions.deploy.fastboot.FastbootFlashAction, name: fastboot-flash-action}
- {class: actions.deploy.fastboot.FastbootFlashAction, name: fastboot-flash-action}
- {class: actions.deploy.fastboot.FastbootFlashAction, name: fastboot-flash-action}
- {class: actions.deploy.fastboot.FastbootFlashAction, name: fastboot-flash-action}
- class: actions.boot.fastboot.BootFastbootAction
name: fastboot-boot
pipeline:
- {class: connections.serial.ConnectDevice, name: connect-device}
- class: power.ResetDevice
name: reset-device
pipeline:
- {class: power.PDUReboot, name: pdu-reboot}
- {class: actions.boot.fastboot.FastbootBootAction, name: boot-fastboot}
- {class: actions.boot.AutoLoginAction, name: auto-login-action}
- 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: hi960-hikey
job_name: HiKey 960 Android boot test
timeouts:
job:
minutes: 10
action:
minutes: 10
connection:
minutes: 2
priority: medium
visibility: public
metadata:
build: 36
protocols:
lava-lxc:
name: lxc-hikey-test
template: debian
distribution: debian
release: stretch
mirror: http://mirror.bytemark.co.uk/debian
actions:
- deploy:
namespace: tlxc
timeout:
minutes: 5
to: lxc
packages:
- adb
- fastboot
os: debian
- boot:
namespace: tlxc
prompts:
- 'root@(.*):'
- 'hikey: '
timeout:
minutes: 5
method: lxc
- deploy:
timeout:
minutes: 120
to: fastboot
namespace: droid
images:
boot:
url: http://snapshots.linaro.org/android/pmwg/android-hikey960-linaro-4.9-pmwg/36/boot.img.xz
compression: xz
cache:
url: http://testdata.validation.linaro.org/hikey960-pmwg/cache.img.xz
compression: xz
userdata:
url: http://testdata.validation.linaro.org/hikey960-pmwg/userdata.img.xz
compression: xz
system:
url: http://testdata.validation.linaro.org/hikey960-pmwg/system.img.xz
compression: xz
os: debian
protocols:
lava-lxc:
- action: fastboot-deploy
request: pre-power-command
timeout:
minutes: 2
- boot:
namespace: droid
prompts:
- "console:"
timeout:
minutes: 2
method: fastboot
- test:
namespace: tlxc
timeout:
minutes: 5
definitions:
- repository: https://git.linaro.org/lava-team/refactoring.git/
from: git
path: android/lava-android-basic-lxc.yaml
name: v2-make-adb-connection
......@@ -33,6 +33,7 @@ from lava_dispatcher.protocols.lxc import LxcProtocol
from lava_dispatcher.test.test_basic import Factory, StdoutTestCase
from lava_dispatcher.test.utils import DummyLogger
from lava_dispatcher.actions.deploy import DeployAction
from lava_dispatcher.actions.deploy.fastboot import FastbootFlashOrderAction
from lava_dispatcher.actions.boot.fastboot import BootAction
......@@ -81,6 +82,16 @@ class FastBootFactory(Factory): # pylint: disable=too-few-public-methods
job.logger = DummyLogger()
return job
def create_hikey960_job(self, filename, output_dir='/tmp/'): # pylint: disable=no-self-use
device = NewDevice(os.path.join(os.path.dirname(__file__), '../devices/hikey960-01.yaml'))
y_file = os.path.join(os.path.dirname(__file__), filename)
with open(y_file) 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_nexus5x_job(self, filename, output_dir='/tmp/'): # pylint: disable=no-self-use
device = NewDevice(os.path.join(os.path.dirname(__file__), '../devices/nexus5x-01.yaml'))
fastboot_yaml = os.path.join(os.path.dirname(__file__), filename)
......@@ -290,4 +301,27 @@ class TestFastbootDeploy(StdoutTestCase): # pylint: disable=too-many-public-met
flash_order.pipeline.actions if
action.name == 'fastboot-flash-action']
self.assertIsNotNone(flash_order)
self.assertIsInstance(flash_order, FastbootFlashOrderAction)
self.assertEqual(expected_flash_cmds, flash_cmds)
def test_hikey960_fastboot(self):
job = self.factory.create_hikey960_job('sample_jobs/hikey960-aosp.yaml')
self.assertIsNotNone(job)
job.validate()
description_ref = self.pipeline_reference('hi960-aosp-efi.yaml', job=job)
self.assertEqual(description_ref, job.pipeline.describe(False))
flash_order = None
expected_flash_cmds = ['boot', 'system', 'userdata', 'cache']
for action in job.pipeline.actions:
self.assertIsNotNone(action.name)
if isinstance(action, DeployAction):
if action.name == 'fastboot-deploy':
flash_order = [action for action in
action.pipeline.actions if action.name ==
'fastboot-flash-order-action'][0]
flash_cmds = [action.command for action in
flash_order.pipeline.actions if
action.name == 'fastboot-flash-action']
self.assertIsNotNone(flash_order)
self.assertIsInstance(flash_order, FastbootFlashOrderAction)
self.assertEqual(expected_flash_cmds, flash_cmds)
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