Skip to content

Commit 81419b8

Browse files
authored
upgrade ceos to version 4.25.5.1M, fix the issue of arista endless lopp (#4228)
Description of PR Summary: Fixes # (issue) Type of change Bug fix Testbed and Framework(new/improvement) Approach What is the motivation for this PR? cEOS containers' mgmt-ip occasionally unavaillable, upgrade cEOS image version will fix that cEOS terminal behavior slightly different from vEOS, enhance arista.py to avoid endless loop How did you do it? upgrade cEOS image version break loop if ssh connect returns merely an 'exit', as for other commands who relies on the return e.g. 'show interfaces po1 | json', 'exit' won't appear in input_buffer, so the change won't influence it. How did you verify/test it? Run platform_tests/test_advanced_reboot.py test on physical testbed and it didn't stuck again. Tried run command 'show interfaces po1 | json', it's not influenced. Co-authored-by: Jianquan Ye <[email protected]>
1 parent e264d51 commit 81419b8

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

ansible/group_vars/all/ceos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ceos_image_filename: cEOS64-lab-4.23.2F.tar.xz
2-
ceos_image_orig: ceosimage:4.23.2F
3-
ceos_image: ceosimage:4.23.2F-1
1+
ceos_image_filename: cEOS64-lab-4.25.5.1M.tar
2+
ceos_image_orig: ceosimage:4.25.5.1M
3+
ceos_image: ceosimage:4.25.5.1M-1
44
skip_ceos_image_downloading: false

ansible/roles/test/files/ptftests/arista.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,15 @@ def do_cmd(self, cmd, prompt = None):
9191
self.shell.send(cmd + '\n')
9292

9393
input_buffer = ''
94+
loop_times = 0
9495
while re.search(prompt, input_buffer) is None:
9596
input_buffer += self.shell.recv(16384)
97+
loop_times += 1
98+
# cEOS will not return a arista_prompt if you send lots of 'exit' to close the ssh connect(vEOS do will),
99+
# then an endless loop emerges,
100+
# so if input_buffer is merely an 'exit', we can break the loop immediately
101+
if loop_times > 10 and input_buffer.replace('\n', '').replace('\r', '').strip().lower() == 'exit':
102+
break
96103

97104
return input_buffer
98105

0 commit comments

Comments
 (0)