Skip to content

Commit e8dca79

Browse files
revised the watchdog test jobs
revised the watchdog test jobs to support those system not enable watchdog by default
1 parent 7b6dd5b commit e8dca79

File tree

2 files changed

+49
-27
lines changed

2 files changed

+49
-27
lines changed
Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
id: watchdog/detect
22
category_id: com.canonical.plainbox::power-management
3-
_summary: Detect the presence of a Hardware Watchdog
4-
flags: simple
5-
imports: from com.canonical.plainbox import manifest
6-
requires: manifest.has_hardware_watchdog == 'True'
7-
command: udev_resource.py -f WATCHDOG
8-
9-
id: watchdog/systemd-config
10-
_summary: Check if the hardware watchdog is properly configured
11-
template-engine: jinja2
12-
command: watchdog_config_test.py
13-
category_id: com.canonical.plainbox::power-management
3+
_summary: Detect presence of a Hardware Watchdog
4+
_description:
5+
Detect the watchdog is under the /sys/class/watchdog/ path and no other type of watchdog
6+
user: root
147
flags: simple
158
imports: from com.canonical.plainbox import manifest
16-
requires: manifest.has_hardware_watchdog == 'True'
9+
requires:
10+
manifest.has_hardware_watchdog == 'True'
11+
environ: WATCHDOG_TYPE WATCHDOG_IDENTITY
12+
command:
13+
watchdog_test.py detect --module "$WATCHDOG_TYPE" --identity "$WATCHDOG_IDENTITY"
1714

1815
id: watchdog/trigger-system-reset-auto
19-
depends: watchdog/systemd-config
20-
_summary: Test that the watchdog module can trigger a system reset
21-
command:
22-
sync
23-
sleep 5
24-
echo 1 > /proc/sys/kernel/sysrq
25-
echo 0 > /proc/sys/kernel/panic
26-
echo c > /proc/sysrq-trigger
27-
flags: preserve-locale noreturn autorestart
2816
user: root
2917
plugin: shell
3018
category_id: com.canonical.plainbox::power-management
19+
_summary: Test that the watchdog module can trigger a system reset
20+
flags: noreturn autorestart
3121
estimated_duration: 60
32-
_purpose: Ensure that the watchdog module can successfully initiate a system reset.
22+
depends:
23+
watchdog/check-service
24+
watchdog/detect
25+
environ: WATCHDOG_TYPE WATCHDOG_IDENTITY WATCHDOG_TIMEOUT
26+
command:
27+
watchdog_test.py trigger-reset --module "$WATCHDOG_TYPE" --identity "$WATCHDOG_IDENTITY" --log-dir "$PLAINBOX_SESSION_SHARE" --timeout "$WATCHDOG_TIMEOUT"
3328

3429
id: watchdog/post-trigger-system-reset-auto
3530
after: watchdog/trigger-system-reset-auto
@@ -39,7 +34,33 @@ _purpose: Check there are no failed services after the watchdog triggered
3934
unit: job
4035
user: root
4136
plugin: shell
42-
command: failed_service_check.sh
4337
estimated_duration: 1.0
4438
imports: from com.canonical.plainbox import manifest
4539
requires: manifest.has_hardware_watchdog == 'True'
40+
depends:
41+
watchdog/trigger-system-reset-auto
42+
environ: COLD_REBOOT_DELAY
43+
command: watchdog_test.py post-check --log-dir "$PLAINBOX_SESSION_SHARE" && failed_service_check.sh
44+
45+
id: watchdog/check-timeout
46+
category_id: com.canonical.plainbox::power-management
47+
_summary: Check the timeout of Hardware Watchdog
48+
_description:
49+
Check the value of RuntimeWatchdogUSec that shouldn't be 0
50+
flags: simple
51+
imports: from com.canonical.plainbox import manifest
52+
requires:
53+
manifest.has_hardware_watchdog == 'True'
54+
command: watchdog_config_test.py --check-time
55+
56+
id: watchdog/check-service
57+
category_id: com.canonical.plainbox::power-management
58+
_summary: Check the watchdog.service is enabled or not
59+
_description:
60+
Check the state of the watchdog.service. It must be disabled/missing
61+
on both classic and core images since 20.04. Else it must be enabled.
62+
flags: simple
63+
imports: from com.canonical.plainbox import manifest
64+
requires:
65+
manifest.has_hardware_watchdog == 'True'
66+
command: watchdog_config_test.py --check-service
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id: watchdog-full
22
unit: test plan
33
_name: Watchdog tests
4-
_description: Watchdog tests for Ubuntu Core devices
4+
_description: Watchdog tests
55
include:
66
nested_part:
77
watchdog-manual
@@ -10,15 +10,16 @@ nested_part:
1010
id: watchdog-manual
1111
unit: test plan
1212
_name: Manual watchdog tests
13-
_description: Manual watchdog tests for Ubuntu Core devices
13+
_description: Manual watchdog tests
1414
include:
1515

1616
id: watchdog-automated
1717
unit: test plan
1818
_name: Automated watchdog tests
19-
_description: Automated watchdog tests for Ubuntu Core devices
19+
_description: Automated watchdog tests
2020
include:
21+
watchdog/check-timeout
22+
watchdog/check-service
2123
watchdog/detect
22-
watchdog/systemd-config
2324
watchdog/trigger-system-reset-auto
2425
watchdog/post-trigger-system-reset-auto

0 commit comments

Comments
 (0)