1
1
id: watchdog/detect
2
2
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
14
7
flags: simple
15
8
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"
17
14
18
15
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
28
16
user: root
29
17
plugin: shell
30
18
category_id: com.canonical.plainbox::power-management
19
+ _summary: Test that the watchdog module can trigger a system reset
20
+ flags: noreturn autorestart
31
21
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"
33
28
34
29
id: watchdog/post-trigger-system-reset-auto
35
30
after: watchdog/trigger-system-reset-auto
@@ -39,7 +34,33 @@ _purpose: Check there are no failed services after the watchdog triggered
39
34
unit: job
40
35
user: root
41
36
plugin: shell
42
- command: failed_service_check.sh
43
37
estimated_duration: 1.0
44
38
imports: from com.canonical.plainbox import manifest
45
39
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
0 commit comments