diff options
author | netblue30 <netblue30@yahoo.com> | 2015-08-08 19:12:30 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-08-08 19:12:30 -0400 |
commit | 1379851360349d6617ad32944a25ee5e2bb74fc2 (patch) | |
tree | f69b48e90708bfa3c2723d5a27ed3e024c827b43 /test/profile_syntax.exp | |
parent | delete files (diff) | |
download | firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.gz firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.zst firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.zip |
Baseline firejail 0.9.28
Diffstat (limited to 'test/profile_syntax.exp')
-rwxr-xr-x | test/profile_syntax.exp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/test/profile_syntax.exp b/test/profile_syntax.exp new file mode 100755 index 000000000..3218177c3 --- /dev/null +++ b/test/profile_syntax.exp | |||
@@ -0,0 +1,69 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --profile=test.profile\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | |||
13 | sleep 2 | ||
14 | send -- "ls /sbin\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "cannot open" | ||
18 | } | ||
19 | |||
20 | sleep 1 | ||
21 | send -- "ls /usr/sbin\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | "cannot open" | ||
25 | } | ||
26 | |||
27 | sleep 1 | ||
28 | send -- "ls -l /etc/shadow\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "root root 0" | ||
32 | } | ||
33 | |||
34 | sleep 1 | ||
35 | send -- "rmdir;pwd\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 4\n";exit} | ||
38 | "Permission denied" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 5\n";exit} | ||
42 | "home" | ||
43 | } | ||
44 | |||
45 | sleep 1 | ||
46 | send -- "mount;pwd\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 6\n";exit} | ||
49 | "Permission denied" | ||
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 7\n";exit} | ||
53 | "home" | ||
54 | } | ||
55 | |||
56 | sleep 1 | ||
57 | send -- "umount;pwd\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 8\n";exit} | ||
60 | "Permission denied" | ||
61 | } | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 9\n";exit} | ||
64 | "home" | ||
65 | } | ||
66 | send -- "exit\r" | ||
67 | |||
68 | sleep 1 | ||
69 | puts "\n" | ||