diff options
-rw-r--r-- | units/watchdog/jobs.pxu | 67 | ||||
-rw-r--r-- | units/watchdog/test-plan.pxu | 27 |
2 files changed, 94 insertions, 0 deletions
diff --git a/units/watchdog/jobs.pxu b/units/watchdog/jobs.pxu new file mode 100644 index 00000000..f42a4f53 --- /dev/null +++ b/units/watchdog/jobs.pxu @@ -0,0 +1,67 @@ +id: watchdog/systemd-config +_summary: Check if the hardware watchdog is properly configured +template-engine: jinja2 +command: + inbuilt=$(systemctl show -p RuntimeWatchdogUSec | awk -F= '{print $2}') + external=$(systemctl is-active watchdog.service) + {%- if __on_ubuntucore__ %} + if [ "$inbuilt" == "0" ]; then + echo "systemd watchdog should be enabled but reset timeout: $inbuilt" + exit 1 + fi + if [ "$external" == "active" ]; then + echo "found unexpected active watchdog.service unit" + exit 1 + fi + echo "systemd watchdog enabled, reset timeout: $inbuilt" + echo "watchdog.service is not active" + {%- else %} + if [ "$inbuilt" != "0" ]; then + echo "systemd watchdog should not be enabled but reset timeout: $inbuilt" + exit 1 + fi + if [ "$external" != "active" ]; then + echo "watchdog.service unit does not report as active" + exit 1 + fi + echo "systemd watchdog disabled" + echo "watchdog.service active" + {% endif -%} +category_id: power +flags: simple + +id: watchdog/trigger-system-reset +depends: watchdog/systemd-config +_summary: Test that the watchdog module can trigger a system reset +_purpose: + The watchdog module should be capable of issuing a hard reset of the SUT. +_steps: + 1. Commence the test to trigger a SysRq. + 2. Once the watchdog timeout has expired (10s) the SUT should reset itself. + 3. The board will reboot and the user should resume the test session. +_verification: + Did the board reset itself? +command: + echo 1 > /proc/sys/kernel/sysrq + echo 0 > /proc/sys/kernel/panic + echo c > /proc/sysrq-trigger +flags: noreturn preserve-locale +user: root +plugin: user-interact-verify +category_id: power +estimated_duration: 60 + +id: watchdog/trigger-system-reset-auto +depends: watchdog/systemd-config +_summary: Test that the watchdog module can trigger a system reset +command: + sync + sleep 5 + echo 1 > /proc/sys/kernel/sysrq + echo 0 > /proc/sys/kernel/panic + echo c > /proc/sysrq-trigger +flags: preserve-locale noreturn autorestart +user: root +plugin: shell +category_id: power +estimated_duration: 60 diff --git a/units/watchdog/test-plan.pxu b/units/watchdog/test-plan.pxu new file mode 100644 index 00000000..407a2734 --- /dev/null +++ b/units/watchdog/test-plan.pxu @@ -0,0 +1,27 @@ +id: watchdog-full +unit: test plan +_name: Watchdog tests +_description: + QA test plan that includes watchdog tests +estimated_duration: 1m +include: +nested_part: + watchdog-manual + +id: watchdog-manual +unit: test plan +_name: Manual watchdog tests +_description: Manual watchdog tests for Snappy Ubuntu Core devices +include: + watchdog/systemd-config + watchdog/trigger-system-reset + +id: watchdog-automated +unit: test plan +_name: Automated watchdog tests +_description: + QA test plan that includes automated watchdog tests +estimated_duration: 1s +include: + watchdog/systemd-config + watchdog/trigger-system-reset-auto |