aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-08-23 08:03:47 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-08-23 08:03:47 -0400
commitef1d3bdf44305f71070978c772344ab1244b5d3f (patch)
treeb69a4e3c58fce393dce402e64daf309e40a5e20e /test
parentMerge pull request #42 from pmillerchip/expand-home (diff)
downloadfirejail-ef1d3bdf44305f71070978c772344ab1244b5d3f.tar.gz
firejail-ef1d3bdf44305f71070978c772344ab1244b5d3f.tar.zst
firejail-ef1d3bdf44305f71070978c772344ab1244b5d3f.zip
private-home testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/private-keep.exp126
-rw-r--r--test/private-keep.profile2
2 files changed, 126 insertions, 2 deletions
diff --git a/test/private-keep.exp b/test/private-keep.exp
index cdae12ac3..027020ce9 100755
--- a/test/private-keep.exp
+++ b/test/private-keep.exp
@@ -4,7 +4,8 @@ set timeout 10
4spawn $env(SHELL) 4spawn $env(SHELL)
5match_max 100000 5match_max 100000
6 6
7send -- "firejail --private.keep=.mozilla,.config/firejail\r" 7#**************************************************************
8send -- "firejail --private-home=.mozilla,.config/firejail\r"
8expect { 9expect {
9 timeout {puts "TESTING ERROR 0\n";exit} 10 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized" 11 "Child process initialized"
@@ -37,6 +38,7 @@ send -- "exit\r"
37sleep 2 38sleep 2
38 39
39 40
41#**************************************************************
40send -- "firejail --profile=private-keep.profile\r" 42send -- "firejail --profile=private-keep.profile\r"
41expect { 43expect {
42 timeout {puts "TESTING ERROR 1.0\n";exit} 44 timeout {puts "TESTING ERROR 1.0\n";exit}
@@ -64,3 +66,125 @@ expect {
64 timeout {puts "TESTING ERROR 1.4\n";exit} 66 timeout {puts "TESTING ERROR 1.4\n";exit}
65 ".config/firejail" 67 ".config/firejail"
66} 68}
69sleep 1
70puts "\n"
71send -- "exit\r"
72sleep 2
73
74
75#**************************************************************
76send -- "firejail --private-home=~/.mozilla,~/.config/firejail\r"
77expect {
78 timeout {puts "TESTING ERROR 2\n";exit}
79 "Child process initialized"
80}
81sleep 1
82
83send -- "ls -al\r"
84expect {
85 timeout {puts "TESTING ERROR 2.1\n";exit}
86 ".config"
87}
88expect {
89 timeout {puts "TESTING ERROR 2.2\n";exit}
90 ".mozilla"
91}
92sleep 1
93
94send -- "find .config\r"
95expect {
96 timeout {puts "TESTING ERROR 2.3\n";exit}
97 ".config"
98}
99expect {
100 timeout {puts "TESTING ERROR 2.4\n";exit}
101 ".config/firejail"
102}
103sleep 1
104puts "\n"
105send -- "exit\r"
106sleep 2
107
108
109#**************************************************************
110send -- "firejail --private-home=~/.mozilla,~/.config/firejail\r"
111expect {
112 timeout {puts "TESTING ERROR 2\n";exit}
113 "Child process initialized"
114}
115sleep 1
116
117send -- "ls -al\r"
118expect {
119 timeout {puts "TESTING ERROR 2.1\n";exit}
120 ".config"
121}
122expect {
123 timeout {puts "TESTING ERROR 2.2\n";exit}
124 ".mozilla"
125}
126sleep 1
127
128send -- "find .config\r"
129expect {
130 timeout {puts "TESTING ERROR 2.3\n";exit}
131 ".config"
132}
133expect {
134 timeout {puts "TESTING ERROR 2.4\n";exit}
135 ".config/firejail"
136}
137sleep 1
138puts "\n"
139send -- "exit\r"
140sleep 2
141
142#**************************************************************
143send -- "firejail --private-home=/home/netblue/.mozilla,/home/netblue/.config/firejail\r"
144expect {
145 timeout {puts "TESTING ERROR 3\n";exit}
146 "Child process initialized"
147}
148sleep 1
149
150send -- "ls -al\r"
151expect {
152 timeout {puts "TESTING ERROR 3.1\n";exit}
153 ".config"
154}
155expect {
156 timeout {puts "TESTING ERROR 3.2\n";exit}
157 ".mozilla"
158}
159sleep 1
160
161send -- "find .config\r"
162expect {
163 timeout {puts "TESTING ERROR 3.3\n";exit}
164 ".config"
165}
166expect {
167 timeout {puts "TESTING ERROR 3.4\n";exit}
168 ".config/firejail"
169}
170sleep 1
171puts "\n"
172send -- "exit\r"
173sleep 2
174
175#**************************************************************
176send -- "firejail --private-home=/home/netblue/../netblue/.mozilla,/home/netblue/.config/firejail\r"
177expect {
178 timeout {puts "TESTING ERROR 4\n";exit}
179 "Error: invalid private-home list"
180}
181sleep 1
182
183#**************************************************************
184send -- "firejail --private-home=/root\r"
185expect {
186 timeout {puts "TESTING ERROR 5\n";exit}
187 "Error: only files or directories created by the current user are allowed"
188}
189sleep 1
190
diff --git a/test/private-keep.profile b/test/private-keep.profile
index 7f842cc04..a968c4ce2 100644
--- a/test/private-keep.profile
+++ b/test/private-keep.profile
@@ -1 +1 @@
private.keep .mozilla,.config/firejail private-home .mozilla,.config/firejail