diff options
author | 2015-08-23 08:03:47 -0400 | |
---|---|---|
committer | 2015-08-23 08:03:47 -0400 | |
commit | ef1d3bdf44305f71070978c772344ab1244b5d3f (patch) | |
tree | b69a4e3c58fce393dce402e64daf309e40a5e20e | |
parent | Merge pull request #42 from pmillerchip/expand-home (diff) | |
download | firejail-ef1d3bdf44305f71070978c772344ab1244b5d3f.tar.gz firejail-ef1d3bdf44305f71070978c772344ab1244b5d3f.tar.zst firejail-ef1d3bdf44305f71070978c772344ab1244b5d3f.zip |
private-home testing
-rwxr-xr-x | test/private-keep.exp | 126 | ||||
-rw-r--r-- | test/private-keep.profile | 2 |
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 | |||
4 | spawn $env(SHELL) | 4 | spawn $env(SHELL) |
5 | match_max 100000 | 5 | match_max 100000 |
6 | 6 | ||
7 | send -- "firejail --private.keep=.mozilla,.config/firejail\r" | 7 | #************************************************************** |
8 | send -- "firejail --private-home=.mozilla,.config/firejail\r" | ||
8 | expect { | 9 | expect { |
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" | |||
37 | sleep 2 | 38 | sleep 2 |
38 | 39 | ||
39 | 40 | ||
41 | #************************************************************** | ||
40 | send -- "firejail --profile=private-keep.profile\r" | 42 | send -- "firejail --profile=private-keep.profile\r" |
41 | expect { | 43 | expect { |
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 | } |
69 | sleep 1 | ||
70 | puts "\n" | ||
71 | send -- "exit\r" | ||
72 | sleep 2 | ||
73 | |||
74 | |||
75 | #************************************************************** | ||
76 | send -- "firejail --private-home=~/.mozilla,~/.config/firejail\r" | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 2\n";exit} | ||
79 | "Child process initialized" | ||
80 | } | ||
81 | sleep 1 | ||
82 | |||
83 | send -- "ls -al\r" | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
86 | ".config" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
90 | ".mozilla" | ||
91 | } | ||
92 | sleep 1 | ||
93 | |||
94 | send -- "find .config\r" | ||
95 | expect { | ||
96 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
97 | ".config" | ||
98 | } | ||
99 | expect { | ||
100 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
101 | ".config/firejail" | ||
102 | } | ||
103 | sleep 1 | ||
104 | puts "\n" | ||
105 | send -- "exit\r" | ||
106 | sleep 2 | ||
107 | |||
108 | |||
109 | #************************************************************** | ||
110 | send -- "firejail --private-home=~/.mozilla,~/.config/firejail\r" | ||
111 | expect { | ||
112 | timeout {puts "TESTING ERROR 2\n";exit} | ||
113 | "Child process initialized" | ||
114 | } | ||
115 | sleep 1 | ||
116 | |||
117 | send -- "ls -al\r" | ||
118 | expect { | ||
119 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
120 | ".config" | ||
121 | } | ||
122 | expect { | ||
123 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
124 | ".mozilla" | ||
125 | } | ||
126 | sleep 1 | ||
127 | |||
128 | send -- "find .config\r" | ||
129 | expect { | ||
130 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
131 | ".config" | ||
132 | } | ||
133 | expect { | ||
134 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
135 | ".config/firejail" | ||
136 | } | ||
137 | sleep 1 | ||
138 | puts "\n" | ||
139 | send -- "exit\r" | ||
140 | sleep 2 | ||
141 | |||
142 | #************************************************************** | ||
143 | send -- "firejail --private-home=/home/netblue/.mozilla,/home/netblue/.config/firejail\r" | ||
144 | expect { | ||
145 | timeout {puts "TESTING ERROR 3\n";exit} | ||
146 | "Child process initialized" | ||
147 | } | ||
148 | sleep 1 | ||
149 | |||
150 | send -- "ls -al\r" | ||
151 | expect { | ||
152 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
153 | ".config" | ||
154 | } | ||
155 | expect { | ||
156 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
157 | ".mozilla" | ||
158 | } | ||
159 | sleep 1 | ||
160 | |||
161 | send -- "find .config\r" | ||
162 | expect { | ||
163 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
164 | ".config" | ||
165 | } | ||
166 | expect { | ||
167 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
168 | ".config/firejail" | ||
169 | } | ||
170 | sleep 1 | ||
171 | puts "\n" | ||
172 | send -- "exit\r" | ||
173 | sleep 2 | ||
174 | |||
175 | #************************************************************** | ||
176 | send -- "firejail --private-home=/home/netblue/../netblue/.mozilla,/home/netblue/.config/firejail\r" | ||
177 | expect { | ||
178 | timeout {puts "TESTING ERROR 4\n";exit} | ||
179 | "Error: invalid private-home list" | ||
180 | } | ||
181 | sleep 1 | ||
182 | |||
183 | #************************************************************** | ||
184 | send -- "firejail --private-home=/root\r" | ||
185 | expect { | ||
186 | timeout {puts "TESTING ERROR 5\n";exit} | ||
187 | "Error: only files or directories created by the current user are allowed" | ||
188 | } | ||
189 | sleep 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 | ||