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'
_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"
  optical_drive_`ls /sys$path/block`.cd_write == 'supported'
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` cd | 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'
_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"
  optical_drive_`ls /sys$path/block`.cd_write == 'supported'
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` cd | 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'
_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"
  optical_drive_`ls /sys$path/block`.dvd_write == 'supported'
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` dvd | 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'
_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"
  optical_drive_`ls /sys$path/block`.dvd_write == 'supported'
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` dvd | 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?

plugin: local
name: optical/bluray-read
requires: device.category == 'CDROM'
_description: Automated Blu-Ray read test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: user-interact
 name: optical/bluray-read_`ls /sys$path/block`
 requires:
  device.path == "$path"
  optical_drive_`ls /sys$path/block`.bd_read == "supported"
 user: root
 command: optical_read_test /dev/`ls /sys$path/block`
 estimated_duration: 10.00
 description:
  PURPOSE:
   This test will check your $product device's ability to read Blu-Ray (BD) media
  STEPS:
   1. Insert appropriate non-blank media into your Blu-Ray drive. 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/bluray-write
requires: device.category == 'CDROM'
_description: Automated Blu-Ray write test.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=CDROM"'
 plugin: user-interact
 name: optical/bluray-write_`ls /sys$path/block`
 requires:
  device.path == "$path"
  optical_drive_`ls /sys$path/block`.bd_write == "supported"
  package.name == "growisofs"
 user: root
 command: set -o pipefail; optical_write_test /dev/`ls /sys$path/block` bd | ansi_parser
 estimated_duration: 120.00
 description:
  PURPOSE:
   This test will check your $product device's ability to write Blu-Ray (BD) media
  STEPS:
   Skip this test if you do not have a blank BD-R disc
   1. Insert appropriate writable media into your Blu-Ray drive.
   2. Click "Test" to begin the test.
  VERIFICATION:
   This test should automatically select "Yes" if it passes, "No" if it fails.
 EOF
