id: stub/true
_summary: Passing shell job
_description:
 Check success result from shell test case
plugin: shell
command: true; echo oops
estimated_duration: 0.1

id: stub/false
_summary: Failing shell job
_description:
 Check failed result from shell test case
plugin: shell
command: false
estimated_duration: 0.1

id: stub/dependency/good
_summary: Passing shell job depending on a passing shell job
_description:
 Check job is executed when dependency succeeds
plugin: shell
depends: stub/true
command: true
estimated_duration: 0.1

plugin: shell
id: stub/dependency/bad
depends: stub/false
command: true
_summary: Passing shell job depending on a failing shell job
_description:
 Check job result is set to uninitiated when dependency fails
estimated_duration: 0.1

id: stub/sleep-60
_summary: Job sleeping for sixty seconds 
_description: Sleep for sixty seconds
plugin: shell
command: sleep 60
estimated_duration: 60

id: stub/kill-ppid-if-KILLER-set
_summary: Job killing the parent, if KILLER=yes
_description: Kill $PPID if $KILLER is set to yes
plugin: shell
# XXX: why is this dependency here?
depends: stub/multilevel
command: if [ "$KILLER" == "yes" ]; then kill -9 $PPID; fi
estimated_duration: 0.1

# FIXME: stub/package once resource_object is supported
id: stub_package
_summary: Job determining a fake list of packages (1)
_description:
    This job generates a resource object with what looks
    like a list of packages.
    .
    The actual packages are fake
plugin: resource
command: stub_package_list
estimated_duration: 0.5

id: stub_package2
_summary: Job determining a fake list of packages (2)
_description:
    This job generates a resource object with what looks
    like a list of packages.
    .
    The actual packages are fake
plugin: resource
command: stub_package_list
estimated_duration: 0.5

id: stub/requirement/good
_summary: Passing shell job depending on an availalbe resource
_description:
 Check job is executed when requirements are met
plugin: shell
requires: stub_package.name == "checkbox"
command: true
estimated_duration: 0.1

id: stub/requirement/bad
_summary: Passing shell job depending on an unavailable resource
_description:
 Check job result is set to "not required on this system" when requirements are not met
plugin: shell
requires: stub_package.name == "unknown-package"
command: true
estimated_duration: 0.1

id: stub/manual
_summary: A simple manual job
_description:
 PURPOSE:
     This test checks that the manual plugin works fine
 STEPS:
     1. Add a comment
     2. Set the result as passed
 VERIFICATION:
     Check that in the report the result is passed and the comment is displayed
plugin: manual
estimated_duration: 30

id: stub/user-interact
_summary: A simple user interaction job
_description:
 PURPOSE:
     This test checks that the user-interact plugin works fine
 STEPS:
     1. Read this description
     2. Press the test button
 VERIFICATION:
     Check that in the report the result is passed
plugin: user-interact
command: true
estimated_duration: 30

id: stub/user-verify
_summary: A simple user verification job
_description:
 PURPOSE:
     This test checks that the user-verify plugin works fine
 STEPS:
     1. Read this description
     2. Ensure that the command has been started automatically
     3. Do not press the test button
     4. Look at the output and determine the outcome of the test
 VERIFICATION:
     The command should have printed "Please select 'pass'"
plugin: user-verify
command: echo "Please select 'pass'"
estimated_duration: 30

id: stub/user-interact-verify
_summary: A simple user verification-interaction job
_description:
 PURPOSE:
     This test checks that the user-interact-verify plugin works fine
 STEPS:
     1. Read this description
     2. Ensure that the command has not been started yet
     3. Press the test button
     4. Look at the output and determine the outcome of the test
 VERIFICATION:
     The command should have printed "Please select 'pass'"
plugin: user-interact-verify
command: echo "Please select 'pass'"
estimated_duration: 25

id: stub/user-interact-verify-passing
_summary: A suggested-passing user-verification-interaction job
_description:
 PURPOSE:
     This test checks that the application user interface auto-suggests 'pass'
     as the outcome of a test for user-interact-verify jobs that have a command
     which completes successfully.
 STEPS:
     1. Read this description
     2. Ensure that the command has not been started yet
     3. Press the test button
     4. Confirm the auto-suggested value
 VERIFICATION:
     The auto suggested value should have been 'pass'
plugin: user-interact-verify
command: true
estimated_duration: 25

id: stub/user-interact-verify-failing
_summary: A suggested-failing user-verification-interaction job
_description:
 PURPOSE:
     This test checks that the application user interface auto-suggests 'fail'
     as the outcome of a test for user-interact-verify jobs that have a command
     which completes unsuccessfully.
 STEPS:
     1. Read this description
     2. Ensure that the command has not been started yet
     3. Press the test button
     4. Confirm the auto-suggested value
 VERIFICATION:
     The auto suggested value should have been 'fail'
plugin: user-interact-verify
command: false
estimated_duration: 25

id: __local__
_summary: A job generating one more job
_description:
    This job generates the stub/local/true job
plugin: local
command:
  shopt -s extglob
  cat $PLAINBOX_PROVIDER_UNITS/jobs/local.txt?(.in)
estimated_duration: 0.1

id: __multilevel__
_summary: A job generating more generator jobs
_description: 
    This job generates stub/multilevel which in turn can
    generate stub/multilevel_1 and stub/multilevel_2
plugin: local
command:
  shopt -s extglob
  cat $PLAINBOX_PROVIDER_UNITS/jobs/multilevel.txt?(.in)
estimated_duration: 0.1

id: stub/root
_summary: A job that runs as root
_description:
 Check that becoming root works
plugin: shell
user: root
command: test $(id -u) -eq 0
estimated_duration: 0.1
