diff options
author | 2016-11-19 22:12:51 +0100 | |
---|---|---|
committer | 2016-11-19 22:12:51 +0100 | |
commit | 530db20edeee191a3b60d56b3b87999a3d10979e (patch) | |
tree | 9053d21580917bdf0e6480b2b2875e90b08b1d8c /test/fs/private-home.exp | |
parent | readme updated (diff) | |
parent | qemu profile (diff) | |
download | firejail-530db20edeee191a3b60d56b3b87999a3d10979e.tar.gz firejail-530db20edeee191a3b60d56b3b87999a3d10979e.tar.zst firejail-530db20edeee191a3b60d56b3b87999a3d10979e.zip |
fixed readme
Diffstat (limited to 'test/fs/private-home.exp')
-rwxr-xr-x | test/fs/private-home.exp | 62 |
1 files changed, 60 insertions, 2 deletions
diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp index de5a88dea..3840d1cb8 100755 --- a/test/fs/private-home.exp +++ b/test/fs/private-home.exp | |||
@@ -9,11 +9,19 @@ match_max 100000 | |||
9 | 9 | ||
10 | # create some test files in user home directory | 10 | # create some test files in user home directory |
11 | send -- "touch ~/_firejail_test_file1\r" | 11 | send -- "touch ~/_firejail_test_file1\r" |
12 | after 100 | ||
12 | send -- "touch ~/_firejail_test_file2\r" | 13 | send -- "touch ~/_firejail_test_file2\r" |
14 | after 100 | ||
13 | send -- "mkdir ~/_firejail_test_dir1\r" | 15 | send -- "mkdir ~/_firejail_test_dir1\r" |
16 | after 100 | ||
14 | send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r" | 17 | send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r" |
18 | after 100 | ||
15 | send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r" | 19 | send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r" |
16 | after 100 | 20 | after 100 |
21 | send -- "ln -s /etc ~/_firejail_test_link1\r" | ||
22 | after 100 | ||
23 | send -- "ln -s ~/_firejail_test_dir1 ~/_firejail_test_link2\r" | ||
24 | after 100 | ||
17 | 25 | ||
18 | send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r" | 26 | send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r" |
19 | expect { | 27 | expect { |
@@ -37,8 +45,58 @@ expect { | |||
37 | } | 45 | } |
38 | after 100 | 46 | after 100 |
39 | 47 | ||
40 | send -- "rm -f ~/_firejail_test_file*\r" | 48 | send -- "exit\r" |
41 | send -- "rm -fr ~/_firejail_test_dir*\r" | 49 | sleep 1 |
50 | |||
51 | send -- "firejail --private-home=\"bla;bla\"\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 5\n";exit} | ||
54 | "is an invalid filename" | ||
55 | } | ||
56 | after 100 | ||
57 | |||
58 | send -- "firejail --private-home=/etc/shadow\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 6\n";exit} | ||
61 | "invalid file" | ||
62 | } | ||
63 | after 100 | ||
64 | |||
65 | send -- "firejail --private-home=/etc/passwd\r" | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 7\n";exit} | ||
68 | "invalid file" | ||
69 | } | ||
70 | after 100 | ||
71 | |||
72 | send -- "firejail --private-home=../../etc/passwd\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 8\n";exit} | ||
75 | "invalid file" | ||
76 | } | ||
77 | after 100 | ||
78 | |||
79 | send -- "firejail --private-home=_firejail_test_link1\r" | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 9\n";exit} | ||
82 | "to file or directory not owned by the user" | ||
83 | } | ||
84 | after 100 | ||
85 | |||
86 | send -- "firejail --private-home=_firejail_test_link2\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 10\n";exit} | ||
89 | "Child process initialized" | ||
90 | } | ||
91 | after 100 | ||
92 | send -- "file file ~/_firejail_test_link2\r" | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 11\n";exit} | ||
95 | "broken symbolic link" | ||
96 | } | ||
97 | send -- "exit\r" | ||
98 | |||
99 | send -- "rm -f ~/_firejail_test*\r" | ||
42 | after 100 | 100 | after 100 |
43 | 101 | ||
44 | puts "\nall done\n" | 102 | puts "\nall done\n" |