plugin: user-interact-verify
name: power-management/hibernate_advanced
requires:
  sleep.disk == 'supported'
  rtc.state == 'supported'
environ: CHECKBOX_DATA
user: root
command:
 if type -P fwts >/dev/null; then
  echo "Calling fwts"
  fwts_test -l $CHECKBOX_DATA/hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120
 else
  echo "Calling sleep_test"
  sleep_test -s disk -w 120
 fi
estimated_duration: 300.00
_description:
 PURPOSE:
     This test will check to make sure your system can successfully hibernate (if supported)
 STEPS:
     1. Click on Test
     2. The system will hibernate and should wake itself within 5 minutes
     3. If your system does not wake itself after 5 minutes, please press the power button to wake the system manually
     4. If the system fails to resume from hibernate, please restart System Testing and mark this test as Failed
 VERIFICATION:
     Did the system successfully hibernate and did it work properly after waking up?

plugin: shell
name: power-management/hibernate-single-log-check
command: [ -e $CHECKBOX_DATA/hibernate-single.log ] && sleep_test_log_check -v s4 $CHECKBOX_DATA/hibernate-single.log
_description:
 Automated check of the hibernate log for errors discovered by fwts

plugin: attachment
name: power-management/hibernate-single-log-attach
command: [ -e $CHECKBOX_DATA/hibernate-single.log ] && cat $CHECKBOX_DATA/hibernate-single.log
estimated_duration: 0.5
description: attaches log from single hibernate/resume test to results
