Skip to content

Commit 217461b

Browse files
authored
Fix advanced-reboot.py not detecting the retry count option in warm-reboot (sonic-net#11676)
On images where the warm-reboot (and fast-reboot) script supports the `-n` and `-N` flags, which either require or not require the teamd retry count feature to be enabled, the advanced-reboot.py script is supposed to check to see if this feature is present, and then use `-n` or `-N` depending on if SONiC neighbors are being used or not. However, this never appeared to be being used. The reason for this is that `stdout` is actually an array of strings, so using `in` just meant if the test string exactly matched some line from the help output, which will never be true here. The quick and dirty way to fix this is to concatenate this into a single string (newline-separated), and then use `in`. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
1 parent 6169beb commit 217461b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ansible/roles/test/files/ptftests/py3/advanced-reboot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ def reboot_dut(self):
14751475
# Check to see if the warm-reboot script knows about the retry count feature
14761476
stdout, stderr, return_code = self.dut_connection.execCommand(
14771477
"sudo " + self.reboot_type + " -h", timeout=5)
1478-
if "retry count" in stdout:
1478+
if "retry count" in "\n".join(stdout):
14791479
if self.test_params['neighbor_type'] == "sonic":
14801480
reboot_command = self.reboot_type + " -N"
14811481
else:

0 commit comments

Comments
 (0)