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.exp66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/profiles/profile_syntax.exp b/test/profiles/profile_syntax.exp
new file mode 100755
index 000000000..ecad1043b
--- /dev/null
+++ b/test/profiles/profile_syntax.exp
@@ -0,0 +1,66 @@
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 0"
29}
30
31sleep 1
32send -- "rmdir;pwd\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "Permission denied"
36}
37expect {
38 timeout {puts "TESTING ERROR 5\n";exit}
39 "home"
40}
41
42sleep 1
43send -- "mount;pwd\r"
44expect {
45 timeout {puts "TESTING ERROR 6\n";exit}
46 "Permission denied"
47}
48expect {
49 timeout {puts "TESTING ERROR 7\n";exit}
50 "home"
51}
52
53sleep 1
54send -- "umount;pwd\r"
55expect {
56 timeout {puts "TESTING ERROR 8\n";exit}
57 "Permission denied"
58}
59expect {
60 timeout {puts "TESTING ERROR 9\n";exit}
61 "home"
62}
63send -- "exit\r"
64
65sleep 1
66puts "\n"