aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/private-etc.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/private-etc.exp')
-rwxr-xr-xtest/fs/private-etc.exp45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/fs/private-etc.exp b/test/fs/private-etc.exp
new file mode 100755
index 000000000..e5a006585
--- /dev/null
+++ b/test/fs/private-etc.exp
@@ -0,0 +1,45 @@
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# directory with ~
11send -- "firejail --private-etc=passwd,group,resolv.conf,X11\r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 1
17
18send -- "ls -al /etc\r"
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "group"
22}
23expect {
24 timeout {puts "TESTING ERROR 4\n";exit}
25 "passwd"
26}
27expect {
28 timeout {puts "TESTING ERROR 5\n";exit}
29 "resolv.conf"
30}
31expect {
32 timeout {puts "TESTING ERROR 6\n";exit}
33 "X11"
34}
35
36send -- "ls -al /etc\r"
37expect {
38 timeout {puts "TESTING ERROR 7\n";exit}
39 "shadow" {puts "TESTING ERROR 8\n";exit}
40 "X11"
41}
42
43sleep 1
44puts "\nall done\n"
45