plugin: shell
name: stress/cpu_stress_test
requires:
 package.name == 'linux'
 package.name == 'stress'
user: root
command: stress --cpu `cpuinfo_resource | awk '/count:/ {print $2}'` --vm `awk '/MemTotal/ {num_vm = $2/262144; if (num_vm != int(num_vm)) num_vm = int(num_vm) + 1; print num_vm}' /proc/meminfo` --timeout 7200
description:
 PURPOSE:
     Create jobs that use the CPU as much as possible for two hours. The test is considered passed if the system does not freeze.

plugin: shell
name: power-management/hibernate_30_cycles
depends: power-management/rtc
requires: package.name == 'fwts'
user: root
command: fwts s4 --s4-device-check --s4-device-check-delay=30 --s4-sleep-delay=120 --s4-multiple=30 -r $CHECKBOX_DATA/hibernate_30_cycles.log
description:
 PURPOSE:
    This is an automated stress test that will force the system to hibernate/resume for 30 cycles

plugin: attachment
name: power-management/hibernate-30-cycle-log-attach
command: [ -e $CHECKBOX_DATA/hibernate_30_cycles.log ] && cat $CHECKBOX_DATA/hibernate_30_cycles.log
description:
 Attaches the log from the 30 cycle Hibernate/Resume test if it exists

plugin: shell
name: power-management/suspend_30_cycles
depends: power-management/rtc
requires: package.name == 'fwts'
user: root
command: fwts s3 --s3-device-check --s3-device-check-delay=30 --s3-sleep-delay=30 --s3-multiple=30 -r $CHECKBOX_DATA/suspend_30_cycles.log
description:
 PURPOSE:
    This is an automated stress test that will force the system to suspend/resume for 30 cycles.

plugin: attachment
name: power-management/suspend-30-cycle-log-attach
command: [ -e $CHECKBOX_DATA/suspend_30_cycles.log ] && cat $CHECKBOX_DATA/suspend_30_cycles.log
description:
 Attaches the log from the 30 cycle Suspend/Resume test if it exists

plugin: shell
name: stress/hibernate_250_cycles
depends: power-management/rtc
requires: package.name == 'fwts'
user: root
command: fwts s4 --s4-device-check --s4-device-check-delay=30 --s4-sleep-delay=120 --s4-multiple=250 -r $CHECKBOX_DATA/hibernate_250_cycles.log
description:
 PURPOSE:
    This is an automated stress test that will force the system to hibernate/resume for 250 cycles

plugin: attachment
name: stress/hibernate-250-cycle-log-attach
command: [ -e $CHECKBOX_DATA/hibernate_250_cycles.log ] && cat $CHECKBOX_DATA/hibernate_250_cycles.log
description:
 Attaches the log from the 250 cycle Hibernate/Resume test if it exists

plugin: shell
name: stress/suspend_250_cycles
depends: power-management/rtc
requires: package.name == 'fwts'
user: root
command: fwts s3 --s3-device-check --s3-device-check-delay=30 --s3-sleep-delay=30 --s3-multiple=250 -r $CHECKBOX_DATA/suspend_250_cycles.log
description:
 PURPOSE:
    This is an automated stress test that will force the system to suspend/resume for 250 cycles.

plugin: attachment
name: stress/suspend-250-cycle-log-attach
command: [ -e $CHECKBOX_DATA/suspend_250_cycles.log ] && cat $CHECKBOX_DATA/suspend_250_cycles.log
description:
 Attaches the log from the 250 cycle Suspend/Resume test if it exists

plugin: shell
name: stress/reboot
requires:
 package.name == 'upstart'
 package.name == 'fwts'
command: pm_test -r 100 --silent --log-level=notset reboot
user: root
description:
 Stress reboot system (100 cycles)

plugin: attachment
name: stress/reboot_log
depends: stress/reboot
command: tar cvfz stress_reboot.tgz $CHECKBOX_DATA/*reboot.100.log && cat $CHECKBOX_DATA/stress_reboot.tgz

plugin: shell
name: stress/poweroff
requires:
 package.name == 'upstart'
 package.name == 'fwts'
command: pm_test -r 100 --silent --log-level=notset poweroff
user: root
description:
 Stress poweroff system (100 cycles)

plugin: attachment
name: stress/poweroff_log
depends: stress/poweroff
command: tar cvfz stress_poweroff.tgz $CHECKBOX_DATA/*poweroff.100.log && cat $CHECKBOX_DATA/stress_poweroff.tgz

plugin: shell
name: stress/reboot_check
depends: stress/reboot
command: pm_log_check --log-level=notset $CHECKBOX_DATA/*reboot.100.log $CHECKBOX_DATA/pm_log_check_reboot.100.log
description: Check logs for the stress reboot (100 cycles) test case
description-en_GB.UTF-8: Check logs for the stress reboot (100 cycles) test case
description-es.UTF-8: Comprobar los registros para el caso de prueba del estrés de reinicio (100 ciclos)
description-fr.UTF-8: Vérifier les journaux du test de résistance du redémarrage (100 cycles)
description-ms.UTF-8: Semak log untuk kes ujian stress but semula (100 kitaran)
description-pt_BR.UTF-8: Verificar relatórios para o caso de teste de estresse de reinicialização (100 ciclos)

plugin: attachment
name: stress/reboot_check_log
depends: stress/reboot_check
command:
 tar cvfz stress_reboot_check.tgz $CHECKBOX_DATA/pm_log_check_reboot.100.log && cat $CHECKBOX_DATA/stress_reboot_check.tgz

plugin: shell
name: stress/poweroff_check
depends: stress/poweroff
command: pm_log_check --log-level=notset $CHECKBOX_DATA/*poweroff.100.log $CHECKBOX_DATA/pm_log_check_poweroff.100.log
description: Check logs for the stress poweroff (100 cycles) test case
description-en_GB.UTF-8: Check logs for the stress poweroff (100 cycles) test case
description-es.UTF-8: Comprobar los registros para el caso de prueba del estrés de apagado (100 ciclos)
description-fr.UTF-8: Vérifier les journaux du test de résistance d'extinction (100 cycles)
description-ms.UTF-8: Semak log untuk kes ujian stress matikan (100 kitaran)
description-pt_BR.UTF-8: Verificar relatórios para o caso de teste de estresse de desligamento  (100 ciclos)

plugin: attachment
name: stress/poweroff_check_log
depends: stress/poweroff_check
command:
 tar cvfz stress_poweroff_check.tgz $CHECKBOX_DATA/pm_log_check_poweroff.100.log && cat $CHECKBOX_DATA/stress_poweroff_check.tgz
