aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar startx2017 <vradu.startx@yandex.com>2018-07-27 13:29:00 -0400
committerLibravatar startx2017 <vradu.startx@yandex.com>2018-07-27 13:29:00 -0400
commit30cb221e5ad2ec98355f5f0829f39f6c46a680e2 (patch)
tree1026e572f373b0bd7c62d53370346037689c326c
parentphase 1 (diff)
downloadfirejail-30cb221e5ad2ec98355f5f0829f39f6c46a680e2.tar.gz
firejail-30cb221e5ad2ec98355f5f0829f39f6c46a680e2.tar.zst
firejail-30cb221e5ad2ec98355f5f0829f39f6c46a680e2.zip
phase1
-rwxr-xr-xtest/fs/fs.sh9
-rwxr-xr-xtest/fs/private-bin.exp92
-rwxr-xr-xtest/fs/private-home.exp102
-rwxr-xr-xtest/fs/private-lib.exp48
4 files changed, 0 insertions, 251 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index 774c61750..186dca1c0 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -28,9 +28,6 @@ echo "TESTING: kmsg access (test/fs/kmsg.exp)"
28echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" 28echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)"
29./fs_var_tmp.exp 29./fs_var_tmp.exp
30 30
31echo "TESTING: private-lib (test/fs/private-lib.exp)"
32./private-lib.exp
33
34echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" 31echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)"
35./fs_var_lock.exp 32./fs_var_lock.exp
36 33
@@ -40,9 +37,6 @@ echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)"
40echo "TESTING: private (test/fs/private.exp)" 37echo "TESTING: private (test/fs/private.exp)"
41./private.exp 38./private.exp
42 39
43echo "TESTING: private home (test/fs/private-home.exp)"
44./private-home.exp
45
46echo "TESTING: private home dir (test/fs/private-home-dir.exp)" 40echo "TESTING: private home dir (test/fs/private-home-dir.exp)"
47./private-home-dir.exp 41./private-home-dir.exp
48 42
@@ -55,9 +49,6 @@ echo "TESTING: private-etc (test/fs/private-etc.exp)"
55echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" 49echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)"
56./private-etc-empty.exp 50./private-etc-empty.exp
57 51
58echo "TESTING: private-bin (test/fs/private-bin.exp)"
59./private-bin.exp
60
61echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" 52echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)"
62./whitelist-empty.exp 53./whitelist-empty.exp
63 54
diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp
deleted file mode 100755
index 7eca6e106..000000000
--- a/test/fs/private-bin.exp
+++ /dev/null
@@ -1,92 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --private-bin=bash,ls,sh\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "ls /bin\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "bash"
21}
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "ls"
25}
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "sh"
29}
30
31send -- "ls /bin\r"
32expect {
33 timeout {puts "TESTING ERROR 5\n";exit}
34 "ping" {puts "TESTING ERROR 6\n";exit}
35 "sh"
36}
37send -- "exit\r"
38sleep 1
39
40send -- "firejail --profile=private-bin.profile\r"
41expect {
42 timeout {puts "TESTING ERROR 7\n";exit}
43 "Child process initialized"
44}
45sleep 1
46
47send -- "ls /bin\r"
48expect {
49 timeout {puts "TESTING ERROR 8\n";exit}
50 "bash"
51}
52expect {
53 timeout {puts "TESTING ERROR 9\n";exit}
54 "ls"
55}
56expect {
57 timeout {puts "TESTING ERROR 10\n";exit}
58 "sh"
59}
60
61send -- "ls /bin\r"
62expect {
63 timeout {puts "TESTING ERROR 11\n";exit}
64 "ping" {puts "TESTING ERROR 12\n";exit}
65 "sh"
66}
67send -- "exit\r"
68after 100
69
70
71send -- "firejail --private-bin=/etc/shadow\r"
72expect {
73 timeout {puts "TESTING ERROR 13\n";exit}
74 "Warning: invalid private-bin path /etc/shadow"
75}
76after 100
77
78send -- "firejail --private-bin=\"bla;bla\"\r"
79expect {
80 timeout {puts "TESTING ERROR 14\n";exit}
81 "is an invalid filename"
82}
83after 100
84
85send -- "firejail --private-etc=../bin/ls\r"
86expect {
87 timeout {puts "TESTING ERROR 15\n";exit}
88 "is an invalid filename"
89}
90
91after 100
92puts "\nall done\n"
diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp
deleted file mode 100755
index 4d35e31e9..000000000
--- a/test/fs/private-home.exp
+++ /dev/null
@@ -1,102 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# create some test files in user home directory
11send -- "touch ~/_firejail_test_file1\r"
12after 100
13send -- "touch ~/_firejail_test_file2\r"
14after 100
15send -- "mkdir ~/_firejail_test_dir1\r"
16after 100
17send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r"
18after 100
19send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r"
20after 100
21send -- "ln -s /etc ~/_firejail_test_link1\r"
22after 100
23send -- "ln -s ~/_firejail_test_dir1 ~/_firejail_test_link2\r"
24after 100
25
26send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r"
27expect {
28 timeout {puts "TESTING ERROR 1\n";exit}
29 "Child process initialized"
30}
31after 100
32
33send -- "find ~\r"
34expect {
35 timeout {puts "TESTING ERROR 2\n";exit}
36 "_firejail_test_file3"
37}
38expect {
39 timeout {puts "TESTING ERROR 3\n";exit}
40 "_firejail_test_file2"
41}
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "_firejail_test_file1"
45}
46after 100
47
48send -- "exit\r"
49sleep 1
50
51send -- "firejail --private-home=\"bla;bla\"\r"
52expect {
53 timeout {puts "TESTING ERROR 5\n";exit}
54 "is an invalid filename"
55}
56after 100
57
58send -- "firejail --private-home=/etc/shadow\r"
59expect {
60 timeout {puts "TESTING ERROR 6\n";exit}
61 "invalid file"
62}
63after 100
64
65send -- "firejail --private-home=/etc/passwd\r"
66expect {
67 timeout {puts "TESTING ERROR 7\n";exit}
68 "invalid file"
69}
70after 100
71
72send -- "firejail --private-home=../../etc/passwd\r"
73expect {
74 timeout {puts "TESTING ERROR 8\n";exit}
75 "invalid file"
76}
77after 100
78
79send -- "firejail --private-home=_firejail_test_link1\r"
80expect {
81 timeout {puts "TESTING ERROR 9\n";exit}
82 "to file or directory not owned by the user"
83}
84after 100
85
86send -- "firejail --private-home=_firejail_test_link2\r"
87expect {
88 timeout {puts "TESTING ERROR 10\n";exit}
89 "Child process initialized"
90}
91after 100
92send -- "file ~/_firejail_test_link2\r"
93expect {
94 timeout {puts "TESTING ERROR 11\n";exit}
95 "broken symbolic link"
96}
97send -- "exit\r"
98
99send -- "rm -f ~/_firejail_test*\r"
100after 100
101
102puts "\nall done\n"
diff --git a/test/fs/private-lib.exp b/test/fs/private-lib.exp
deleted file mode 100755
index 79e0341a3..000000000
--- a/test/fs/private-lib.exp
+++ /dev/null
@@ -1,48 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6
7set timeout 10
8spawn $env(SHELL)
9match_max 100000
10
11send -- "firejail --private-lib --private-bin=sh,bash,dash,ps,grep,ls,find,echo,stty \r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16after 100
17send -- "stty -echo\r"
18after 100
19
20send -- "cd /bin; find .\; echo done\r"
21expect {
22 timeout {puts "TESTING ERROR 2\n";exit}
23# "grep" {puts "TESTING ERROR 3\n";exit}
24 "rm" {puts "TESTING ERROR 3\n";exit}
25 "cp" {puts "TESTING ERROR 4\n";exit}
26 "done"
27}
28after 100
29
30send -- "cd /lib; find .\r"
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 "modules" {puts "TESTING ERROR 6\n";exit}
34 "firmware" {puts "TESTING ERROR 7\n";exit}
35 "libc.so"
36}
37after 100
38
39send -- "cd /usr/lib; find .\r"
40expect {
41 timeout {puts "TESTING ERROR 8\n";exit}
42 "grub" {puts "TESTING ERROR 9\n";exit}
43 "mozilla" {puts "TESTING ERROR 10\n";exit}
44 "libdl.so"
45}
46after 100
47
48puts "\nall done\n"