diff options
Diffstat (limited to 'test/ssh')
-rwxr-xr-x | test/ssh/login.exp | 52 | ||||
-rwxr-xr-x | test/ssh/scp.exp | 66 | ||||
-rwxr-xr-x | test/ssh/sftp.exp | 90 | ||||
-rwxr-xr-x | test/ssh/ssh.sh | 17 |
4 files changed, 0 insertions, 225 deletions
diff --git a/test/ssh/login.exp b/test/ssh/login.exp deleted file mode 100755 index 0a05b2dd1..000000000 --- a/test/ssh/login.exp +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "ssh firejail-test@0\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"} | ||
14 | "an existing sandbox was detected" {puts "OK\n"} | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "ps aux | wc -l\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "5" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "ls -l /home | grep drw | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "1" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "cat /proc/self/status | grep Seccomp\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "2" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "cat /proc/self/status | grep CapBnd\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 4\n";exit} | ||
42 | "0000000000000000" | ||
43 | } | ||
44 | after 100 | ||
45 | |||
46 | # preparing scp/sftp tests | ||
47 | send -- "rm testfile\r" | ||
48 | |||
49 | send -- "exit\r" | ||
50 | sleep 1 | ||
51 | |||
52 | puts "\nall done\n" | ||
diff --git a/test/ssh/scp.exp b/test/ssh/scp.exp deleted file mode 100755 index a803e7131..000000000 --- a/test/ssh/scp.exp +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "ssh firejail-test@0\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"} | ||
14 | "an existing sandbox was detected" {puts "OK\n"} | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "rm -f testfile\r" | ||
19 | after 100 | ||
20 | send -- "exit\r" | ||
21 | sleep 1 | ||
22 | |||
23 | send -- "echo 12345 > testfile\r" | ||
24 | after 100 | ||
25 | send -- "scp testfile firejail-test@0:~/testfile\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "100%" | ||
29 | } | ||
30 | sleep 1 | ||
31 | |||
32 | |||
33 | send -- "ssh firejail-test@0\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 2\n";exit} | ||
36 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"} | ||
37 | "an existing sandbox was detected" {puts "OK\n"} | ||
38 | } | ||
39 | sleep 1 | ||
40 | send -- "cat testfile\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3\n";exit} | ||
43 | "12345" | ||
44 | } | ||
45 | after 100 | ||
46 | send -- "exit\r" | ||
47 | sleep 1 | ||
48 | |||
49 | send -- "rm testfile\r" | ||
50 | after 100 | ||
51 | send -- "scp firejail-test@0:~/testfile testfile\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 4\n";exit} | ||
54 | "100%" | ||
55 | } | ||
56 | sleep 1 | ||
57 | send -- "cat testfile\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 5\n";exit} | ||
60 | "12345" | ||
61 | } | ||
62 | after 100 | ||
63 | send -- "rm testfile\r" | ||
64 | sleep 1 | ||
65 | |||
66 | puts "\nall done\n" | ||
diff --git a/test/ssh/sftp.exp b/test/ssh/sftp.exp deleted file mode 100755 index a3299ef26..000000000 --- a/test/ssh/sftp.exp +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "ssh firejail-test@0\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"} | ||
14 | "an existing sandbox was detected" {puts "OK\n"} | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "rm -f testfile\r" | ||
19 | after 100 | ||
20 | send -- "exit\r" | ||
21 | sleep 1 | ||
22 | |||
23 | send -- "echo 12345 > testfile\r" | ||
24 | after 100 | ||
25 | send -- "sftp firejail-test@0\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "Connected to 0" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 2\n";exit} | ||
32 | "sftp>" | ||
33 | } | ||
34 | after 100 | ||
35 | send -- "put testfile\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 3\n";exit} | ||
38 | "100%" | ||
39 | } | ||
40 | after 100 | ||
41 | send -- "exit\r" | ||
42 | sleep 1 | ||
43 | |||
44 | |||
45 | send -- "ssh firejail-test@0\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 4\n";exit} | ||
48 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"} | ||
49 | "an existing sandbox was detected" {puts "OK\n"} | ||
50 | } | ||
51 | sleep 1 | ||
52 | send -- "cat testfile\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 5\n";exit} | ||
55 | "12345" | ||
56 | } | ||
57 | after 100 | ||
58 | send -- "exit\r" | ||
59 | sleep 1 | ||
60 | |||
61 | send -- "rm testfile\r" | ||
62 | after 100 | ||
63 | send -- "sftp firejail-test@0\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 6\n";exit} | ||
66 | "Connected to 0" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 7\n";exit} | ||
70 | "sftp>" | ||
71 | } | ||
72 | after 100 | ||
73 | send -- "get testfile\r" | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 8\n";exit} | ||
76 | "100%" | ||
77 | } | ||
78 | after 100 | ||
79 | send -- "exit\r" | ||
80 | sleep 1 | ||
81 | send -- "cat testfile\r" | ||
82 | expect { | ||
83 | timeout {puts "TESTING ERROR 9\n";exit} | ||
84 | "12345" | ||
85 | } | ||
86 | after 100 | ||
87 | send -- "rm testfile\r" | ||
88 | sleep 1 | ||
89 | |||
90 | puts "\nall done\n" | ||
diff --git a/test/ssh/ssh.sh b/test/ssh/ssh.sh deleted file mode 100755 index d9fedc969..000000000 --- a/test/ssh/ssh.sh +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | export LC_ALL=C | ||
9 | |||
10 | echo "TESTING: ssh login (test/ssh/login.exp)" | ||
11 | ./login.exp | ||
12 | |||
13 | echo "TESTING: sftp (test/ssh/sftp.exp)" | ||
14 | ./sftp.exp | ||
15 | |||
16 | echo "TESTING: scp (test/ssh/scp.exp)" | ||
17 | ./scp.exp | ||