Commit e1c52a0
authored
[warm-reboot]: added automated recover for ISSU file (sonic-net#1466)
#### What I did
Modified pre-check for file `/host/warmboot/issu_bank.txt` in `warm-reboot` script.
Added automated recovery of `/host/warmboot/issu_bank.txt`
#### How I did it
Modified the `warm-reboot` script.
#### How to verify it
Need to somehow corrupt the `/host/warmboot/issu_bank.txt` (list below) and then run the `warm-reboot` command.
For testing I have modified the `warm-reboot` script - added corruption command before `check_issu_bank_file` function call.
1. Remove `issu_bank.txt`
2. Clear `issu_bank.txt`
3. Change characters count in `issu_bank.txt`
4. Write invalid content into `issu_bank.txt`
#### Previous command output (if the output of a command-line utility has changed)
```
root@arc-switch1041:~# warm-reboot
(/host/warmboot/issu_bank.txt) does NOT exist or empty ...
To recover (/host/warmboot/issu_bank.txt) file, do the following:
$ docker exec -it syncd sx_api_dbg_generate_dump.py
$ docker exec -it syncd cat /tmp/sdkdump | grep 'ISSU Bank'
Command above will print the VALUE of ISSU BANK - 0 or 1, use this VALUE in the next command
$ printf VALUE > /host/warmboot/issu_bank.txt
```
#### New command output (if the output of a command-line utility has changed)
```
root@arc-switch1041:~# warm-reboot
(/host/warmboot/issu_bank.txt) does NOT exist or empty ...
Recovering the (/host/warmboot/issu_bank.txt) file
```1 parent a4ae643 commit e1c52a0
1 file changed
Lines changed: 8 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
184 | 183 | | |
185 | | - | |
186 | 184 | | |
187 | 185 | | |
188 | 186 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 187 | + | |
193 | 188 | | |
194 | 189 | | |
195 | 190 | | |
| |||
199 | 194 | | |
200 | 195 | | |
201 | 196 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 197 | + | |
206 | 198 | | |
207 | 199 | | |
208 | 200 | | |
| |||
599 | 591 | | |
600 | 592 | | |
601 | 593 | | |
602 | | - | |
603 | | - | |
604 | 594 | | |
605 | | - | |
| 595 | + | |
606 | 596 | | |
607 | 597 | | |
608 | 598 | | |
| |||
0 commit comments