aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/seccomp-su.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-30 07:31:21 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-30 07:31:21 -0400
commitea774178f6d8f613c96c0d001fed200155b704b7 (patch)
treeee2de7fcce0499dcb21cf475a068fe8957ab07bb /test/filters/seccomp-su.exp
parentadded make test-filters (diff)
downloadfirejail-ea774178f6d8f613c96c0d001fed200155b704b7.tar.gz
firejail-ea774178f6d8f613c96c0d001fed200155b704b7.tar.zst
firejail-ea774178f6d8f613c96c0d001fed200155b704b7.zip
added make test-filters
Diffstat (limited to 'test/filters/seccomp-su.exp')
-rwxr-xr-xtest/filters/seccomp-su.exp37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/filters/seccomp-su.exp b/test/filters/seccomp-su.exp
new file mode 100755
index 000000000..003f3df99
--- /dev/null
+++ b/test/filters/seccomp-su.exp
@@ -0,0 +1,37 @@
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"
21}
22
23send -- "sudo ls\r"
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "effective uid is not 0"
27}
28
29send -- "ping google.com\r"
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "Operation not permitted"
33}
34
35send -- "exit\r"
36sleep 1
37puts "all done\n"