Commit 95f317a
authored
[Mellanox] Fix issue: watchdogutil command does not work (#16091)
- Why I did it
watchdogutil uses platform API watchdog instance to control/query watchdog status. In Nvidia watchdog status, it caches "armed" status in a object member "WatchdogImplBase.armed". This is not working for CLI infrastructure because each CLI will create a new watchdog instance, the status cached in previous instance will totally lose. Consider following commands:
admin@sonic:~$ sudo watchdogutil arm -s 100 =====> watchdog instance1, armed=True
Watchdog armed for 100 seconds
admin@sonic:~$ sudo watchdogutil status ======> watchdog instance2, armed=False
Status: Unarmed
admin@sonic:~$ sudo watchdogutil disarm =======> watchdog instance3, armed=False
Failed to disarm Watchdog
- How I did it
Use sysfs to query watchdog status
- How to verify it
Manual test
Unit test1 parent d42066c commit 95f317a
File tree
2 files changed
+46
-38
lines changed- platform/mellanox/mlnx-platform-api
- sonic_platform
- tests
2 files changed
+46
-38
lines changedLines changed: 22 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 84 | + | |
91 | 85 | | |
92 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 137 | + | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
147 | 144 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 145 | + | |
152 | 146 | | |
153 | 147 | | |
154 | 148 | | |
| |||
162 | 156 | | |
163 | 157 | | |
164 | 158 | | |
165 | | - | |
| 159 | + | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
169 | | - | |
170 | 163 | | |
171 | 164 | | |
172 | 165 | | |
| |||
179 | 172 | | |
180 | 173 | | |
181 | 174 | | |
182 | | - | |
| 175 | + | |
183 | 176 | | |
184 | 177 | | |
185 | | - | |
186 | 178 | | |
187 | 179 | | |
188 | 180 | | |
| |||
194 | 186 | | |
195 | 187 | | |
196 | 188 | | |
197 | | - | |
| 189 | + | |
198 | 190 | | |
199 | 191 | | |
200 | 192 | | |
| |||
203 | 195 | | |
204 | 196 | | |
205 | 197 | | |
206 | | - | |
| 198 | + | |
207 | 199 | | |
208 | 200 | | |
209 | 201 | | |
| |||
216 | 208 | | |
217 | 209 | | |
218 | 210 | | |
219 | | - | |
| 211 | + | |
| 212 | + | |
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
223 | 216 | | |
224 | 217 | | |
225 | 218 | | |
| 219 | + | |
226 | 220 | | |
227 | 221 | | |
228 | 222 | | |
| |||
233 | 227 | | |
234 | 228 | | |
235 | 229 | | |
236 | | - | |
| 230 | + | |
| 231 | + | |
237 | 232 | | |
238 | 233 | | |
239 | 234 | | |
| |||
246 | 241 | | |
247 | 242 | | |
248 | 243 | | |
249 | | - | |
250 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
251 | 247 | | |
252 | 248 | | |
253 | 249 | | |
| |||
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | | - | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | | - | |
| 101 | + | |
93 | 102 | | |
94 | | - | |
| 103 | + | |
95 | 104 | | |
96 | | - | |
97 | 105 | | |
98 | | - | |
99 | 106 | | |
100 | 107 | | |
101 | 108 | | |
102 | | - | |
| 109 | + | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | | - | |
| 113 | + | |
106 | 114 | | |
107 | | - | |
| 115 | + | |
108 | 116 | | |
109 | | - | |
110 | 117 | | |
111 | | - | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
116 | | - | |
| 122 | + | |
| 123 | + | |
117 | 124 | | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
| 128 | + | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
125 | | - | |
| 134 | + | |
| 135 | + | |
126 | 136 | | |
| 137 | + | |
127 | 138 | | |
128 | 139 | | |
| 140 | + | |
129 | 141 | | |
0 commit comments