diff options
author | 2016-02-19 14:57:58 -0500 | |
---|---|---|
committer | 2016-02-19 14:57:58 -0500 | |
commit | 02a66f7e4086097a98dfdac0b47c9909908360a0 (patch) | |
tree | 443fb269e84c89842965677386260e71b85de227 /test | |
parent | moved sandbox name to /run/firejail/name/<PID> (diff) | |
download | firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.tar.gz firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.tar.zst firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.zip |
euid switching
Diffstat (limited to 'test')
-rwxr-xr-x | test/features/3.11.exp | 164 | ||||
-rw-r--r-- | test/features/3.11.profile | 2 | ||||
-rw-r--r-- | test/features/features.txt | 3 | ||||
-rwxr-xr-x | test/features/test.sh | 3 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | set overlay [lindex $argv 0] | ||
10 | set chroot [lindex $argv 1] | ||
11 | |||
12 | # | ||
13 | # N | ||
14 | # | ||
15 | send -- "rm -fr ~/firejail-xy76_u9\r" | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "firejail --profile=3.11.profile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | "Child process initialized" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l ~ | grep xy76_u9\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "drwx------" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 2\n";exit} | ||
32 | "netblue netblue" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 3\n";exit} | ||
36 | "firejail-xy76_u9" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "ls -l ~/firejail-xy76_u9\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 4\n";exit} | ||
43 | "drwx------" | ||
44 | } | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 5\n";exit} | ||
47 | "netblue netblue" | ||
48 | } | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 6\n";exit} | ||
51 | "testdir" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | send -- "rm -fr ~/firejail-xy76_u9\r" | ||
58 | sleep 1 | ||
59 | |||
60 | # | ||
61 | # O | ||
62 | # | ||
63 | if { $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 | # | ||
115 | if { $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 | |||
164 | puts "\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 @@ | |||
1 | mkdir ~/firejail-xy76_u9 | ||
2 | mkdir ~/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 | |||
25 | 1.9 mount namespace | 25 | 1.9 mount namespace |
26 | 1.10 disable /selinux | 26 | 1.10 disable /selinux |
27 | 27 | ||
28 | |||
28 | 2. Networking features | 29 | 2. Networking features |
29 | 30 | ||
30 | 2.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname) | 31 | 2.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname) |
@@ -37,6 +38,7 @@ C - chroot filesystem | |||
37 | 2.5 interface | 38 | 2.5 interface |
38 | 2.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) | 39 | 2.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) |
39 | 40 | ||
41 | |||
40 | 3. Filesystem features (use --noprofile) | 42 | 3. Filesystem features (use --noprofile) |
41 | 43 | ||
42 | 3.1 private | 44 | 3.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 |
57 | 3.10 whitelist tmp | 59 | 3.10 whitelist tmp |
58 | - O not working on Arch Linux - todo | 60 | - O not working on Arch Linux - todo |
61 | 3.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" | |||
113 | echo "TESTING: 3.10 whitelist tmp" | 113 | echo "TESTING: 3.10 whitelist tmp" |
114 | ./3.10.exp $OVERLAY $CHROOT | 114 | ./3.10.exp $OVERLAY $CHROOT |
115 | 115 | ||
116 | echo "TESTING: 3.11 mkdir" | ||
117 | ./3.11.exp $OVERLAY $CHROOT | ||
118 | |||