plugin: shell
name: network_before_suspend
depends: network_test
description: Test the network before suspending.
command: network_check -a

plugin: shell
name: resolution_before_suspend
description: Record the current resolution before suspending.
command: xrandr -q |grep '*'| awk '{print $1}' > $CHECKBOX_DATA/resolution_before_suspend.txt

plugin: shell
name: audio_before_suspend
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
description: Test the audio before suspending.
command: amixer > $CHECKBOX_DATA/audio_before_suspend.txt

plugin: manual
name: wireless_before_suspend
command: internet_test
description:
 Wireless network connection procedure:
  1.- Click on the Network Manager applet
  2.- Click on Disconnect under 'Wired Networks'
  3.- Select a network below the 'Wireless networks' section
  4.- Notify OSD should confirm that the connection has been established
  5.- Select Test to verify connection and throughput
 Output:
 .
 $output
 .
 Is this correct?

plugin: manual
name: bluetooth_detect_before_suspend
requires: package.name == 'bluez'
command: hcitool dev | tail -n+2 | awk '{print $2}'
description:
 The address of your Bluetooth device is:
 $output
 .
 Is this correct?

plugin: manual
name: bluetooth_mouse_before_suspend
depends: bluetooth_detect_before_suspend
description:
 Verify a bluetooth peripheral.  An example verification procedure for a bluetooth mouse is given.
 .
 Bluetooth mouse procedure:
  1.- Enable the bluetooth mouse
  2.- Click on the bluetooth icon in the menu bar
  3.- Select 'Setup new device'
  4.- Look for the device in the list and select it
  5.- Move the mouse around the screen
  6.- Perform some single/double/right click operations
 .
 Did all the steps work?

plugin: shell
name: rtc
requires: package.name == 'linux'
command:
 test -e /dev/rtc
description:
 Make sure that the RTC (Real-Time Clock) device exists.

plugin: manual
name: sleep_state_test
depends: rtc network_before_suspend resolution_before_suspend wireless_before_suspend bluetooth_detect_before_suspend bluetooth_mouse_before_suspend
requires: package.name == 'pm-utils'
description:
 Power management Suspend and Resume test
 .
 Select test and your system will suspend for about 30 - 60 seconds. If your system does not wake itself up after 60 seconds, please press the power button momentarily to wake the system manually. If your system fails to wake at all and must be rebooted, restart System Testing after reboot and mark this test as Failed.
user: root
command: sleep_test -d

plugin: shell
name: network_after_suspend
depends: sleep_state_test network_before_suspend
description: Test the network after resuming.
command: internet_test

plugin: shell
name: resolution_after_suspend
depends: sleep_state_test resolution_before_suspend
description: Test to see that we have the same resolution after resuming as before.
command: xrandr -q |grep '*'| awk '{print $1}' | diff $CHECKBOX_DATA/resolution_before_suspend.txt -

plugin: shell
name: audio_after_suspend
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
depends: sleep_state_test audio_before_suspend
description: Test the audio after resuming.
command: amixer | diff $CHECKBOX_DATA/audio_before_suspend.txt -

plugin: manual
name: wireless_after_suspend
depends: sleep_state_test wireless_before_suspend
command: internet_test
description:
 Wireless network connection procedure:
  1.- Click on the Network Manager applet
  2.- If a wired connection is established, click its Disconnect option
  3.- Select a network below the 'Wireless networks' section
  4.- Notify OSD should confirm that the connection has been established
  5.- Select Test to verify connection and throughput
 Output:
 .
 $output
 .
 Is this correct?

plugin: manual
name: bluetooth_detect_after_suspend
depends: sleep_state_test bluetooth_detect_before_suspend
requires: package.name == 'bluez'
command: hcitool dev | tail -n+2 | awk '{print $2}'
description:
 The address of your Bluetooth device is:
 $output
 .
 Is this correct?

plugin: manual
name: bluetooth_mouse_after_suspend
depends: sleep_state_test bluetooth_detect_after_suspend
description:
 Verify a bluetooth peripheral.  An example verification procedure for a bluetooth mouse is given.
 .
 Bluetooth mouse procedure:
  1.- Enable the bluetooth mouse
  2.- Click on the bluetooth icon in the menu bar
  3.- Select 'Setup new device'
  4.- Look for the device in the list and select it
  5.- Move the mouse around the screen
  6.- Perform some single/double/right click operations
 .
 Did all the steps work?

plugin: manual
name: cycle_resolutions_after_suspend
depends: sleep_state_test xrandr_cycle
description:
 This test will check to make sure that supported video modes work after a suspend and resume.  Select Test to begin.
command: xrandr_cycle

plugin: manual
name: record_playback_after_suspend
depends: sleep_state_test
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
command: alsa_record_playback
description:
 This will check to make sure that your audio device works properly after a suspend and resume.  You can use either internal or external microphone and speakers.
 .
 To execute this test, make sure your speaker and microphone are NOT muted and the volume is set sufficiently loud to record and play audio. Select Test and then speak into your microphone. After a few seconds, your speech will be played back to you.
 .
 Did you hear your speech played back?

plugin: manual
name: suspend_30_cycles
depends: rtc
requires: package.name == 'pm-utils'
user: root
command: sleep_test -i 30 -s mem --debug
description:
 Enter and resume from suspend state for 30 iterations. Please note that this is a lengthy test. Select Test to begin. If your system fails to wake and must be rebooted, please restart System Testing and mark this test as Failed.
 .
 Did the system successfully suspend and resume for 30 iterations?

plugin: manual
name: hibernate_once
depends: rtc
requires: package.name == 'pm-utils'
user: root
command: sleep_test -s disk -w 120 --debug
description:
 This will check to make sure your system can successfully hibernate (if supported).
 .
 Select Test to begin. The system will hibernate and should wake itself within 5 minutes.  If your system does not wake itself after 5 minutes, please press the power button to wake the system manually. If the system fails to resume from hibernate, please restart System Testing and mark this test as Failed.
 .
 Did the system successfully hibernate and did it work properly after waking up?

plugin: manual
name: hibernate_30_cycles
depends: rtc
requires: package.name == 'pm-utils'
user: root
command: sleep_test -i 30 -s disk -w 120 --debug
description:
 Enter and resume from hibernate for 30 iterations. Please note that this is a very lengthy test. Also, if your system does not wake itself after 2 minutes, you will need to press the power button to wake the system up. If the system fails to resume from hibernation and must be rebooted, please restart System Testing and mark this test as Failed.
 .
 Also, you will need to ensure your system has no power-on or HDD passwords set, and that grub is set to boot Ubuntu by default if you have a multi-boot set-up.
 .
 Did the system successfully hibernate and wake 30 times?
