plugin: shell
name: optical/detect
requires: device.category == 'CDROM'
description: Test to detect the optical drives
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"' | sed '/^$/d'
 $vendor $product
 EOF

plugin: local
name: optical/read
requires:
 device.category == 'CDROM'
description: Optical read test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: user-interact-verify
 name: optical/read_`ls /sys$path/block`
 requires: device.path == "$path"
 user: root
 command: optical_read_test /dev/`ls /sys$path/block`
 description:
  PURPOSE:
      This test will check your $product device's ability to read CD media
  STEPS:
      1. Insert appropriate non-blank media into your optical drive(s). Movie and Audio Disks may not work. Self-created data disks have the greatest chance of working.
      2. If a file browser window opens, you can safely close or ignore that window.
      3. Click "Test" to begin the test.
  VERIFICATION:
      This test should automatically select "Yes" if it passes, "No" if it fails.
 EOF

plugin: local
name: optical/read-automated
requires:
 device.category == 'CDROM'
description: Automated optical read test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: shell
 name: optical/read-automated_`ls /sys$path/block`
 requires: device.path == "$path"
 user: root
 command: optical_read_test /dev/`ls /sys$path/block`
 description:
  This is an automated version of optical/read. It assumes you have already inserted a data CD into your optical drive prior to running Checkbox.
 EOF

plugin: local
name: optical/cdrom-write
requires:
 device.category == 'CDROM'
 optical_drive.cd == 'writable'
description: CD write test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: user-interact-verify
 name: optical/cdrom-write_`ls /sys$path/block`
 requires: device.path == "$path"
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` | ansi_parser
 description:
  PURPOSE:
      This test will check your system's $product CD writing capabilities. This test requires a blank CD-R or CD+R.
  STEPS:
      Skip this test if you do not have a blank CD disk.
      1. Insert a blank CD-R or CD+R into your drive
      2. Click "Test" to begin.
      3. When the CD tray ejects the media after burning, close it (DO NOT remove the disk, it is needed for the second portion of the test). Note, you must close the drive within 5 minutes or the test will time out.
  VERIFICATION:
      This test should automatically select "Yes" if it passes, "No" if it fails.
 EOF

plugin: local
name: optical/cdrom-write-automated
requires:
 device.category == 'CDROM'
 optical_drive.cd == 'writable'
description: Automated CD write test
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: shell
 name: optical/cdrom-write-automated_`ls /sys$path/block`
 requires: device.path == "$path"
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` | ansi_parser
 description:
  This is an automated version of optical/cdrom-write. It assumes you have already inserted a data CD into your optical drive prior to running Checkbox.
 EOF

plugin: manual
name: optical/cdrom-audio-playback
depends: optical/read
description:
 PURPOSE:
     This test will check your CD audio playback capabilities
 STEPS:
     1. Insert an audio CD in your optical drive
     2. When prompted, launch the Music Player
     3. Locate the CD in the display of the Music Player
     4. Select the CD in the Music Player
     5. Click the Play button to listen to the music on the CD
     6. Stop playing after some time
     7. Right click on the CD icon and select "Eject Disc"
     8. The CD should be ejected
     9. Close the Music Player
 VERIFICATION:
     Did all the steps work?

plugin: local
name: optical/dvd-write
requires:
 device.category == 'CDROM'
 optical_drive.dvd == 'writable'
description: DVD write test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: user-interact-verify
 name: optical/dvd-write_`ls /sys$path/block`
 requires: device.path == "$path"
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` | ansi_parser
 description:
  PURPOSE:
      This test will check your system's $product writing capabilities. This test requires a blank DVD-R or DVD+R.
  STEPS:
      Skip this test if you do not have a blank DVD disk.
      1. Enter a blank DVD-R or DVD+R into your drive
      2. Click "Test" to begin.
      3. When the CD tray ejects the media after burning, close it (DO NOT remove the disk, it is needed for the second portion of the test). Note, you must close the drive within 5 minutes or the test will time out.
  VERIFICATION:
      This test should automatically select "Yes" if it passes, "No" if it fails.
 EOF

plugin: local
name: optical/dvd-write-automated
requires:
 device.category == 'CDROM'
 optical_drive.dvd == 'writable'
description: Automated DVD write test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: shell
 name: optical/dvd-write-automated_`ls /sys$path/block`
 requires: device.path == "$path"
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` | ansi_parser
 description:
  This is an automated version of optical/dvd-write. It assumes you have already inserted a data DVD into your optical drive prior to running Checkbox.
 EOF

plugin: user-interact-verify
name: optical/dvd_playback
command: totem /media/cdrom
requires:
 device.category == 'CDROM'
 package.name == 'totem'
description:
 PURPOSE:
     This test will check your DVD  playback capabilities
 STEPS:
     1. Insert a DVD that contains any movie in your optical drive
     2. Click "Test" to play the DVD in Totem
 VERIFICATION:
     Did the file play?
