id: stub/true
_summary: Passing shell job
_description:
 Check success result from shell test case
plugin: shell
flags: preserve-locale
command: true; echo oops
estimated_duration: 0.1
category_id: plugin-representative

id: stub/false
_summary: Failing shell job
_description:
 Check failed result from shell test case
plugin: shell
flags: preserve-locale
command: false
estimated_duration: 0.1
category_id: plugin-representative

id: stub/crash
_summary: A crashing shell job
_description:
 Check crash result from a shell test case (killed with SIGTERM)
plugin: shell
flags: preserve-locale
command: kill -TERM $$
estimated_duration: 0.1
category_id: plugin-representative

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
flags: preserve-locale
command: true
estimated_duration: 0.1
category_id: dependency-chain

plugin: shell
id: stub/dependency/bad
depends: stub/false
flags: preserve-locale
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
category_id: dependency-chain

id: stub/sleep-60
_summary: Job sleeping for sixty seconds
_description: Sleep for sixty seconds
plugin: shell
flags: preserve-locale
command: sleep 60
estimated_duration: 60
category_id: long

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
flags: preserve-locale
command: if [ "$KILLER" == "yes" ]; then kill -9 $PPID; fi
estimated_duration: 0.1
category_id: misc

# 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
flags: preserve-locale
command: stub_package_list
estimated_duration: 0.5
category_id: plugin-representative

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
flags: preserve-locale
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"
flags: preserve-locale
command: true
estimated_duration: 0.1
category_id: dependency-chain

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"
flags: preserve-locale
command: true
estimated_duration: 0.1
category_id: dependency-chain

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
category_id: plugin-representative

id: stub/split-fields/manual
_summary: A simple manual job using finer description fields
_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
category_id: split-field-representative

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
flags: preserve-locale
command: true
estimated_duration: 30
category_id: plugin-representative

id: stub/split-fields/user-interact
_summary: User-interact job using finer description fields
_purpose:
    This is a purpose part of test description
_steps:
    1. First step in the user-iteract job
    2. Second step in the user-iteract job
_verification:
    Verification part of test description
plugin: user-interact
flags: preserve-locale
command: true
estimated_duration: 30
category_id: split-field-representative

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
flags: preserve-locale
command: echo "Please select 'pass'"
estimated_duration: 30
category_id: plugin-representative

id: stub/split-fields/user-verify
_summary: User-verify job using finer description fields
_purpose:
     This test checks that the user-verify plugin works fine and that
     description field is split properly
_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
flags: preserve-locale
command: echo "Please select 'pass'"
estimated_duration: 30
category_id: split-field-representative

id: stub/user-interact-verify
_summary: A simple user interaction and verification 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
flags: preserve-locale
command: echo "Please select 'pass'"
estimated_duration: 25
category_id: plugin-representative

id: stub/split-fields/user-interact-verify
_summary: A simple user interaction and verification job using finer
    description fields
_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
flags: preserve-locale
command: echo "Please select 'pass'"
estimated_duration: 25
category_id: split-field-representative

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
flags: preserve-locale
command: true
estimated_duration: 25
category_id: plugin-representative

id: stub/split-fields/user-interact-verify-passing
_summary: A suggested-passing user-verification-interaction job using finer
    description fields
_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
flags: preserve-locale
command: true
estimated_duration: 25
category_id: split-field-representative

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
flags: preserve-locale
command: false
estimated_duration: 25
category_id: plugin-representative

id: stub/split-fields/user-interact-verify-failing
_summary: A suggested-failing user-verification-interaction job using finer
    description fields
_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
flags: preserve-locale
command: false
estimated_duration: 25
category_id: split-field-representative

id: __local__
_summary: A job generating one more job
_description:
    This job generates the stub/local/true job
plugin: local
flags: preserve-locale
command:
  shopt -s extglob
  cat $PLAINBOX_PROVIDER_UNITS/jobs/local.pxu
estimated_duration: 0.1
category_id: plugin-representative

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
flags: preserve-locale
command:
  shopt -s extglob
  cat $PLAINBOX_PROVIDER_UNITS/jobs/multilevel.pxu
estimated_duration: 0.1

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

id: stub/text-attachment
_summary: A job that attaches a plain text file
_description:
 This job attaches a simple, fixed, piece of UTF-8 encoded text as attachment
plugin: attachment
flags: preserve-locale
# The subsequent polish text is a typical 'the quick brown fox...' text that
# is used just because it's likely to expose any non-ASCII text handling bugs.
command:
 echo "zazółć gęślą jaźń"
estimated_duration: 0.1
category_id: plugin-representative

id: stub/binary-attachment
_summary: A job that attaches representative binary data
_description:
 This job generates bytes 0 through 255 to test handling of bytes that may
 occur but be mishandled by our I/O processing engine.
plugin: attachment
flags: preserve-locale
# The all-bytes file can be generated with the following piece of bash but
# I wanted to avoid reliance on the obscure escape processing for
# portability:
# for i in $(seq 0 255); do
#  echo -n -e "\x$(printf %x $i)"
# done
command:
 cat $PLAINBOX_PROVIDER_DATA/all-bytes

id: stub/large-text-attachment
_summary: A job that attaches a plain text file
_description:
 This job attaches a large, repeated sequence of UTF-8 encoded text as
 attachment. It helps to stress the I/O handling code that might not happen in
 a trivial (short / small) attachment.
plugin: attachment
flags: preserve-locale
# The subsequent polish text is a typical 'the quick brown fox...' text that
# is used just because it's likely to expose any non-ASCII text handling bugs.
command:
 for i in $(seq 100000); do
    echo "$i: zazółć gęślą jaźń"
 done
estimated_duration: 0.1
category_id: stress

id: stub/large-binary-attachment
_summary: A job that attaches representative binary data
_description:
 This job attaches 16GBs of zeros to see if we can handle (mostly on the memory
 front) such types of attachments, e.g. someone attaching a swap file, or
 something equally unexpected and very large.
plugin: attachment
flags: preserve-locale
command:
 dd if=/dev/zero bs=1M count=16384
estimated_duration: 750
category_id: stress

id: stub/qml-simple
_summary: A QML job that runs simple GUI
_description:
 This job displays a GUI that has two buttons determining outcome of the test.
 It's similar to user-interact-verify, but this job is QML native.
plugin: qml
qml_file: qml-simple.qml
flags: preserve-locale
estimated_duration: 10
category_id: qml-native

id: stub/qml-navigation
_summary: A QML job that has its own navigation
_description:
 This job displays a GUI with multiple screens using its own (independent) flow
 control mechanism (page stack).
plugin: qml
qml_file: qml-navigation.qml
flags: preserve-locale
estimated_duration: 20
category_id: qml-native
