Commit c7ab0a4
committed
test: sweep part 1 - rename EXAMPLE fixtures to scenario names and modernize run files
Convert 45 plugins from the legacy `EXAMPLE01..NN` fixture scheme and
the per-method `test_if_check_runs_EXAMPLE*` style to the declarative
`TESTS` list pattern driven by `lib.lftest.run()`, following the
conventions in CONTRIBUTING.md "Test data file naming" and
"Writing tests".
Highlights:
- Fixture files now describe the data shape (e.g. `all-operational`,
`minor-outage`, `three-scopes-two-high-usage`, `mongodb-11-percent-used`),
not an expected plugin state. The expected state moves into the
testcase `id` prefix (`ok-`, `warn-`, `crit-`, `unknown-`).
- `disk-smart`: all 28 fixtures carry the `smartctl-v6-text-` prefix so
that future `smartctl-v7-json-*` captures can live alongside them.
- Fixtures that exercised clearly identical scenarios were consolidated
(e.g. `atlassian-statuspage` dropped a second "Partially Degraded
Service" clone).
- `atlassian-statuspage` gained a `critical-outage` fixture to cover the
previously-untested STATE_CRIT branch.
- `fail2ban` gained a real `no-jails-configured` fixture pair to replace
the missing-file trick the previous test used.
- `gitlab-readiness` EXAMPLE08 was mis-understood in the legacy code as
"status ok" - it actually exercises the "Unknown error fetching URL"
path, now renamed and asserted correctly.
Plugins deliberately left untouched in this pass:
- `csv-values`: the plugin has no `--test` hook, it reads from
`--filename` directly. Renaming needs a different harness.
- `logfile`: no legacy `run` file, plugin maintains real on-disk state
across runs.
- `openvpn-client-list`: no legacy `run` file, plugin `--test`
implementation currently just prints `TODO`.
- `mediawiki-version`: converted to the modern skeleton but its only
testcase still calls `lib.version.check_eol` directly over live HTTP
because the plugin has no offline test hook.
All 45 converted plugins run green under `./run` and under
`tools/run-unit-tests --no-container`.1 parent 96c2e23 commit c7ab0a4
File tree
156 files changed
+1559
-2377
lines changed- check-plugins
- atlassian-statuspage/unit-test
- stdout
- cometsystem/unit-test
- stdout
- deb-lastactivity/unit-test
- stdout
- dhcp-scope-usage/unit-test
- stdout
- disk-smart/unit-test
- stdout
- dmesg/unit-test
- stdout
- docker-info/unit-test
- stdout
- docker-stats/unit-test
- stdout
- fail2ban/unit-test
- stdout
- gitlab-health/unit-test
- stdout
- gitlab-liveness/unit-test
- stdout
- gitlab-readiness/unit-test
- stdout
- huawei-dorado-backup-power/unit-test
- stdout
- huawei-dorado-controller/unit-test
- stdout
- huawei-dorado-disk/unit-test
- stdout
- huawei-dorado-enclosure/unit-test
- stdout
- huawei-dorado-fan/unit-test
- stdout
- huawei-dorado-host/unit-test
- stdout
- huawei-dorado-hypermetrodomain/unit-test
- stdout
- huawei-dorado-hypermetropair/unit-test
- stdout
- huawei-dorado-interface/unit-test
- stdout
- huawei-dorado-power/unit-test
- stdout
- huawei-dorado-system/unit-test
- stdout
- kubectl-get-pods/unit-test
- stdout
- mediawiki-version/unit-test
- stdout
- nginx-status/unit-test
- stdout
- nodebb-cache/unit-test
- stdout
- nodebb-database/unit-test
- stdout
- nodebb-errors/unit-test
- stdout
- nodebb-events/unit-test
- stdout
- nodebb-groups/unit-test
- stdout
- nodebb-info/unit-test
- stdout
- nodebb-users/unit-test
- stdout
- podman-info/unit-test
- stdout
- restic-stats/unit-test
- stdout
- sap-open-concur-com/unit-test
- stdout
- service/unit-test
- stdout
- starface-account-stats/unit-test
- stdout
- starface-backup-status/unit-test
- stdout
- starface-channel-status/unit-test
- stdout
- starface-database-stats/unit-test
- stdout
- starface-java-memory-usage/unit-test
- stdout
- starface-peer-stats/unit-test
- stdout
- starface-status/unit-test
- stdout
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
156 files changed
+1559
-2377
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 16 | + | |
| 17 | + | |
22 | 18 | | |
23 | | - | |
24 | | - | |
25 | 19 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
40 | 73 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 74 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 75 | + | |
59 | 76 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 77 | + | |
70 | 78 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
21 | 105 | | |
22 | 106 | | |
23 | 107 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 108 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 109 | + | |
129 | 110 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
145 | 115 | | |
146 | 116 | | |
147 | 117 | | |
| |||
0 commit comments