From c17b2d0ff578db904793d5fb10b5e309f602e4b0 Mon Sep 17 00:00:00 2001 From: Abdul Haleem Date: Tue, 23 Jan 2024 15:30:56 +0530 Subject: [PATCH] Patch helps to overcome login issue. Sometimes the console via ssh is not connected and Login attempt fails, This could be due to network issue.Attempting to login for 5 times if the connection is not established in one go. Signed-off-by: Abdul Haleem --- testcases/InstallUpstreamKernel.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testcases/InstallUpstreamKernel.py b/testcases/InstallUpstreamKernel.py index 94741e4f4..a480d1d20 100644 --- a/testcases/InstallUpstreamKernel.py +++ b/testcases/InstallUpstreamKernel.py @@ -133,8 +133,11 @@ def is_url(path): self.prompt = self.cv_SYSTEM.util.build_prompt() self.console_thread.console_terminate() con.close() - time.sleep(10) - raw_pty = self.cv_SYSTEM.console.get_console() + for i in range(5): + raw_pty = self.cv_SYSTEM.console.get_console() + time.sleep(10) + if raw_pty.sendline("uname -r")!=0: + break raw_pty.sendline("reboot") raw_pty.expect("login:", timeout=600) raw_pty.close()