diff options
author | netblue30 <netblue30@yahoo.com> | 2016-04-21 14:37:53 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-04-21 14:37:53 -0400 |
commit | ad2f7bc496e3cc83bca2381515312dd2ef6fc7f1 (patch) | |
tree | 0a923afb486b1f13ab35d26138cdbf51e0961aec /test/profiles/profile_syntax.exp | |
parent | --read-write option (diff) | |
download | firejail-ad2f7bc496e3cc83bca2381515312dd2ef6fc7f1.tar.gz firejail-ad2f7bc496e3cc83bca2381515312dd2ef6fc7f1.tar.zst firejail-ad2f7bc496e3cc83bca2381515312dd2ef6fc7f1.zip |
make test-profiles
Diffstat (limited to 'test/profiles/profile_syntax.exp')
-rwxr-xr-x | test/profiles/profile_syntax.exp | 66 |
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 | |||
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 0" | ||
29 | } | ||
30 | |||
31 | sleep 1 | ||
32 | send -- "rmdir;pwd\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "Permission denied" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 5\n";exit} | ||
39 | "home" | ||
40 | } | ||
41 | |||
42 | sleep 1 | ||
43 | send -- "mount;pwd\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 6\n";exit} | ||
46 | "Permission denied" | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 7\n";exit} | ||
50 | "home" | ||
51 | } | ||
52 | |||
53 | sleep 1 | ||
54 | send -- "umount;pwd\r" | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 8\n";exit} | ||
57 | "Permission denied" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 9\n";exit} | ||
61 | "home" | ||
62 | } | ||
63 | send -- "exit\r" | ||
64 | |||
65 | sleep 1 | ||
66 | puts "\n" | ||