Commit dc5a6fe4 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Neil Williams

templates: handle multinode vs singlenode

Also fix and test more sample jobs.
Signed-off-by: Rémi Duraffort's avatarRémi Duraffort <remi.duraffort@linaro.org>
parent 5f01a79c
Pipeline #2550 passed with stages
in 12 minutes and 25 seconds
......@@ -13,7 +13,7 @@ else
PYTHONPATH=. ./share/lava-schema.py job ${CMD} doc/v2/examples/test-jobs/*.yaml
# lava_dispatcher
EXCLUDE="basics.yaml bbb-group-vland-alpha.yaml bbb-group-vland-beta.yaml bbb-ssh-guest.yaml cubietruck-removable-with-writer.yaml cubietruck-removable.yaml download.yaml hi6220-hikey.yaml hi6220-recovery.yaml hikey-console.yaml hikey-grub-lxc.yaml kvm-multinode-client.yaml kvm-multinode-server.yaml kvm-repeat.yaml mustang-secondary-media.yaml qemu-debian-installer.yaml ssh-boot.yaml ssh-deploy.yaml test_action-1.yaml test_action-2.yaml x15-recovery.yaml"
EXCLUDE="basics.yaml bbb-group-vland-alpha.yaml bbb-group-vland-beta.yaml bbb-ssh-guest.yaml download.yaml hi6220-recovery.yaml hikey-console.yaml kvm-multinode-client.yaml kvm-multinode-server.yaml kvm-repeat.yaml ssh-boot.yaml ssh-deploy.yaml test_action-1.yaml test_action-2.yaml x15-recovery.yaml"
CMD="--exclude $(echo ${EXCLUDE} | sed "s# # --exclude #g#")"
PYTHONPATH=. ./share/lava-schema.py job ${CMD} lava_dispatcher/tests/sample_jobs/*.yaml
......
device_type: mustang
job_name: ssh guest with standard images
timeouts:
......
......@@ -73,6 +73,7 @@ def notify():
def extra_checks(data):
check_job_timeouts(data)
check_multinode_or_device_type(data)
check_namespace(data)
check_secrets_visibility(data)
......@@ -112,6 +113,16 @@ def check_job_timeouts(data):
_check_timeout("Action", ["actions", str(index)], t)
def check_multinode_or_device_type(data):
device_type = data.get("device_type")
multinode = data.get("protocols", {}).get("lava-multinode")
if device_type and multinode:
raise Invalid('"device_type" shoud not be used with multinode')
if not device_type and not multinode:
raise Invalid('"device_type" or multinode should be defined')
def check_namespace(data):
# If namespace is used in one action, every actions should use namespaces.
actions_with_ns = 0
......@@ -147,7 +158,7 @@ def schema():
return All(
{
Required("job_name"): All(str, Length(min=1, max=200)),
Required("device_type"): All(str, Length(min=1, max=200)),
Optional("device_type"): All(str, Length(min=1, max=200)),
Required("timeouts"): {
Required("job"): timeout(),
Optional("action"): timeout(),
......
......@@ -45,7 +45,8 @@ protocols:
actions:
- deploy:
role: server
role:
- server
namespace: tlxc
timeout:
minutes: 15
......@@ -55,7 +56,8 @@ actions:
os: debian
- boot:
role: server
role:
- server
namespace: tlxc
prompts:
- "root@(.*):/#"
......@@ -65,7 +67,8 @@ actions:
method: lxc
- deploy:
role: server
role:
- server
timeout:
minutes: 15
to: fastboot
......@@ -86,7 +89,8 @@ actions:
os: oe
- boot:
role: server
role:
- server
namespace: hikey-oe
auto_login:
login_prompt: "login:"
......@@ -136,7 +140,8 @@ actions:
name: dmidecode
- test:
role: server
role:
- server
namespace: hikey-oe
timeout:
minutes: 5
......@@ -166,12 +171,13 @@ actions:
path: inline/network.yaml
- test:
role: server
namespace: tlxc
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-basic-ubuntu
role:
- server
namespace: tlxc
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-basic-ubuntu
device_type: lxc
job_name: lxc-pipeline
timeouts:
job:
......
device_type: mustang
job_name: KVM pipeline test
timeouts:
......
......@@ -25,7 +25,8 @@ protocols:
actions:
- deploy:
role: device
role:
- device
namespace: tlxc
timeout:
minutes: 5
......@@ -36,7 +37,8 @@ actions:
os: debian
- boot:
role: device
role:
- device
namespace: tlxc
prompts:
- 'root@(.*):/#'
......@@ -45,7 +47,8 @@ actions:
method: lxc
- deploy:
role: device
role:
- device
timeout:
minutes: 5
to: fastboot
......@@ -60,14 +63,16 @@ actions:
os: debian
- boot:
role: device
role:
- device
namespace: droid
timeout:
minutes: 15
method: fastboot
- test:
role: device
role:
- device
namespace: tlxc
timeout:
minutes: 5
......@@ -79,7 +84,8 @@ actions:
- test:
namespace: tlxc
role: device
role:
- device
timeout:
minutes: 10
definitions:
......
......@@ -5,13 +5,12 @@ timeouts:
job:
hours: 4
action:
hours: 5
hours: 4
connection:
minutes: 10
visibility: public
priority: medium
device_type: x86
protocols:
lava-multinode:
......
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