aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/seccomp-su.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/filters/seccomp-su.exp')
-rwxr-xr-xtest/filters/seccomp-su.exp40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/filters/seccomp-su.exp b/test/filters/seccomp-su.exp
new file mode 100755
index 000000000..3feabc20f
--- /dev/null
+++ b/test/filters/seccomp-su.exp
@@ -0,0 +1,40 @@
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 --noprofile --seccomp\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 2
16
17send -- "sudo su -\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "effective uid is not 0" {puts "OK\n"}
21 "Bad system call" {puts "OK\n"}
22}
23
24send -- "sudo ls\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "effective uid is not 0" {puts "OK\n"}
28 "Bad system call" {puts "OK\n"}
29}
30
31send -- "ping google.com\r"
32expect {
33 timeout {puts "TESTING ERROR 3\n";exit}
34 "Operation not permitted" {puts "OK\n"}
35 "unknown host" {puts "OK\n"}
36}
37
38send -- "exit\r"
39after 100
40puts "all done\n"