diff options
author | netblue30 <netblue30@yahoo.com> | 2016-12-15 14:12:31 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-12-15 14:12:31 -0500 |
commit | 1b549b5ee5a386bf3297a54a533fcd7294e23fec (patch) | |
tree | 7c9d2ddf2d3bea9870c7cac8d45cc7600ed4b8b4 | |
parent | fix older platforms (diff) | |
download | firejail-1b549b5ee5a386bf3297a54a533fcd7294e23fec.tar.gz firejail-1b549b5ee5a386bf3297a54a533fcd7294e23fec.tar.zst firejail-1b549b5ee5a386bf3297a54a533fcd7294e23fec.zip |
testing
-rwxr-xr-x | test/fcopy/dircopy.exp | 28 | ||||
-rwxr-xr-x | test/fs/private-whitelist.exp | 1 | ||||
-rwxr-xr-x | test/fs/whitelist-dev.exp | 12 | ||||
-rwxr-xr-x | test/utils/cpu-print.exp | 24 | ||||
-rwxr-xr-x | test/utils/trace.exp | 18 |
5 files changed, 64 insertions, 19 deletions
diff --git a/test/fcopy/dircopy.exp b/test/fcopy/dircopy.exp index 00b0204ae..dc8c80569 100755 --- a/test/fcopy/dircopy.exp +++ b/test/fcopy/dircopy.exp | |||
@@ -21,30 +21,58 @@ expect { | |||
21 | timeout {puts "TESTING ERROR 0\n";exit} | 21 | timeout {puts "TESTING ERROR 0\n";exit} |
22 | "dest/" | 22 | "dest/" |
23 | } | 23 | } |
24 | after 100 | ||
25 | |||
26 | send -- "find dest\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0\n";exit} | ||
29 | "dest/" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | send -- "find dest\r" | ||
24 | expect { | 34 | expect { |
25 | timeout {puts "TESTING ERROR 1\n";exit} | 35 | timeout {puts "TESTING ERROR 1\n";exit} |
26 | "dest/a" | 36 | "dest/a" |
27 | } | 37 | } |
38 | after 100 | ||
39 | |||
40 | send -- "find dest\r" | ||
28 | expect { | 41 | expect { |
29 | timeout {puts "TESTING ERROR 2\n";exit} | 42 | timeout {puts "TESTING ERROR 2\n";exit} |
30 | "dest/a/b" | 43 | "dest/a/b" |
31 | } | 44 | } |
45 | after 100 | ||
46 | |||
47 | send -- "find dest\r" | ||
32 | expect { | 48 | expect { |
33 | timeout {puts "TESTING ERROR 3\n";exit} | 49 | timeout {puts "TESTING ERROR 3\n";exit} |
34 | "dest/a/b/file4" | 50 | "dest/a/b/file4" |
35 | } | 51 | } |
52 | after 100 | ||
53 | |||
54 | send -- "find dest\r" | ||
36 | expect { | 55 | expect { |
37 | timeout {puts "TESTING ERROR 4\n";exit} | 56 | timeout {puts "TESTING ERROR 4\n";exit} |
38 | "dest/a/file3" | 57 | "dest/a/file3" |
39 | } | 58 | } |
59 | after 100 | ||
60 | |||
61 | send -- "find dest\r" | ||
40 | expect { | 62 | expect { |
41 | timeout {puts "TESTING ERROR 5\n";exit} | 63 | timeout {puts "TESTING ERROR 5\n";exit} |
42 | "dest/dircopy.exp" | 64 | "dest/dircopy.exp" |
43 | } | 65 | } |
66 | after 100 | ||
67 | |||
68 | send -- "find dest\r" | ||
44 | expect { | 69 | expect { |
45 | timeout {puts "TESTING ERROR 6\n";exit} | 70 | timeout {puts "TESTING ERROR 6\n";exit} |
46 | "dest/file2" | 71 | "dest/file2" |
47 | } | 72 | } |
73 | after 100 | ||
74 | |||
75 | send -- "find dest\r" | ||
48 | expect { | 76 | expect { |
49 | timeout {puts "TESTING ERROR 7\n";exit} | 77 | timeout {puts "TESTING ERROR 7\n";exit} |
50 | "dest/file1" | 78 | "dest/file1" |
diff --git a/test/fs/private-whitelist.exp b/test/fs/private-whitelist.exp index 4dadeacb1..6a1ad535c 100755 --- a/test/fs/private-whitelist.exp +++ b/test/fs/private-whitelist.exp | |||
@@ -34,6 +34,7 @@ expect { | |||
34 | "3" {puts "3\n"} | 34 | "3" {puts "3\n"} |
35 | "4" {puts "4\n"} | 35 | "4" {puts "4\n"} |
36 | "5" {puts "5\n"} | 36 | "5" {puts "5\n"} |
37 | "6" {puts "6\n"} | ||
37 | } | 38 | } |
38 | 39 | ||
39 | sleep 1 | 40 | sleep 1 |
diff --git a/test/fs/whitelist-dev.exp b/test/fs/whitelist-dev.exp index a19d5cedf..a2002bc0a 100755 --- a/test/fs/whitelist-dev.exp +++ b/test/fs/whitelist-dev.exp | |||
@@ -14,7 +14,7 @@ expect { | |||
14 | } | 14 | } |
15 | sleep 1 | 15 | sleep 1 |
16 | 16 | ||
17 | send -- "ls -l /dev | find /dev | wc -l\r" | 17 | send -- "find /dev | wc -l\r" |
18 | expect { | 18 | expect { |
19 | timeout {puts "TESTING ERROR 1\n";exit} | 19 | timeout {puts "TESTING ERROR 1\n";exit} |
20 | "2" | 20 | "2" |
@@ -23,17 +23,17 @@ after 100 | |||
23 | send -- "exit\r" | 23 | send -- "exit\r" |
24 | sleep 1 | 24 | sleep 1 |
25 | 25 | ||
26 | send -- "firejail --whitelist=/var/tmp --debug\r" | 26 | send -- "firejail --private-dev --debug\r" |
27 | expect { | 27 | expect { |
28 | timeout {puts "TESTING ERROR 0\n";exit} | 28 | timeout {puts "TESTING ERROR 2\n";exit} |
29 | "Child process initialized" | 29 | "Child process initialized" |
30 | } | 30 | } |
31 | sleep 1 | 31 | sleep 1 |
32 | 32 | ||
33 | send -- "ls -l /dev | find /dev | wc -l\r" | 33 | send -- "ls -l /dev | wc -l\r" |
34 | expect { | 34 | expect { |
35 | timeout {puts "TESTING ERROR 1\n";exit} | 35 | timeout {puts "TESTING ERROR 3\n";exit} |
36 | "2" | 36 | "13" |
37 | } | 37 | } |
38 | after 100 | 38 | after 100 |
39 | send -- "exit\r" | 39 | send -- "exit\r" |
diff --git a/test/utils/cpu-print.exp b/test/utils/cpu-print.exp index ca2e57313..0a6f46102 100755 --- a/test/utils/cpu-print.exp +++ b/test/utils/cpu-print.exp | |||
@@ -7,18 +7,34 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail --name=test --cpu=1,2\r" | 10 | send -- "firejail --name=test --cpu=0\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 12 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "Child process initialized" | 13 | "Child process initialized" |
14 | } | 14 | } |
15 | sleep 2 | 15 | sleep 1 |
16 | send -- "cat /proc/self/status | grep Cpus\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 1\n";exit} | ||
19 | "Cpus_allowed_list: 0" | ||
20 | } | ||
21 | after 100 | ||
22 | send -- "exit\r" | ||
23 | sleep 1 | ||
24 | |||
25 | |||
26 | send -- "firejail --name=test --cpu=1\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1\n";exit} | ||
29 | "Child process initialized" | ||
30 | } | ||
31 | sleep 1 | ||
16 | 32 | ||
17 | spawn $env(SHELL) | 33 | spawn $env(SHELL) |
18 | send -- "firejail --cpu.print=test\r" | 34 | send -- "firejail --cpu.print=test\r" |
19 | expect { | 35 | expect { |
20 | timeout {puts "TESTING ERROR 1\n";exit} | 36 | timeout {puts "TESTING ERROR 2\n";exit} |
21 | "Cpus_allowed_list: 1-2" | 37 | "Cpus_allowed_list: 1" |
22 | } | 38 | } |
23 | after 100 | 39 | after 100 |
24 | puts "\nall done\n" | 40 | puts "\nall done\n" |
diff --git a/test/utils/trace.exp b/test/utils/trace.exp index 78a04b273..eedc0f23f 100755 --- a/test/utils/trace.exp +++ b/test/utils/trace.exp | |||
@@ -53,15 +53,15 @@ expect { | |||
53 | sleep 1 | 53 | sleep 1 |
54 | 54 | ||
55 | send -- "firejail --trace wget -q debian.org\r" | 55 | send -- "firejail --trace wget -q debian.org\r" |
56 | expect { | 56 | #expect { |
57 | timeout {puts "TESTING ERROR 8.1\n";exit} | 57 | # timeout {puts "TESTING ERROR 8.1\n";exit} |
58 | "Child process initialized" | 58 | # "Child process initialized" |
59 | } | 59 | #} |
60 | expect { | 60 | #expect { |
61 | timeout {puts "TESTING ERROR 8.2\n";exit} | 61 | # timeout {puts "TESTING ERROR 8.2\n";exit} |
62 | "bash:open /dev/tty" {puts "OK\n";} | 62 | # "bash:open /dev/tty" {puts "OK\n";} |
63 | "bash:open64 /dev/tty" {puts "OK\n";} | 63 | # "bash:open64 /dev/tty" {puts "OK\n";} |
64 | } | 64 | #} |
65 | expect { | 65 | expect { |
66 | timeout {puts "TESTING ERROR 8.3\n";exit} | 66 | timeout {puts "TESTING ERROR 8.3\n";exit} |
67 | "wget:fopen64 /etc/wgetrc" {puts "OK\n";} | 67 | "wget:fopen64 /etc/wgetrc" {puts "OK\n";} |