aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-04-20 09:28:42 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2018-04-20 09:28:42 -0400
commit3fe1b06a36cefc497e957b603d1a5231ba7fbc02 (patch)
tree7fcb14ff2fc3752ea1438177a6324134e5823caf /test
parentmkuid: fall back to default values if no UID_MIN / GID_MIN found (diff)
downloadfirejail-3fe1b06a36cefc497e957b603d1a5231ba7fbc02.tar.gz
firejail-3fe1b06a36cefc497e957b603d1a5231ba7fbc02.tar.zst
firejail-3fe1b06a36cefc497e957b603d1a5231ba7fbc02.zip
cleanup
Diffstat (limited to 'test')
-rwxr-xr-xtest/appimage/appimage-args.exp4
-rwxr-xr-xtest/appimage/appimage-v1.exp4
-rwxr-xr-xtest/environment/csh.exp34
-rwxr-xr-xtest/environment/zsh.exp30
-rwxr-xr-xtest/root/private.exp37
5 files changed, 47 insertions, 62 deletions
diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp
index dcf16452f..0ec07c1ad 100755
--- a/test/appimage/appimage-args.exp
+++ b/test/appimage/appimage-args.exp
@@ -56,7 +56,7 @@ expect {
56sleep 2 56sleep 2
57 57
58spawn $env(SHELL) 58spawn $env(SHELL)
59send -- "firemon --seccomp\r" 59send -- "firemon --seccomp --nowrap\r"
60expect { 60expect {
61 timeout {puts "TESTING ERROR 8\n";exit} 61 timeout {puts "TESTING ERROR 8\n";exit}
62 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 62 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -71,7 +71,7 @@ expect {
71 "name=blablabla" 71 "name=blablabla"
72} 72}
73after 100 73after 100
74send -- "firemon --caps\r" 74send -- "firemon --caps --nowrap\r"
75expect { 75expect {
76 timeout {puts "TESTING ERROR 11\n";exit} 76 timeout {puts "TESTING ERROR 11\n";exit}
77 "appimage Leafpad" 77 "appimage Leafpad"
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp
index 073c32dab..90b13b9ff 100755
--- a/test/appimage/appimage-v1.exp
+++ b/test/appimage/appimage-v1.exp
@@ -44,7 +44,7 @@ expect {
44sleep 2 44sleep 2
45 45
46spawn $env(SHELL) 46spawn $env(SHELL)
47send -- "firemon --seccomp\r" 47send -- "firemon --seccomp --nowrap\r"
48expect { 48expect {
49 timeout {puts "TESTING ERROR 5\n";exit} 49 timeout {puts "TESTING ERROR 5\n";exit}
50 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 50 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -59,7 +59,7 @@ expect {
59 "name=blablabla" 59 "name=blablabla"
60} 60}
61after 100 61after 100
62send -- "firemon --caps\r" 62send -- "firemon --caps --nowrap\r"
63expect { 63expect {
64 timeout {puts "TESTING ERROR 6\n";exit} 64 timeout {puts "TESTING ERROR 6\n";exit}
65 "appimage Leafpad" 65 "appimage Leafpad"
diff --git a/test/environment/csh.exp b/test/environment/csh.exp
index 10a278ebc..7b5ab9b33 100755
--- a/test/environment/csh.exp
+++ b/test/environment/csh.exp
@@ -1,49 +1,31 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5 2
6set timeout 10 3set timeout 10
4cd /home
7spawn $env(SHELL) 5spawn $env(SHELL)
8match_max 100000 6match_max 100000
9 7
10send -- "firejail --private --tracelog --csh\r" 8send -- "firejail --private --shell=/bin/csh\r"
11expect { 9expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 10 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 11 "Child process initialized"
14} 12}
15sleep 1 13sleep 1
16 14
17send -- "find ~\r" 15send -- "env | grep SHELL;pwd\r"
18expect { 16expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 17 timeout {puts "TESTING ERROR 1\n";exit}
20 ".cshrc" 18 "SHELL"
21}
22
23send -- "env | grep SHELL\r"
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "SHELL"
27} 19}
28expect { 20expect {
29 timeout {puts "TESTING ERROR 2.1\n";exit} 21 timeout {puts "TESTING ERROR 2\n";exit}
30 "/bin/csh" 22 "/bin/csh"
31} 23}
32send -- "exit\r"
33sleep 1
34
35send -- "firejail --shell=none --csh\r"
36expect { 24expect {
37 timeout {puts "TESTING ERROR 3\n";exit} 25 timeout {puts "TESTING ERROR 3\n";exit}
38 "shell=none was already specified" 26 "home"
39}
40after 100
41
42send -- "firejail --csh --shell=none\r"
43expect {
44 timeout {puts "TESTING ERROR 4\n";exit}
45 "a shell was already specified"
46} 27}
28send -- "exit\r"
47after 100 29after 100
48 30
49puts "\n" 31puts "\nall done\n"
diff --git a/test/environment/zsh.exp b/test/environment/zsh.exp
index e7f610e98..a1b94a326 100755
--- a/test/environment/zsh.exp
+++ b/test/environment/zsh.exp
@@ -1,49 +1,31 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5 2
6set timeout 10 3set timeout 10
4cd /home
7spawn $env(SHELL) 5spawn $env(SHELL)
8match_max 100000 6match_max 100000
9 7
10send -- "firejail --private --tracelog --zsh\r" 8send -- "firejail --private --shell=/bin/zsh\r"
11expect { 9expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 10 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 11 "Child process initialized"
14} 12}
15sleep 1 13sleep 1
16 14
17send -- "find ~\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 ".zshrc"
21}
22
23send -- "env | grep SHELL;pwd\r" 15send -- "env | grep SHELL;pwd\r"
24expect { 16expect {
25 timeout {puts "TESTING ERROR 2\n";exit} 17 timeout {puts "TESTING ERROR 1\n";exit}
26 "SHELL" 18 "SHELL"
27} 19}
28expect { 20expect {
29 timeout {puts "TESTING ERROR 2.1\n";exit} 21 timeout {puts "TESTING ERROR 2\n";exit}
30 "/bin/zsh" 22 "/bin/zsh"
31} 23}
32send -- "exit\r"
33sleep 1
34
35send -- "firejail --shell=none --zsh\r"
36expect { 24expect {
37 timeout {puts "TESTING ERROR 3\n";exit} 25 timeout {puts "TESTING ERROR 3\n";exit}
38 "shell=none was already specified" 26 "home"
39}
40after 100
41
42send -- "firejail --zsh --shell=none\r"
43expect {
44 timeout {puts "TESTING ERROR 4\n";exit}
45 "a shell was already specified"
46} 27}
28send -- "exit\r"
47after 100 29after 100
48 30
49puts "\nall done\n" 31puts "\nall done\n"
diff --git a/test/root/private.exp b/test/root/private.exp
index 784761fc8..e3d3245ae 100755
--- a/test/root/private.exp
+++ b/test/root/private.exp
@@ -54,6 +54,21 @@ expect {
54after 100 54after 100
55send -- "exit\r" 55send -- "exit\r"
56sleep 1 56sleep 1
57send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r"
58expect {
59 timeout {puts "TESTING ERROR 3.1\n";exit}
60 "Child process initialized"
61}
62sleep 1
63
64send -- "find /opt | wc -l\r"
65expect {
66 timeout {puts "TESTING ERROR 4.1\n";exit}
67 "4"
68}
69after 100
70send -- "exit\r"
71sleep 1
57 72
58 73
59send -- "touch /srv/firejail-test-file\r" 74send -- "touch /srv/firejail-test-file\r"
@@ -77,14 +92,20 @@ expect {
77after 100 92after 100
78send -- "exit\r" 93send -- "exit\r"
79sleep 1 94sleep 1
95send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r"
96expect {
97 timeout {puts "TESTING ERROR 5.1\n";exit}
98 "Child process initialized"
99}
100sleep 1
80 101
81 102send -- "find /srv | wc -l\r"
82 103expect {
83 104 timeout {puts "TESTING ERROR 6.1\n";exit}
84 105 "4"
85 106}
86 107after 100
87 108send -- "exit\r"
88 109sleep 1
89 110
90puts "\nall done\n" 111puts "\nall done\n"