From 747be27e4fb06f3ec5637637eb55046b7e59e75f Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Sep 25 2019 13:05:44 +0000 Subject: Default execute implementation is shell [fix #20] --- diff --git a/l2/README.md b/l2/README.md index 2951d56..e917017 100644 --- a/l2/README.md +++ b/l2/README.md @@ -204,14 +204,49 @@ Specification of the testing framework which should execute tests. * Execute discovered tests on provisioned boxes * With optional support for parallelization +Examples of execution implementation: + +* `shell` ... execute arbitratry shell commands, check exit code (default) +* `beakerlib` ... run beakerlib tests, check the journal for test results +* `restraint` ... use the [restraint][restraint] harness to execute beakerlib tests + Example config: execute: - how: restraint + how: beakerlib isolate: true Optional boolean attribute `isolate` can be used to request a clean test environment for each test. +The `shell` implementation is the default one. +Thus you can omit the `how` keyword and just define the `script` to be run. +This is how a minimal smoke test for the `fmf` command line can look like: + + execute: + script: fmf --help + +You can also include several commands as a list. +Executor will run commands one-by-one and check exit code of each: + + execute: + script: + - dnf -y install httpd curl + - systemctl start httpd + - echo foo > /var/www/html/index.html + - curl http://localhost/ | grep foo + +Finally, providing a multi-line shell script is also supported: + + execute: + script: | + dnf -y install httpd curl + systemctl start httpd + echo foo > /var/www/html/index.html + curl http://localhost/ | grep foo + +In that case executor will store given script into a file and execute. + + ### Report Adjusting notifications about the test progress and results. @@ -235,3 +270,5 @@ Example config: finish: how: shell command: upload-logs.sh + +[restraint]: https://restraint.readthedocs.io/