diff options
author | netblue30 <netblue30@yahoo.com> | 2016-10-17 08:41:39 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-10-17 08:41:39 -0400 |
commit | bb6c744fd4f59d0f407c37955ba36f8d40cc60cf (patch) | |
tree | d87a3fa6e00e254466f5a487d1eda0f032a0669e /test/fs/sys_fs.exp | |
parent | merges (diff) | |
download | firejail-bb6c744fd4f59d0f407c37955ba36f8d40cc60cf.tar.gz firejail-bb6c744fd4f59d0f407c37955ba36f8d40cc60cf.tar.zst firejail-bb6c744fd4f59d0f407c37955ba36f8d40cc60cf.zip |
allow user access to /sys/fs (--noblacklist=/sys/fs)
Diffstat (limited to 'test/fs/sys_fs.exp')
-rwxr-xr-x | test/fs/sys_fs.exp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/fs/sys_fs.exp b/test/fs/sys_fs.exp new file mode 100755 index 000000000..f512776d9 --- /dev/null +++ b/test/fs/sys_fs.exp | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls /sys/fs\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "Permission denied" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "exit\r" | ||
25 | sleep 1 | ||
26 | |||
27 | send -- "firejail --noblacklist=/sys/fs\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1\n";exit} | ||
30 | "Child process initialized" | ||
31 | } | ||
32 | sleep 1 | ||
33 | |||
34 | send -- "ls /sys/fs\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 2\n";exit} | ||
37 | "cgroup" | ||
38 | } | ||
39 | after 100 | ||
40 | send -- "exit\r" | ||
41 | after 100 | ||
42 | |||
43 | puts "\nall done\n" | ||
44 | |||