diff options
author | PMR <pmr@pmr-lander> | 2019-08-22 09:36:58 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2019-08-22 09:36:58 +0000 |
commit | 4e79129c7ab2e6663d986ba708f4afac538edb06 (patch) | |
tree | 51ef3744744e5cd4d1c31d5d6c7acfb3c0fc82a5 /units/watchdog | |
parent | 6e5921c2458a8f1f55e69027796c0bac59468ec2 (diff) | |
parent | 4c0073ac5615d11268a943cf21c1627ebf902547 (diff) |
Merge #371568 from ~jocave/plainbox-provider-checkbox:merge-provider-snappy
Diffstat (limited to 'units/watchdog')
-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..2b5b236c --- /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: com.canonical.plainbox::power-management +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: com.canonical.plainbox::power-management +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: com.canonical.plainbox::power-management +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 |