6e71cc7887
* syncd changes to disk and add e1000 driver to sonic vm * add pg_profile_lookup.ini Signed-off-by: Guohan Lu <gulv@microsoft.com> * update swss and sairedis sairedis: * d146572 2018-11-22 | Fix interface name used on link message using lane map (#386) swss: * c74dc60 2018-11-22 | [vstest]: use eth1~32 as physical interface name in vs docker (#700) (HEAD -> master, origin/master, origin/HEAD) [lguohan] * 6007e7f 2018-11-22 | [portmgrd]: Fix setting default port admin status and MTU (#691) [stepanblyschak] * 6c70f6d 2018-11-22 | [portsorch] Fix port queue index init bug (#505) [yangbashuang] * 70ac79b 2018-11-21 | [gitignore]: Update all binary names in the ignore list (#698) [Shuotian Cheng] * 2a3626c 2018-11-21 | [test]: Remove duplicate legacy ACL tests (#699) [Shuotian Cheng] * 8099811 2018-11-20 | [aclorch]: Remove unnecessary warning message (#696) [Shuotian Cheng] * 63d8ebc 2018-11-18 | [portsorch]: Remove duplicate local variables - port (#690) [Shuotian Cheng] * 28dc042 2018-11-18 | Remove default docker name value of swss. (#692) [Jipan Yang] Signed-off-by: Guohan Lu <gulv@microsoft.com>
59 lines
1.5 KiB
Python
Executable File
59 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import pexpect
|
|
import argparse
|
|
import sys
|
|
import time
|
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser(description='test_login cmdline parser')
|
|
parser.add_argument('-u', default="admin", help='login user name')
|
|
parser.add_argument('-P', default="YourPaSsWoRd", help='login password')
|
|
parser.add_argument('-p', type=int, default=9000, help='local port')
|
|
|
|
args = parser.parse_args()
|
|
|
|
KEY_UP = '\x1b[A'
|
|
KEY_DOWN = '\x1b[B'
|
|
KEY_RIGHT = '\x1b[C'
|
|
KEY_LEFT = '\x1b[D'
|
|
|
|
login_prompt = 'sonic login:'
|
|
passwd_prompt = 'Password:'
|
|
cmd_prompt = "%s@sonic:~\$ $" % args.u
|
|
grub_selection = "The highlighted entry will be executed"
|
|
|
|
p = pexpect.spawn("telnet 127.0.0.1 %s" % args.p, timeout=600, logfile=sys.stdout)
|
|
|
|
# select ONIE embed
|
|
p.expect(grub_selection)
|
|
p.sendline(KEY_DOWN)
|
|
|
|
# install sonic image
|
|
while True:
|
|
i = p.expect([login_prompt, passwd_prompt, grub_selection, cmd_prompt])
|
|
if i == 0:
|
|
# send user name
|
|
p.sendline(args.u)
|
|
elif i == 1:
|
|
# send password
|
|
p.sendline(args.P)
|
|
elif i == 2:
|
|
# select onie install
|
|
p.sendline()
|
|
else:
|
|
break
|
|
|
|
# check version
|
|
time.sleep(5)
|
|
p.sendline('show version')
|
|
p.expect([cmd_prompt])
|
|
p.sendline('show ip bgp sum')
|
|
p.expect([cmd_prompt])
|
|
p.sendline('sync')
|
|
p.expect([cmd_prompt])
|
|
|
|
if __name__ == '__main__':
|
|
main()
|