plugin: manual
name: power-management/shutdown-boot
description:
 PURPOSE:
     This test will check your system shutdown/booting cycle.
 STEPS:
     1. Shutdown your machine.
     2. Boot your machine.
     3. Repeat steps 1 and 2 at least 5 times.
 VERIFICATION:
     Did the system shutdown and rebooted correctly?

plugin: shell
name: power-management/fwts_wakealarm
environ: CHECKBOX_DATA
user: root
description: Test ACPI Wakealarm (fwts wakealarm)
description-bs.UTF-8: Test ACPI alarma (fwts alarma)
description-de.UTF-8: ACPI-Aufwach-Signal testen (»fwts wakealarm«)
description-el.utf-8: Έλεγχος του ξυπνητηριού ACPI (fwts wakealarm)
description-en_AU.UTF-8: Test ACPI Wakealarm (fwts wakealarm)
description-en_GB.UTF-8: Test ACPI Wakealarm (fwts wakealarm)
description-es.UTF-8: Prueba de ACPI Wakealarm (fwts wakealarm)
description-fr.UTF-8: Test ACPI Wakealarm (fwts wakealarm)
description-gd.UTF-8: Test ACPI Wakealarm (fwts wakealarm)
description-gl.UTF-8: Proba ACPI Wakealarm (fwts wakealarm)
description-hu.UTF-8: Az ACPI ébresztőóra (fwts wakealarm) ellenőrzése
description-it.UTF-8: Esegue il test ACPI Wakealarm (fwts wakealarm).
description-ms.UTF-8: Ujia Penggera Bangun ACPI (fwts wakealarm)
description-nl.UTF-8: ACPI Wakealarm testen (fwts wakealarm)
description-pt_BR.UTF-8: Testa despertador ACPI (despertador fwts)
description-ru.UTF-8: Проверка пробуждения ACPI (fwts wakealarm)
description-sl.UTF-8: Preizkus budilke ACPI (budilka fwts)
description-ug.UTF-8: ACPI Wakealarm (fwts wakealarm) سىناش
requires:
 package.name == 'fwts'
command: fwts_test -f aborted -w -l $CHECKBOX_DATA/fwts-wakealarm.log

plugin: attachment
name: power-management/fwts_wakealarm-log-attach
depends: power-management/fwts_wakealarm
description: Attach log from fwts wakealarm test
description-bs.UTF-8: Dodati zapisnik iz fwts alarm testa
description-de.UTF-8: Dem Bericht das Protokoll des »fwts wakealarm«-Tests als Anlage beilegen.
description-el.utf-8: Επισύναψη αρχείου καταγραφής από τη δοκιμή fwts wakealarm
description-en_AU.UTF-8: Attach log from fwts wakealarm test
description-en_GB.UTF-8: Attach log from fwts wakealarm test
description-es.UTF-8: Adjunta registros de la prueba de fwts wakealarm
description-fr.UTF-8: Joindre le journal du test fwts wakealarm
description-gd.UTF-8: Attach log from fwts wakealarm test
description-gl.UTF-8: Anexar o rexistro da proba fwts wakealarm
description-hu.UTF-8: A firmware tesztcsomag (fwts) ébresztőteszt naplójának csatolása
description-it.UTF-8: Allega il registro del test fwts wakealarm.
description-ms.UTF-8: Lampirkan log dari ujian fwts wakealarm
description-nl.UTF-8: Log van fwts wakealarm-test bijvoegen
description-pt_BR.UTF-8: Anexa o relatório do teste do despertador fwts
description-ru.UTF-8: Прикрепить отчёт из теста fwts wakealarm
description-sl.UTF-8: Priloži dnevnik iz preizkusa budilke fwts
requires:
 package.name == 'fwts'
command: [ -e ${CHECKBOX_DATA}/fwts-wakealarm.log ] && cat ${CHECKBOX_DATA}/fwts-wakealarm.log

plugin: manual
name: power-management/poweroff
depends: power-management/fwts_wakealarm
user: root
environ: CHECKBOX_DATA
requires:
 package.name == 'upstart'
 package.name == 'fwts'
command: pm_test poweroff --log-level=debug --log-dir=$CHECKBOX_DATA
description:
 PURPOSE:
  This test will check the system's ability to power-off and boot.
 STEPS:
  1. Select "Test" to begin.
  2. The machine will shut down.
  3. Power the machine back on.
  4. After rebooting, wait for the test prompts to inform you that the test is complete.
  5. Once the test has completed, restart checkbox and select 'Re-run' when prompted.
 VERIFICATION:
  If the machine successfully shuts down and boots, select 'Yes', otherwise,
  select 'No'. 

plugin: attachment
name: power-management/poweroff-log-attach
command: tar cvfz power-management_poweroff.tgz $CHECKBOX_DATA/*poweroff.1.log && cat $CHECKBOX_DATA/power-management_poweroff.tgz
description:
 This will attach any logs from the power-management/poweroff test to the results.

plugin: manual
name: power-management/reboot
user: root
environ: CHECKBOX_DATA
requires:
 package.name == 'upstart'
 package.name == 'fwts'
command: pm_test reboot --log-level=debug --log-dir=$CHECKBOX_DATA
description:
 PURPOSE:
  This test will check the system's ability to reboot cleanly.
 STEPS:
  1. Select "Test" to begin.
  2. The machine will reboot.
  3. After rebooting, wait for the test prompts to inform you that the test is complete.
  4. Once the test has completed, restart checkbox and select Re-Run when prompted.
 VERIFICATION:
  If the machine successfully reboots, select Yes then select Next.

plugin: attachment
name: power-management/reboot-log-attach
command: tar cvfz power-management_reboot.tgz $CHECKBOX_DATA/*reboot.1.log && cat $CHECKBOX_DATA/power-management_reboot.tgz
description:
 This will attach any logs from the power-management/reboot test to the results.

plugin: manual
name: power-management/lid
description:
 PURPOSE:
     This test will check your lid sensors.
 STEPS:
     1. Close your laptop lid.
 VERIFICATION:
    Does closing your laptop lid cause your system to suspend?

plugin: user-interact
name: power-management/lid_close
requires: device.product == 'Lid Switch'
command:
 for i in `seq 20`; do
  state=`cat /proc/acpi/button/lid/*/state | awk '{print $2}'`
  [ "$state" = "closed" ] && exit 0 || sleep 0.5
 done
 exit 1
description:
 PURPOSE:
     This test will check your lid sensors
 STEPS:
     1. Click "Test".
     2. Close and open the lid.
 VERIFICATION:
     Did the screen turn off while the lid was closed?

plugin: user-interact
name: power-management/lid_open
requires: device.product == 'Lid Switch'
command:
 for i in `seq 20`; do
  state=`cat /proc/acpi/button/lid/*/state | awk '{print $2}'`
  [ "$state" = "open" ] && exit 0 || sleep 0.5
 done
 exit 1
description:
 PURPOSE:
     This test will check your lid sensors.
 STEPS:
     1. Click "Test".
     2. Close the lid.
     3. Wait 5 seconds with the lid closed.
     4. Open the lid.
 VERIFICATION:
     Did the system resume when the lid was opened?

plugin: shell
name: power-management/rtc
command:
 test -e /dev/rtc || ( echo "ERROR: Real Time Clock not found" >&2 && exit 1 )
estimated_duration: 0.02
description:
 Make sure that the RTC (Real-Time Clock) device exists.

plugin: shell
name: power-management/tickless_idle
description: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check)
description-ast.UTF-8: Conseñar pa ver si CONFIG_NO_HZ afitóse nel nucleu (esto ye sólo una simple comprobación de regresión)
description-bn.UTF-8: CONFIG_NO_HZ তে kernel নির্ধারিত হয়েছে কিনা তা দেখার জন্য পরীক্ষা করুন (এটি শুধুমাত্র একটি সাধারণ নিবন্ধনের পরীক্ষা)
description-bs.UTF-8: Provjera da se vidi da li je CONFIG_NO_HZ postavljen u kernel (to je samo prosti test regresije)
description-cs.UTF-8: Ověřit, zda má kernel volbu CONFIG_NO_HZ (jednoduché ověření)
description-de.UTF-8: Überprüfen, ob »CONFIG_NO_HZ« im Kernel gesetzt ist (Dies ist nur ein einfacher Regressionstest).
description-el.utf-8: Έλεγχος για το αν το CONFIG_NO_HZ έχει ρυθμιστεί στον πυρήνα (Αυτός είναι ένας απλός έλεγχος παλινδρόμησης)
description-en_AU.UTF-8: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check)
description-en_GB.UTF-8: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check)
description-es.UTF-8: Marcar para ver si CONFIG_NO_HZ se ha establecido en el núcleo (esto es solo una simple comprobación de regresión)
description-fr.UTF-8: Vérifier si CONFIG_NO_HZ est paramétré dans le noyau (c'est juste un simple contrôle de régression)
description-gd.UTF-8: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check)
description-gl.UTF-8: Comprobar se  CONFIG_NO_HZ está estabelecido no kernel (é unha simple comprobación de regresión)
description-hu.UTF-8: A CONFIG_NO_HZ beállítás ellenőrzése a kernelben (ez egy egyszerű regresszióteszt)
description-it.UTF-8: Verifica se CONFIG_NO_HZ è impostato nel kernel (questa è solo una semplice verifica di regressione).
description-km.UTF-8: ពិនិត្យមើល​ថា​តើ CONFIG_NO_HZ ត្រូវ​បាន​កំណត់​នៅ​ក្នុង​ខឺណែល​ដែរ​ឬទេ (នេះ​គ្រាន់តែ​ជា​ការ​ពិនិត្យមើល​ការ​ដើរ​ថយក្រោយ​ធម្មតា​ប៉ុណ្ណោះ)
description-ms.UTF-8: Tanda untuk melihat jika CONFIG_NO_HZ ditetapkan dalam kernel (ini merupakan semakan regresi ringkas)
description-nl.UTF-8: Controleer of CONFIG_NO_HZ ingesteld is in de kernel (dit is een simpele regressietest)
description-pt_BR.UTF-8: Verifique para ver se CONFIG_NO_HZ está configurado no kernel (isto é apenas um simples teste de regressão)
description-ro.UTF-8: Verifică dacă în kernel este configurată opțiunea CONFIG_NO_HZ (o simplă verificare pentru regresie)
description-ru.UTF-8: Проверьте установлена ли в ядре директива CONFIG_NO_HZ (это простой тест на регрессию)
description-sl.UTF-8: Preveri, če je CONFIG_NO_HZ nastavljen v jedru (to je enostavno preverjanje regresij)
description-tr.UTF-8: CONFIG_NO_HZ'nin çekirdekte ayarlı olup olmadığını görmek için denetleme yapın (bu sadece basit bir gerileme denetlemesidir).
description-ug.UTF-8: يادرودا CONFIG_NO_HZ بەلگىلەنگەنمۇ يوق تەكشۈرىدۇ(بۇ پەقەتلا ئاددىي بىر قايتىلانما تەكشۈرۈشتۇر(regression check))
description-zh_CN.UTF-8: 查看内核中是否设置了 CONFIG_NO_HZ(这只是一个简单回归检查)
command:
 zgrep 'CONFIG_NO_HZ=y' /boot/config-`uname -r` >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 )

plugin: manual
name: power-management/unplug_ac
description:
 PURPOSE:
     This test will ensure that the AC is unplugged for the battery drain tests to run.
 STEPS:
     1. Unplug laptop from AC.
 VERIFICATION:
     Was the laptop unplugged from AC?

plugin: shell
name: power-management/battery_drain_idle
requires: package.name == 'upower'
depends: power-management/unplug_ac
description: Checks the battery drain during idle.  Reports time until empty
 and capacity as well.
command:
 battery_test -t 90 --idle

plugin: shell
name: power-management/battery_drain_movie
requires:
 package.name == 'upower'
depends: power-management/unplug_ac
description: Checks the battery drain while watching a movie.  Reports time
 until empty and capacity as well.  Requires MOVIE_VAR to be set.
command:
 battery_test -t 90 --movie $MOVIE_VAR

plugin: shell
name: power-management/battery_drain_sleep
user: root
requires: 
 package.name == 'upower' 
 package.name == 'fwts'
depends: power-management/unplug_ac
description: Checks the battery drain during suspend.  Reports time until
 empty and capacity as well.
command:
 battery_test -t 120 --sleep

plugin: manual
name: power-management/plug_ac
depends: power-management/battery_drain_idle power-management/battery_drain_movie power-management/battery_drain_sleep
description:
 PURPOSE:
     This test will ensure that the AC is plugged back in after the battery.
     tests
 STEPS:
     1. Plug laptop into AC.
 VERIFICATION:
     Was the laptop plugged into AC?

plugin: manual
name: power-management/reboot_manual
user:root
command: shutdown -r now
description:
 PURPOSE:
     This test will verify that your system can successfully reboot.
 STEPS:
     1. Select 'Test' to initiate a system reboot.
     2. When the grub boot menu is displayed, boot into Ubuntu (Or allow the
     system to automatically boot on its own).
     3. Once the system has restarted, log in and restart checkbox-certification-server.
     4. Select 'Re-Run' to return to this test.
     5. Select 'Yes' to indicate the test has passed if the system rebooted
     successfully, otherwise, select 'No' to indicate there was a problem.
 VERIFICATION:
     Did the system reboot correctly?

plugin: manual
name: power-management/shutdown_manual
user: root
command: shutdown -h now
description:
 PURPOSE:
     This test will check your system shutdown/booting cycle
 STEPS:
     1. Select 'Test' to initiate a system shutdown.
     2. Power the system back on.
     3. From the grub menu, boot into the Xen Hypervisor.
     4. When the system has restarted, log in and restart checkbox-certification-server.
     5. Select 'Re-Run' to return to this test.
     6. Select 'Yes' to indicate the test has passed if the machine shut down
     successfully otherwise, Select 'No' to indicate there was a problem.
 VERIFICATION:
     Did the system shutdown and boot correctly?
