diff options
Diffstat (limited to 'test/ssh/login.exp')
-rwxr-xr-x | test/ssh/login.exp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/ssh/login.exp b/test/ssh/login.exp new file mode 100755 index 000000000..479292c91 --- /dev/null +++ b/test/ssh/login.exp | |||
@@ -0,0 +1,49 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "ssh firejail-test@0\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" {puts "OK\n"} | ||
11 | "an existing sandbox was detected" {puts "OK\n"} | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "ps aux | wc -l\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | "5" | ||
19 | } | ||
20 | after 100 | ||
21 | |||
22 | send -- "ls -l /home | grep drw | wc -l\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 2\n";exit} | ||
25 | "1" | ||
26 | } | ||
27 | after 100 | ||
28 | |||
29 | send -- "cat /proc/self/status | grep Seccomp\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 3\n";exit} | ||
32 | "2" | ||
33 | } | ||
34 | after 100 | ||
35 | |||
36 | send -- "cat /proc/self/status | grep CapBnd\r" | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | "0000000000000000" | ||
40 | } | ||
41 | after 100 | ||
42 | |||
43 | # preparing scp/sftp tests | ||
44 | send -- "rm testfile\r" | ||
45 | |||
46 | send -- "exit\r" | ||
47 | sleep 1 | ||
48 | |||
49 | puts "\nall done\n" | ||