aboutsummaryrefslogtreecommitdiffstats
path: root/test/profiles/profile_syntax.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/profiles/profile_syntax.exp')
-rwxr-xr-xtest/profiles/profile_syntax.exp54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/profiles/profile_syntax.exp b/test/profiles/profile_syntax.exp
new file mode 100755
index 000000000..d1be2074a
--- /dev/null
+++ b/test/profiles/profile_syntax.exp
@@ -0,0 +1,54 @@
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
10send -- "firejail --profile=test.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15
16sleep 2
17send -- "cat /sbin/iptables\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "No such file" {puts "\nTESTING /sbin/iptables not found\n"}
21 "Permission denied"
22}
23
24sleep 1
25send -- "ls -l /etc/shadow\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "root root"
29}
30
31sleep 1
32send -- "rmdir\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "Permission denied"
36}
37
38sleep 1
39send -- "mount\r"
40expect {
41 timeout {puts "TESTING ERROR 6\n";exit}
42 "Permission denied"
43}
44
45sleep 1
46send -- "umount\r"
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "Permission denied"
50}
51send -- "exit\r"
52
53after 100
54puts "\nall done\n"