aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 06:32:15 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 06:32:15 -0400
commit020c5449036c461ea1829e854da43429322059d6 (patch)
tree46ca4f358fcc1c50be77586ccdb0e02170d81e1d /test
parenttesting (diff)
downloadfirejail-020c5449036c461ea1829e854da43429322059d6.tar.gz
firejail-020c5449036c461ea1829e854da43429322059d6.tar.zst
firejail-020c5449036c461ea1829e854da43429322059d6.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/environment/csh.exp (renamed from test/shell_csh.exp)3
-rwxr-xr-xtest/environment/dash.exp (renamed from test/shell_dash.exp)0
-rwxr-xr-xtest/environment/env.exp (renamed from test/env.exp)3
-rw-r--r--test/environment/env.profile (renamed from test/env.profile)0
-rwxr-xr-xtest/environment/environment.sh47
-rwxr-xr-xtest/environment/firejail-in-firejail.exp (renamed from test/firejail-in-firejail.exp)3
-rwxr-xr-xtest/environment/firejail-in-firejail2.exp (renamed from test/firejail-in-firejail2.exp)3
-rwxr-xr-xtest/environment/rlimit-profile.exp (renamed from test/profile_rlimit.exp)0
-rwxr-xr-xtest/environment/rlimit.exp (renamed from test/option_rlimit.exp)0
-rw-r--r--test/environment/rlimit.profile (renamed from test/rlimit.profile)0
-rwxr-xr-xtest/environment/shell-none.exp48
-rw-r--r--test/environment/shell-none.profile1
-rwxr-xr-xtest/environment/zsh.exp (renamed from test/shell_zsh.exp)3
-rwxr-xr-xtest/test.sh29
-rwxr-xr-xtest/utils/utils.sh4
15 files changed, 113 insertions, 31 deletions
diff --git a/test/shell_csh.exp b/test/environment/csh.exp
index a2634f633..10ad3607e 100755
--- a/test/shell_csh.exp
+++ b/test/environment/csh.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/shell_dash.exp b/test/environment/dash.exp
index f5a60719e..f5a60719e 100755
--- a/test/shell_dash.exp
+++ b/test/environment/dash.exp
diff --git a/test/env.exp b/test/environment/env.exp
index d7aee3c64..a09c3f9c5 100755
--- a/test/env.exp
+++ b/test/environment/env.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/env.profile b/test/environment/env.profile
index ba66e6210..ba66e6210 100644
--- a/test/env.profile
+++ b/test/environment/env.profile
diff --git a/test/environment/environment.sh b/test/environment/environment.sh
new file mode 100755
index 000000000..3041fcc12
--- /dev/null
+++ b/test/environment/environment.sh
@@ -0,0 +1,47 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8
9echo "TESTING: environment variables (test/environment/env.exp)"
10./env.exp
11
12echo "TESTING: shell none(test/environment/shell-none.exp)"
13./shell-none.exp
14
15which dash
16if [ "$?" -eq 0 ];
17then
18 echo "TESTING: dash (test/environment/dash.exp)"
19 ./dash.exp
20else
21 echo "TESTING: dash not found"
22fi
23
24which csh
25if [ "$?" -eq 0 ];
26then
27 echo "TESTING: csh (test/environment/csh.exp)"
28 ./csh.exp
29else
30 echo "TESTING: csh not found"
31fi
32
33which zsh
34if [ "$?" -eq 0 ];
35then
36 echo "TESTING: zsh (test/environment/zsh.exp)"
37 ./csh.exp
38else
39 echo "TESTING: zsh not found"
40fi
41
42echo "TESTING: rlimit (test/environment/rlimit.exp)"
43./rlimit.exp
44
45echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)"
46./rlimit-profile.exp
47
diff --git a/test/firejail-in-firejail.exp b/test/environment/firejail-in-firejail.exp
index 5ba18d1fa..7e7f4fd17 100755
--- a/test/firejail-in-firejail.exp
+++ b/test/environment/firejail-in-firejail.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/firejail-in-firejail2.exp b/test/environment/firejail-in-firejail2.exp
index b0fed0dae..5a2213074 100755
--- a/test/firejail-in-firejail2.exp
+++ b/test/environment/firejail-in-firejail2.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/profile_rlimit.exp b/test/environment/rlimit-profile.exp
index 7d2637444..7d2637444 100755
--- a/test/profile_rlimit.exp
+++ b/test/environment/rlimit-profile.exp
diff --git a/test/option_rlimit.exp b/test/environment/rlimit.exp
index 17d2bd9d1..17d2bd9d1 100755
--- a/test/option_rlimit.exp
+++ b/test/environment/rlimit.exp
diff --git a/test/rlimit.profile b/test/environment/rlimit.profile
index 271891c03..271891c03 100644
--- a/test/rlimit.profile
+++ b/test/environment/rlimit.profile
diff --git a/test/environment/shell-none.exp b/test/environment/shell-none.exp
new file mode 100755
index 000000000..e30008f83
--- /dev/null
+++ b/test/environment/shell-none.exp
@@ -0,0 +1,48 @@
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 --shell=none\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "shell=none configured, but no program specified"
14}
15sleep 1
16
17send -- "firejail --profile=shell-none.profile\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "shell=none configured, but no program specified"
21}
22sleep 1
23
24send -- "firejail --shell=none ls\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "Child process initialized"
28}
29expect {
30 timeout {puts "TESTING ERROR 3\n";exit}
31 "environment.sh"
32}
33sleep 1
34
35send -- "firejail --profile=shell-none.profile ls\r"
36expect {
37 timeout {puts "TESTING ERROR 4\n";exit}
38 "Child process initialized"
39}
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "environment.sh"
43}
44sleep 1
45
46
47puts "\nall done\n"
48
diff --git a/test/environment/shell-none.profile b/test/environment/shell-none.profile
new file mode 100644
index 000000000..f16ebe3a0
--- /dev/null
+++ b/test/environment/shell-none.profile
@@ -0,0 +1 @@
shell none
diff --git a/test/shell_zsh.exp b/test/environment/zsh.exp
index 1d73fd926..2604b2be5 100755
--- a/test/shell_zsh.exp
+++ b/test/environment/zsh.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/test.sh b/test/test.sh
index ba5268036..e92a0f902 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -34,9 +34,6 @@ echo "TESTING: protocol (protocol.exp)"
34echo "TESTING: invalid filename (invalid_filename.exp)" 34echo "TESTING: invalid filename (invalid_filename.exp)"
35./invalid_filename.exp 35./invalid_filename.exp
36 36
37echo "TESTING: environment variables (env.exp)"
38./env.exp
39
40echo "TESTING: whitelist empty (whitelist-empty.exp)" 37echo "TESTING: whitelist empty (whitelist-empty.exp)"
41./whitelist-empty.exp 38./whitelist-empty.exp
42 39
@@ -96,15 +93,6 @@ echo "TESTING: extract command (extract_command.exp)"
96echo "TESTING: kmsg access (kmsg.exp)" 93echo "TESTING: kmsg access (kmsg.exp)"
97./kmsg.exp 94./kmsg.exp
98 95
99echo "TESTING: rlimit (option_rlimit.exp)"
100./option_rlimit.exp
101
102echo "TESTING: firejail in firejail - single sandbox (firejail-in-firejail.exp)"
103./firejail-in-firejail.exp
104
105echo "TESTING: firejail in firejail - force new sandbox (firejail-in-firejail2.exp)"
106./firejail-in-firejail2.exp
107
108echo "TESTING: chroot overlay (option_chroot_overlay.exp)" 96echo "TESTING: chroot overlay (option_chroot_overlay.exp)"
109./option_chroot_overlay.exp 97./option_chroot_overlay.exp
110 98
@@ -135,20 +123,6 @@ ls -al > tmpreadonly
135sleep 5 123sleep 5
136rm -f tmpreadonly 124rm -f tmpreadonly
137 125
138echo "TESTING: zsh (shell_zsh.exp)"
139./shell_zsh.exp
140
141echo "TESTING: csh (shell_csh.exp)"
142./shell_csh.exp
143
144which dash
145if [ "$?" -eq 0 ];
146then
147 echo "TESTING: dash (shell_dash.exp)"
148 ./shell_dash.exp
149else
150 echo "TESTING: dash not found"
151fi
152 126
153echo "TESTING: PID (pid.exp)" 127echo "TESTING: PID (pid.exp)"
154./pid.exp 128./pid.exp
@@ -159,9 +133,6 @@ echo "TESTING: output (output.exp)"
159echo "TESTING: profile no permissions (profile_noperm.exp)" 133echo "TESTING: profile no permissions (profile_noperm.exp)"
160./profile_noperm.exp 134./profile_noperm.exp
161 135
162echo "TESTING: profile rlimit (profile_rlimit.exp)"
163./profile_rlimit.exp
164
165echo "TESTING: profile read-only (profile_readonly.exp)" 136echo "TESTING: profile read-only (profile_readonly.exp)"
166./profile_readonly.exp 137./profile_readonly.exp
167 138
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index a40845a5f..9a1b6601a 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -55,8 +55,8 @@ echo "TESTING: shutdown4 (test/utils/shutdown4.exp)"
55echo "TESTING: join test/utils/(join.exp)" 55echo "TESTING: join test/utils/(join.exp)"
56./join.exp 56./join.exp
57 57
58echo "TESTING: join2 test/utils/(join2.exp)" 58echo "TESTING: join2 (test/utils/join2.exp)"
59.join2.exp 59./join2.exp
60 60
61echo "TESTING: join3 (test/utils/join3.exp)" 61echo "TESTING: join3 (test/utils/join3.exp)"
62./join3.exp 62./join3.exp