=== modified file 'doc/lava_test_shell.rst'
@@ -10,15 +10,16 @@
::
- {
- "format": "Lava-Test Test Definition 1.0",
- "test_id": "pass_fail"
- "run": {
- "steps": ["echo test-1: pass", "echo test-2: fail"]
- "parse": {
- "pattern": "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"
- }
- }
+ metadata:
+ format: Lava-Test Test Definition 1.0
+ name: passfail
+
+ run:
+ steps:
+ - echo "test-1: pass"
+ - echo "test-2: fail"
+
+ pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"
The main thing to note is that the parse pattern requires regex expressions
like \\s to be escaped, so it must be \\\\s
@@ -29,9 +30,10 @@
If your test requires some packages to be installed before its run it can
express that in the ``install`` section with::
- "install": {
- "deps": ["linux-libc-dev", "build-essential"]
- },
+ install:
+ deps:
+ - linux-libc-dev
+ - build-essential
Adding Git/BZR Repositories
===========================
@@ -39,13 +41,16 @@
If your test needs code from a shared repository, the action can clone this
data on your behalf with::
- "install": {
- "bzr-repos": ["lp:lava-test"],
- "git-repos": ["git://git.linaro.org/people/davelong/lt_ti_lava.git"]
- },
- "run": {
- "steps": ["cd lt_ti_lava", "echo now in the git cloned directory"]
- }
+ install:
+ bzr-repos:
+ - lp:lava-test
+ git-repos:
+ - git://git.linaro.org/people/davelong/lt_ti_lava.git
+
+ run:
+ steps:
+ - cd lt_ti_lava
+ - echo "now in the git cloned directory"
This repository information will also be added to resulting bundle's software
context when the results are submitted to the LAVA dashboard.
@@ -57,10 +62,13 @@
work if needed. For example if you needed to build some code from a git repo
you could do::
- "install": {
- "git-repos": ["git://git.linaro.org/people/davelong/lt_ti_lava.git"],
- "steps": ["cd lt_ti_lava", "make"]
- },
+ install:
+ git-repos:
+ - git://git.linaro.org/people/davelong/lt_ti_lava.git
+
+ steps:
+ - cd lt_ti_lava
+ - make
**NOTE:** The repo steps are done in the dispatcher itself. The install steps
are run directly on the target.
@@ -72,10 +80,8 @@
in the required pass/fail/skip/unknown format required by LAVA. The parse
section has a fixup mechanism that can help::
- "parse": {
- "pattern": "(?P<test_case_id>.*-*)\\s+:\\s+(?P<result>(PASS|FAIL))",
- "fixupdict": {
- "PASS": "pass",
- "FAIL": "fail"
- }
- }
+ parse:
+ pattern: "(?P<test_case_id>.*-*)\\s+:\\s+(?P<result>(PASS|FAIL))"
+ fixupdict:
+ PASS: pass
+ FAIL: fail