aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-19 14:57:58 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-19 14:57:58 -0500
commit02a66f7e4086097a98dfdac0b47c9909908360a0 (patch)
tree443fb269e84c89842965677386260e71b85de227 /test/features
parentmoved sandbox name to /run/firejail/name/<PID> (diff)
downloadfirejail-02a66f7e4086097a98dfdac0b47c9909908360a0.tar.gz
firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.tar.zst
firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.zip
euid switching
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/3.11.exp164
-rw-r--r--test/features/3.11.profile2
-rw-r--r--test/features/features.txt3
-rwxr-xr-xtest/features/test.sh3
4 files changed, 172 insertions, 0 deletions
diff --git a/test/features/3.11.exp b/test/features/3.11.exp
new file mode 100755
index 000000000..aeaf28bf8
--- /dev/null
+++ b/test/features/3.11.exp
@@ -0,0 +1,164 @@
1#!/usr/bin/expect -f
2#
3# mkdir
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
11
12#
13# N
14#
15send -- "rm -fr ~/firejail-xy76_u9\r"
16sleep 1
17
18send -- "firejail --profile=3.11.profile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 "Child process initialized"
22}
23sleep 1
24
25send -- "ls -l ~ | grep xy76_u9\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "drwx------"
29}
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "netblue netblue"
33}
34expect {
35 timeout {puts "TESTING ERROR 3\n";exit}
36 "firejail-xy76_u9"
37}
38after 100
39
40send -- "ls -l ~/firejail-xy76_u9\r"
41expect {
42 timeout {puts "TESTING ERROR 4\n";exit}
43 "drwx------"
44}
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 "netblue netblue"
48}
49expect {
50 timeout {puts "TESTING ERROR 6\n";exit}
51 "testdir"
52}
53after 100
54
55send -- "exit\r"
56sleep 1
57send -- "rm -fr ~/firejail-xy76_u9\r"
58sleep 1
59
60#
61# O
62#
63if { $overlay == "overlay" } {
64 send -- "rm -fr ~/firejail-xy76_u9\r"
65 sleep 1
66
67 send -- "firejail --profile=3.11.profile\r"
68 expect {
69 timeout {puts "TESTING ERROR 10\n";exit}
70 "Child process initialized"
71 }
72 sleep 1
73
74 send -- "ls -l ~ | grep xy76_u9\r"
75 expect {
76 timeout {puts "TESTING ERROR 11\n";exit}
77 "drwx------"
78 }
79 expect {
80 timeout {puts "TESTING ERROR 12\n";exit}
81 "netblue netblue"
82 }
83 expect {
84 timeout {puts "TESTING ERROR 13\n";exit}
85 "firejail-xy76_u9"
86 }
87 after 100
88
89 send -- "ls -l ~/firejail-xy76_u9\r"
90 expect {
91 timeout {puts "TESTING ERROR 14\n";exit}
92 "drwx------"
93 }
94 expect {
95 timeout {puts "TESTING ERROR 15\n";exit}
96 "netblue netblue"
97 }
98 expect {
99 timeout {puts "TESTING ERROR 16\n";exit}
100 "testdir"
101 }
102 after 100
103
104 send -- "exit\r"
105 sleep 1
106 send -- "rm -fr ~/firejail-xy76_u9\r"
107 sleep 1
108
109
110}
111
112#
113# C
114#
115if { $chroot == "chroot" } {
116 send -- "rm -fr ~/firejail-xy76_u9\r"
117 sleep 1
118
119 send -- "firejail --profile=3.11.profile\r"
120 expect {
121 timeout {puts "TESTING ERROR 20\n";exit}
122 "Child process initialized"
123 }
124 sleep 1
125
126 send -- "ls -l ~ | grep xy76_u9\r"
127 expect {
128 timeout {puts "TESTING ERROR 21\n";exit}
129 "drwx------"
130 }
131 expect {
132 timeout {puts "TESTING ERROR 22\n";exit}
133 "netblue netblue"
134 }
135 expect {
136 timeout {puts "TESTING ERROR 23\n";exit}
137 "firejail-xy76_u9"
138 }
139 after 100
140
141 send -- "ls -l ~/firejail-xy76_u9\r"
142 expect {
143 timeout {puts "TESTING ERROR 24\n";exit}
144 "drwx------"
145 }
146 expect {
147 timeout {puts "TESTING ERROR 25\n";exit}
148 "netblue netblue"
149 }
150 expect {
151 timeout {puts "TESTING ERROR 26\n";exit}
152 "testdir"
153 }
154 after 100
155
156 send -- "rm -fr ~/firejail-xy76_u9\r"
157 sleep 1
158
159 send -- "exit\r"
160
161}
162
163
164puts "\nall done\n"
diff --git a/test/features/3.11.profile b/test/features/3.11.profile
new file mode 100644
index 000000000..144733f8f
--- /dev/null
+++ b/test/features/3.11.profile
@@ -0,0 +1,2 @@
1mkdir ~/firejail-xy76_u9
2mkdir ~/firejail-xy76_u9/testdir
diff --git a/test/features/features.txt b/test/features/features.txt
index 4d8821a92..283e85d93 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -25,6 +25,7 @@ C - chroot filesystem
251.9 mount namespace 251.9 mount namespace
261.10 disable /selinux 261.10 disable /selinux
27 27
28
282. Networking features 292. Networking features
29 30
302.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname) 312.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname)
@@ -37,6 +38,7 @@ C - chroot filesystem
372.5 interface 382.5 interface
382.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) 392.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn)
39 40
41
403. Filesystem features (use --noprofile) 423. Filesystem features (use --noprofile)
41 43
423.1 private 443.1 private
@@ -56,6 +58,7 @@ C - chroot filesystem
56 - N not working on Debian wheezy (32-bit and 64-bit) - todo 58 - N not working on Debian wheezy (32-bit and 64-bit) - todo
573.10 whitelist tmp 593.10 whitelist tmp
58 - O not working on Arch Linux - todo 60 - O not working on Arch Linux - todo
613.11 mkdir
59 62
60 63
61 64
diff --git a/test/features/test.sh b/test/features/test.sh
index 495996551..11306b52d 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -113,3 +113,6 @@ echo "TESTING: 3.9 whitelist dev"
113echo "TESTING: 3.10 whitelist tmp" 113echo "TESTING: 3.10 whitelist tmp"
114./3.10.exp $OVERLAY $CHROOT 114./3.10.exp $OVERLAY $CHROOT
115 115
116echo "TESTING: 3.11 mkdir"
117./3.11.exp $OVERLAY $CHROOT
118