Commit 8f0d5a94 authored by Karsten's avatar Karsten Committed by Neil Williams

Pass LXC/fastboot parameters to all jobs in split_multinode_yaml

reboot_to_fastboot was not handled before, so that Android devices would
always reboot to fastboot after test runs, even if this parameter was
set to false in the job submission.

lava-lxc protocol metadata was only populated for the first job of each
role. This change passes the data to all job instances, so that multiple
jobs per role can be created.

Change-Id: I5a89d748468e8b85224c2c60be8c8016b203b648
parent 13758edc
job_name: Nexus4 multinode
timeouts:
job:
minutes: 60
action:
minutes: 5
connection:
minutes: 2
priority: medium
visibility: public
reboot_to_fastboot: false
protocols:
lava-multinode:
roles:
device:
count: 2
device_type: nexus4
lava-lxc:
device:
name: lxc-nexus4
template: debian
distribution: debian
release: sid
actions:
- deploy:
role: device
namespace: tlxc
timeout:
minutes: 5
to: lxc
packages:
- adb
- fastboot
os: debian
- boot:
role: device
namespace: tlxc
prompts:
- 'root@(.*):/#'
timeout:
minutes: 5
method: lxc
- deploy:
role: device
timeout:
minutes: 5
to: fastboot
namespace: droid
images:
boot:
url: http://people.linaro.org/~senthil.kumaran/nexus4-userdebug/boot.img
userdata:
url: http://people.linaro.org/~senthil.kumaran/nexus4-userdebug/userdata.img
system:
url: http://people.linaro.org/~senthil.kumaran/nexus4-userdebug/system.img
os: debian
- boot:
role: device
namespace: droid
timeout:
minutes: 15
method: fastboot
- test:
role: device
namespace: tlxc
timeout:
minutes: 5
definitions:
- repository: https://git.linaro.org/lava-team/lava-functional-tests.git
from: git
path: lava-test-shell/android/get-adb-serial.yaml
name: get-nexus4-serial
- test:
namespace: tlxc
role: device
timeout:
minutes: 10
definitions:
- from: inline
name: multinode-sync
path: inline/multinode-sync.yaml
repository:
metadata:
format: Lava-Test Test Definition 1.0
name: multinode-sync
description: "Check that the LXCs can communicate."
run:
steps:
- lava-sync ping
......@@ -747,6 +747,27 @@ class TestYamlMultinode(TestCaseWithFactory):
else:
self.fail('Unrecognised role: %s' % role)
def test_multinode_nexus4(self):
submission = yaml.load(open(
os.path.join(os.path.dirname(__file__), 'sample_jobs', 'nexus4_multinode.yaml'), 'r'))
target_group = 'arbitrary-group-id' # for unit tests only
jobs = split_multinode_yaml(submission, target_group)
device_protocol_data = {
'lava-lxc': {
'name': 'lxc-nexus4', 'template': 'debian', 'release': 'sid',
'distribution': 'debian'}
}
for role, _ in jobs.items():
if role == 'device':
for job in jobs[role]:
self.assertIn('lava-lxc', job['protocols'])
self.assertEqual(job['protocols']['lava-lxc'], device_protocol_data['lava-lxc'])
self.assertIn('reboot_to_fastboot', job)
self.assertEqual(job['reboot_to_fastboot'], False)
else:
self.fail('Unrecognised role: %s' % role)
def test_multinode_protocols(self):
user = self.factory.make_user()
device_type = self.factory.make_device_type()
......
......@@ -155,6 +155,7 @@ def split_multinode_yaml(submission, target_group): # pylint: disable=too-many-
'visibility',
'notify',
'metadata',
'reboot_to_fastboot',
]
skip = ['role', 'roles']
scheduling = ['device_type', 'connection', 'host_role', 'context'] # top level values to be preserved
......@@ -261,7 +262,8 @@ def split_multinode_yaml(submission, target_group): # pylint: disable=too-many-
if role not in submission['protocols']['lava-lxc']:
continue
# populate the lava-lxc protocol metadata
jobs[role][0]['protocols'].update({'lava-lxc': submission['protocols']['lava-lxc'][role]})
for job in jobs[role]:
job['protocols'].update({'lava-lxc': submission['protocols']['lava-lxc'][role]})
return jobs
......
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