aboutsummaryrefslogtreecommitdiffstats
path: root/test/login_ssh.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/login_ssh.exp')
-rwxr-xr-xtest/login_ssh.exp59
1 files changed, 59 insertions, 0 deletions
diff --git a/test/login_ssh.exp b/test/login_ssh.exp
new file mode 100755
index 000000000..dff6dc655
--- /dev/null
+++ b/test/login_ssh.exp
@@ -0,0 +1,59 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "ssh bingo@0\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "password:" {
11 puts "\nTESTING: please enter SSH password"
12 set oldmode [stty -echo -raw]
13 expect_user -re "(.*)\n"
14 send_user "\n"
15 eval stty $oldmode
16# stty echo
17 set pass $expect_out(1,string)
18 send -- "$pass\r"
19 puts "TESTING: password sent to the server"
20 }
21 "Child process initialized"
22}
23sleep 1
24
25# test default gw
26send -- "bash\r"
27sleep 1
28send -- "ps aux; pwd\r"
29expect {
30 timeout {puts "TESTING ERROR 1\n";exit}
31 "/bin/bash"
32}
33expect {
34 timeout {puts "TESTING ERROR 2\n";exit}
35 "bash"
36}
37expect {
38 timeout {puts "TESTING ERROR 3\n";exit}
39 "ps aux"
40}
41expect {
42 timeout {puts "TESTING ERROR 4\n";exit}
43 "home"
44}
45sleep 1
46
47
48send -- "ps aux |wc -l; pwd\r"
49expect {
50 timeout {puts "TESTING ERROR 5\n";exit}
51 "5"
52}
53expect {
54 timeout {puts "TESTING ERROR 6\n";exit}
55 "home"
56}
57sleep 1
58
59puts "\n"