aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/macro.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/macro.exp')
-rwxr-xr-xtest/fs/macro.exp174
1 files changed, 174 insertions, 0 deletions
diff --git a/test/fs/macro.exp b/test/fs/macro.exp
new file mode 100755
index 000000000..8080a8108
--- /dev/null
+++ b/test/fs/macro.exp
@@ -0,0 +1,174 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --profile=macro-whitelist.profile ls ~\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16expect {
17 timeout {puts "TESTING ERROR 1\n";exit}
18 "Desktop"
19}
20expect {
21 timeout {puts "TESTING ERROR 2\n";exit}
22 "Documents"
23}
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "Downloads"
27}
28expect {
29 timeout {puts "TESTING ERROR 4\n";exit}
30 "Music"
31}
32expect {
33 timeout {puts "TESTING ERROR 5\n";exit}
34 "Pictures"
35}
36expect {
37 timeout {puts "TESTING ERROR 6\n";exit}
38 "Videos"
39}
40sleep 1
41
42send -- "firejail --profile=macro-blacklist.profile ls ~/Desktop\r"
43expect {
44 timeout {puts "TESTING ERROR 7\n";exit}
45 "Child process initialized"
46}
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "Permission denied"
50}
51sleep 1
52
53send -- "firejail --profile=macro-blacklist.profile ls ~/Documents\r"
54expect {
55 timeout {puts "TESTING ERROR 9n";exit}
56 "Child process initialized"
57}
58expect {
59 timeout {puts "TESTING ERROR 10\n";exit}
60 "Permission denied"
61}
62sleep 1
63
64send -- "firejail --profile=macro-blacklist.profile ls ~/Downloads\r"
65expect {
66 timeout {puts "TESTING ERROR 11n";exit}
67 "Child process initialized"
68}
69expect {
70 timeout {puts "TESTING ERROR 12n";exit}
71 "Permission denied"
72}
73sleep 1
74
75send -- "firejail --profile=macro-blacklist.profile ls ~/Music\r"
76expect {
77 timeout {puts "TESTING ERROR 13\n";exit}
78 "Child process initialized"
79}
80expect {
81 timeout {puts "TESTING ERROR 14\n";exit}
82 "Permission denied"
83}
84sleep 1
85
86send -- "firejail --profile=macro-blacklist.profile ls ~/Pictures\r"
87expect {
88 timeout {puts "TESTING ERROR 15\n";exit}
89 "Child process initialized"
90}
91expect {
92 timeout {puts "TESTING ERROR 16\n";exit}
93 "Permission denied"
94}
95sleep 1
96
97send -- "firejail --profile=macro-blacklist.profile ls ~/Videos\r"
98expect {
99 timeout {puts "TESTING ERROR 17\n";exit}
100 "Child process initialized"
101}
102expect {
103 timeout {puts "TESTING ERROR 18\n";exit}
104 "Permission denied"
105}
106sleep 1
107
108send -- "firejail --profile=macro-readonly.profile touch ~/Desktop/blablabla\r"
109expect {
110 timeout {puts "TESTING ERROR 19\n";exit}
111 "Child process initialized"
112}
113expect {
114 timeout {puts "TESTING ERROR 20\n";exit}
115 "Read-only file system"
116}
117sleep 1
118
119send -- "firejail --profile=macro-readonly.profile touch ~/Documents/blablabla\r"
120expect {
121 timeout {puts "TESTING ERROR 21\n";exit}
122 "Child process initialized"
123}
124expect {
125 timeout {puts "TESTING ERROR 22\n";exit}
126 "Read-only file system"
127}
128sleep 1
129
130send -- "firejail --profile=macro-readonly.profile touch ~/Downloads/blablabla\r"
131expect {
132 timeout {puts "TESTING ERROR 23\n";exit}
133 "Child process initialized"
134}
135expect {
136 timeout {puts "TESTING ERROR 24\n";exit}
137 "Read-only file system"
138}
139sleep 1
140
141send -- "firejail --profile=macro-readonly.profile touch ~/Music/blablabla\r"
142expect {
143 timeout {puts "TESTING ERROR 25\n";exit}
144 "Child process initialized"
145}
146expect {
147 timeout {puts "TESTING ERROR 26\n";exit}
148 "Read-only file system"
149}
150sleep 1
151
152send -- "firejail --profile=macro-readonly.profile touch ~/Pictures/blablabla\r"
153expect {
154 timeout {puts "TESTING ERROR 27\n";exit}
155 "Child process initialized"
156}
157expect {
158 timeout {puts "TESTING ERROR 28\n";exit}
159 "Read-only file system"
160}
161sleep 1
162
163send -- "firejail --profile=macro-readonly.profile touch ~/Videos/blablabla\r"
164expect {
165 timeout {puts "TESTING ERROR 29\n";exit}
166 "Child process initialized"
167}
168expect {
169 timeout {puts "TESTING ERROR 30\n";exit}
170 "Read-only file system"
171}
172sleep 1
173
174puts "\nall done\n"