Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: third_party/pexpect/tests/fakessh/ssh

Issue 1398903002: Add third_party/pexpect (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@end-to-end-test
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/pexpect/tests/exit667.c ('k') | third_party/pexpect/tests/getch.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 from __future__ import print_function
3
4 import getpass
5 import sys
6 PY3 = (sys.version_info[0] >= 3)
7 if not PY3:
8 input = raw_input
9
10 print("Mock SSH client for tests. Do not enter real security info.")
11
12 pw = getpass.getpass('password:')
13 if pw != 's3cret':
14 print('Permission denied!')
15 sys.exit(1)
16
17 prompt = "$"
18 while True:
19 cmd = input(prompt)
20 if cmd.startswith('PS1='):
21 prompt = eval(cmd[4:]).replace('\$', '$')
22 elif cmd == 'ping':
23 print('pong')
24 elif cmd.startswith('ls'):
25 print('file1.py', 'file2.html', sep='\t')
26 elif cmd == 'echo $?':
27 print(0)
28 elif cmd in ('exit', 'logout'):
29 break
OLDNEW
« no previous file with comments | « third_party/pexpect/tests/exit667.c ('k') | third_party/pexpect/tests/getch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698