aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-10-11 09:27:12 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-10-11 09:27:12 -0400
commit6136e5397c182bfede2db5cd7cb1e50262a247ff (patch)
tree528466b83c99217a1063e9bc4b1f27411f2e830f /test
parent--build fixes and compile cleanup (diff)
downloadfirejail-6136e5397c182bfede2db5cd7cb1e50262a247ff.tar.gz
firejail-6136e5397c182bfede2db5cd7cb1e50262a247ff.tar.zst
firejail-6136e5397c182bfede2db5cd7cb1e50262a247ff.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/apps/apps.sh183
-rwxr-xr-xtest/apps/evince.exp83
-rwxr-xr-xtest/apps/hexchat.exp83
-rwxr-xr-xtest/apps/kcalc.exp (renamed from test/private-lib/kcalc.exp)0
-rwxr-xr-xtest/apps/ktorrent.exp (renamed from test/private-lib/ktorrent.exp)0
-rwxr-xr-xtest/apps/transmission-gtk.exp78
-rwxr-xr-xtest/private-lib/private-lib.sh1
-rwxr-xr-xtest/private-lib/qbittorrent.exp83
-rwxr-xr-xtest/private-lib/transmission-qt.exp83
9 files changed, 13 insertions, 581 deletions
diff --git a/test/apps/apps.sh b/test/apps/apps.sh
index 86b7f636e..efdc48cd1 100755
--- a/test/apps/apps.sh
+++ b/test/apps/apps.sh
@@ -6,174 +6,17 @@
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9which firefox 9LIST="firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird "
10if [ "$?" -eq 0 ]; 10LIST+="vlc fbreader deluge gnome-mplayer xchat wine"
11then 11
12 echo "TESTING: firefox" 12for app in $LIST; do
13 ./firefox.exp 13 which $app
14else 14 if [ "$?" -eq 0 ];
15 echo "TESTING SKIP: firefox not found" 15 then
16fi 16 echo "TESTING: $app"
17 ./$app.exp
18 else
19 echo "TESTING SKIP: $app not found"
20 fi
21done
17 22
18which midori
19if [ "$?" -eq 0 ];
20then
21 echo "TESTING: midori"
22 ./midori.exp
23else
24 echo "TESTING SKIP: midori not found"
25fi
26
27which chromium
28if [ "$?" -eq 0 ];
29then
30 echo "TESTING: chromium"
31 ./chromium.exp
32else
33 echo "TESTING SKIP: chromium not found"
34fi
35
36which opera
37if [ "$?" -eq 0 ];
38then
39 echo "TESTING: opera"
40 ./opera.exp
41else
42 echo "TESTING SKIP: opera not found"
43fi
44
45which transmission-gtk
46if [ "$?" -eq 0 ];
47then
48 echo "TESTING: transmission-gtk"
49 ./transmission-gtk.exp
50else
51 echo "TESTING SKIP: transmission-gtk not found"
52fi
53
54which transmission-qt
55if [ "$?" -eq 0 ];
56then
57 echo "TESTING: transmission-qt"
58 ./transmission-qt.exp
59else
60 echo "TESTING SKIP: transmission-qt not found"
61fi
62
63which qbittorrent
64if [ "$?" -eq 0 ];
65then
66 echo "TESTING: qbittorrent"
67 ./qbittorrent.exp
68else
69 echo "TESTING SKIP: qbittorrent not found"
70fi
71
72which uget-gtk
73if [ "$?" -eq 0 ];
74then
75 echo "TESTING: uget"
76 ./uget-gtk.exp
77else
78 echo "TESTING SKIP: uget-gtk not found"
79fi
80
81which filezilla
82if [ "$?" -eq 0 ];
83then
84 echo "TESTING: filezilla"
85 ./filezilla.exp
86else
87 echo "TESTING SKIP: filezilla not found"
88fi
89
90which evince
91if [ "$?" -eq 0 ];
92then
93 echo "TESTING: evince"
94 ./evince.exp
95else
96 echo "TESTING SKIP: evince not found"
97fi
98
99
100which gthumb
101if [ "$?" -eq 0 ];
102then
103 echo "TESTING: gthumb"
104 ./gthumb.exp
105else
106 echo "TESTING SKIP: gthumb not found"
107fi
108
109which thunderbird
110if [ "$?" -eq 0 ];
111then
112 echo "TESTING: thunderbird"
113 ./thunderbird.exp
114else
115 echo "TESTING SKIP: thunderbird not found"
116fi
117
118which vlc
119if [ "$?" -eq 0 ];
120then
121 echo "TESTING: vlc"
122 ./vlc.exp
123else
124 echo "TESTING SKIP: vlc not found"
125fi
126
127which fbreader
128if [ "$?" -eq 0 ];
129then
130 echo "TESTING: fbreader"
131 ./fbreader.exp
132else
133 echo "TESTING SKIP: fbreader not found"
134fi
135
136which deluge
137if [ "$?" -eq 0 ];
138then
139 echo "TESTING: deluge"
140 ./deluge.exp
141else
142 echo "TESTING SKIP: deluge not found"
143fi
144
145which gnome-mplayer
146if [ "$?" -eq 0 ];
147then
148 echo "TESTING: gnome-mplayer"
149 ./gnome-mplayer.exp
150else
151 echo "TESTING SKIP: gnome-mplayer not found"
152fi
153
154which xchat
155if [ "$?" -eq 0 ];
156then
157 echo "TESTING: xchat"
158 ./xchat.exp
159else
160 echo "TESTING SKIP: xchat not found"
161fi
162
163which hexchat
164if [ "$?" -eq 0 ];
165then
166 echo "TESTING: hexchat"
167 ./hexchat.exp
168else
169 echo "TESTING SKIP: hexchat not found"
170fi
171
172which wine
173if [ "$?" -eq 0 ];
174then
175 echo "TESTING: wine"
176 ./wine.exp
177else
178 echo "TESTING SKIP: wine not found"
179fi
diff --git a/test/apps/evince.exp b/test/apps/evince.exp
deleted file mode 100755
index 5eada5fdf..000000000
--- a/test/apps/evince.exp
+++ /dev/null
@@ -1,83 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail evince\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/evince.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "evince"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail evince"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail evince"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/apps/hexchat.exp b/test/apps/hexchat.exp
deleted file mode 100755
index 9d78a9676..000000000
--- a/test/apps/hexchat.exp
+++ /dev/null
@@ -1,83 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail hexchat\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/hexchat.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "hexchat"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 "hexchat"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 "hexchat"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\n"
diff --git a/test/private-lib/kcalc.exp b/test/apps/kcalc.exp
index 8158625b4..8158625b4 100755
--- a/test/private-lib/kcalc.exp
+++ b/test/apps/kcalc.exp
diff --git a/test/private-lib/ktorrent.exp b/test/apps/ktorrent.exp
index cbad352ca..cbad352ca 100755
--- a/test/private-lib/ktorrent.exp
+++ b/test/apps/ktorrent.exp
diff --git a/test/apps/transmission-gtk.exp b/test/apps/transmission-gtk.exp
deleted file mode 100755
index 4df1f7892..000000000
--- a/test/apps/transmission-gtk.exp
+++ /dev/null
@@ -1,78 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail transmission-gtk\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15sleep 5
16
17spawn $env(SHELL)
18send -- "firejail --list\r"
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 ":firejail"
22}
23expect {
24 timeout {puts "TESTING ERROR 3.1\n";exit}
25 "transmission-gtk"
26}
27after 100
28
29# grsecurity exit
30send -- "file /proc/sys/kernel/grsecurity\r"
31expect {
32 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
33 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
34 "cannot open" {puts "grsecurity not present\n"}
35}
36send -- "firejail --name=blablabla\r"
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 "Child process initialized"
40}
41sleep 2
42
43spawn $env(SHELL)
44send -- "firemon --seccomp\r"
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
48 ":firejail transmission-gtk"
49}
50expect {
51 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
52 "Seccomp: 2"
53}
54expect {
55 timeout {puts "TESTING ERROR 5.1\n";exit}
56 "name=blablabla"
57}
58after 100
59send -- "firemon --caps\r"
60expect {
61 timeout {puts "TESTING ERROR 6\n";exit}
62 ":firejail transmission-gtk"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.1\n";exit}
66 "CapBnd"
67}
68expect {
69 timeout {puts "TESTING ERROR 6.2\n";exit}
70 "0000000000000000"
71}
72expect {
73 timeout {puts "TESTING ERROR 6.3\n";exit}
74 "name=blablabla"
75}
76after 100
77
78puts "\nall done\n"
diff --git a/test/private-lib/private-lib.sh b/test/private-lib/private-lib.sh
index 5718d33d7..813c76b42 100755
--- a/test/private-lib/private-lib.sh
+++ b/test/private-lib/private-lib.sh
@@ -5,7 +5,6 @@
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8# LIST="evince galculator gnome-calculator hexchat kcalc ktorrent leafpad mousepad qbittorrent transmission-gtk transmission-qt xcalc"
9LIST="evince galculator gnome-calculator hexchat leafpad mousepad transmission-gtk xcalc" 8LIST="evince galculator gnome-calculator hexchat leafpad mousepad transmission-gtk xcalc"
10 9
11 10
diff --git a/test/private-lib/qbittorrent.exp b/test/private-lib/qbittorrent.exp
deleted file mode 100755
index ef7e996df..000000000
--- a/test/private-lib/qbittorrent.exp
+++ /dev/null
@@ -1,83 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail qbittorrent\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/qbittorrent.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "qbittorrent"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail qbittorrent"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail qbittorrent"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/transmission-qt.exp b/test/private-lib/transmission-qt.exp
deleted file mode 100755
index db19a0700..000000000
--- a/test/private-lib/transmission-qt.exp
+++ /dev/null
@@ -1,83 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail transmission-qt\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/transmission-qt.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "transmission-qt"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail transmission-qt"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail transmission-qt"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"