plugin: shell
name: disk/detect
command: udev_resource | filter_templates -w "category=DISK" | awk -F': ' '$1 == "product" { print $2 }'
_description: Detects and displays disks attached to the system.

plugin: local
name: disk/stats
requires: device.category == 'DISK'
_description: Check stats changes for each disk
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=DISK"'
 plugin: shell
 name: disk/stats_`ls /sys$path/block`
 requires: 
  device.path == "$path"
  block_device.`ls /sys$path/block`_state != 'removable'
 user: root
 command: disk_stats_test `ls /sys$path/block | sed 's|!|/|'`
 description: This test checks disk stats, generates some activity and rechecks stats to verify they've changed. It also verifies that disks appear in the various files they're supposed to.
 EOF

plugin: local
name: disk/smart
requires:
 package.name == 'smartmontools'
 device.category == 'DISK'
_description: SMART test
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=DISK"'
 plugin: shell
 name: disk/smart_`ls /sys$path/block`
 requires: 
  device.path == "$path"
  block_device.`ls /sys$path/block`_state != 'removable'
 description:
  This tests the SMART capabilities for $product (Note that this test will not work against hardware RAID)
 user: root
 command: disk_smart -b /dev/`ls /sys$path/block | sed 's|!|/|'` -s 130 -t 270
 EOF

plugin: local
name: disk/read_performance
requires:
 device.category == 'DISK'
_description: Verify system storage performs at or above baseline performance
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=DISK"'
 plugin: shell
 name: disk/read_performance_`ls /sys$path/block`
 requires:
  device.path == "$path"
  block_device.`ls /sys$path/block`_state != 'removable'
 description: Disk performance test for $product
 user: root
 command: disk_read_performance_test `ls /sys$path/block | sed 's|!|/|'`
 EOF

plugin: local
name: disk/storage_devices
requires:
 device.category == 'DISK'
_description: Verify that storage devices, such as Fibre Channel and RAID can be detected and perform under stress.
command:
 cat <<'EOF' | run_templates -t -s 'udev_resource | filter_templates -w "category=DISK"'
 plugin: shell
 name: disk/storage_device_`ls /sys$path/block`
 user: root
 requires:
  device.path == "$path"
  block_device.`ls /sys$path/block`_state != 'removable'
 description: Disk I/O stress test for $product
 command: storage_test `ls /sys$path/block | sed 's|!|/|'`
 EOF

plugin: shell
name: disk/spindown
requires: 
 device.category == 'DISK'
 package.name == 'smartmontools'
user: root
command: spindown
_description:
 Some new hard drives include a feature that parks the drive heads after a short period of inactivity. This is a power-saving feature, but it can have a bad interaction with the operating system that results in the drive constantly parked then activated. This produces excess wear on the drive, potentially leading to early failures.

plugin: user-interact
name: disk/hdd-parking
requires: device.category == 'DISK'
depends: input/accelerometer
user: root
command: hdd_parking
_description:
 PURPOSE:
  This test checks that a systems drive protection mechanism works properly.
 STEPS:
  1. Click on Test
  2. Move the system under test around, ensuring it is raised and lowered at some point.
 VERIFICATION:
  The verification of this test is automated. Do not change the
  automatically selected result.

