diff options
Diffstat (limited to 'test/profiles/profile_syntax.exp')
-rwxr-xr-x | test/profiles/profile_syntax.exp | 54 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --profile=test.profile\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | |||
16 | sleep 2 | ||
17 | send -- "cat /sbin/iptables\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "No such file" {puts "\nTESTING /sbin/iptables not found\n"} | ||
21 | "Permission denied" | ||
22 | } | ||
23 | |||
24 | sleep 1 | ||
25 | send -- "ls -l /etc/shadow\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "root root" | ||
29 | } | ||
30 | |||
31 | sleep 1 | ||
32 | send -- "rmdir\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "Permission denied" | ||
36 | } | ||
37 | |||
38 | sleep 1 | ||
39 | send -- "mount\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 6\n";exit} | ||
42 | "Permission denied" | ||
43 | } | ||
44 | |||
45 | sleep 1 | ||
46 | send -- "umount\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 8\n";exit} | ||
49 | "Permission denied" | ||
50 | } | ||
51 | send -- "exit\r" | ||
52 | |||
53 | after 100 | ||
54 | puts "\nall done\n" | ||