From 63a2e3cb754d00667055d4dec7005fd645424d7c Mon Sep 17 00:00:00 2001 From: Jianquan Ye Date: Fri, 10 Sep 2021 15:36:35 +0800 Subject: [PATCH] upgrade ceos to version 4.25.5.1M, fix the issue of arista endless lopp --- ansible/group_vars/all/ceos.yml | 6 +++--- ansible/roles/test/files/ptftests/arista.py | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ansible/group_vars/all/ceos.yml b/ansible/group_vars/all/ceos.yml index efa305a5709..a595f23e1dc 100644 --- a/ansible/group_vars/all/ceos.yml +++ b/ansible/group_vars/all/ceos.yml @@ -1,4 +1,4 @@ -ceos_image_filename: cEOS64-lab-4.23.2F.tar.xz -ceos_image_orig: ceosimage:4.23.2F -ceos_image: ceosimage:4.23.2F-1 +ceos_image_filename: cEOS64-lab-4.25.5.1M.tar +ceos_image_orig: ceosimage:4.25.5.1M +ceos_image: ceosimage:4.25.5.1M-1 skip_ceos_image_downloading: false diff --git a/ansible/roles/test/files/ptftests/arista.py b/ansible/roles/test/files/ptftests/arista.py index 211625ea7f5..939c491ecd9 100644 --- a/ansible/roles/test/files/ptftests/arista.py +++ b/ansible/roles/test/files/ptftests/arista.py @@ -91,8 +91,15 @@ def do_cmd(self, cmd, prompt = None): self.shell.send(cmd + '\n') input_buffer = '' + loop_times = 0 while re.search(prompt, input_buffer) is None: input_buffer += self.shell.recv(16384) + loop_times += 1 + # cEOS will not return a arista_prompt if you send lots of 'exit' to close the ssh connect(vEOS do will), + # then an endless loop emerges, + # so if input_buffer is merely an 'exit', we can break the loop immediately + if loop_times > 10 and input_buffer.replace('\n', '').replace('\r', '').strip().lower() == 'exit': + break return input_buffer