add the expected prompt for ubuntu root user 92/13992/2
authorYulong Pei <yulong.pei@intel.com>
Tue, 7 Aug 2018 10:37:18 +0000 (18:37 +0800)
committerPeter Mikus <pmikus@cisco.com>
Fri, 24 Aug 2018 18:40:52 +0000 (18:40 +0000)
if ssh use root account to login ubuntu os, its prompt is ":~# ",
so add it to let csit test can run with root account.

Change-Id: I21f5380245324c8e48099433e3d374188e9001d9
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
resources/libraries/python/VatExecutor.py
resources/libraries/python/ssh.py

index 8c3805c..30aac2d 100644 (file)
@@ -201,7 +201,7 @@ class VatTerminal(object):
     """
 
     __VAT_PROMPT = ("vat# ", )
-    __LINUX_PROMPT = (":~$ ", "~]$ ", "~]# ")
+    __LINUX_PROMPT = (":~# ", ":~$ ", "~]$ ", "~]# ")
 
     def __init__(self, node, json_param=True):
         json_text = ' json' if json_param else ''
@@ -345,4 +345,4 @@ class VatTerminal(object):
         for line_tmpl in cmd_template:
             vat_cmd = line_tmpl.format(**args)
             ret.append(self.vat_terminal_exec_cmd(vat_cmd.replace('\n', '')))
-        return ret
\ No newline at end of file
+        return ret
index 7518cab..7368c69 100644 (file)
@@ -264,7 +264,7 @@ class SSH(object):
         chan.set_combine_stderr(True)
 
         buf = ''
-        while not buf.endswith((":~$ ", "~]$ ", "~]# ")):
+        while not buf.endswith((":~# ", ":~$ ", "~]$ ", "~]# ")):
             try:
                 chunk = chan.recv(self.__MAX_RECV_BUF)
                 if not chunk: