aboutsummaryrefslogtreecommitdiffstats
path: root/test/apps-x11
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-23 16:16:51 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-23 16:16:51 -0400
commit7e1c057aeda3b598838cb66b9e827fc087f70c54 (patch)
tree6d13b82ed69f1d3a5b5973072e2b5cc3ea3eca16 /test/apps-x11
parenthexchat profile (diff)
downloadfirejail-7e1c057aeda3b598838cb66b9e827fc087f70c54.tar.gz
firejail-7e1c057aeda3b598838cb66b9e827fc087f70c54.tar.zst
firejail-7e1c057aeda3b598838cb66b9e827fc087f70c54.zip
make testing
Diffstat (limited to 'test/apps-x11')
-rwxr-xr-xtest/apps-x11/apps-x11.sh53
-rwxr-xr-xtest/apps-x11/chromium.exp85
-rwxr-xr-xtest/apps-x11/firefox.exp90
-rwxr-xr-xtest/apps-x11/icedove.exp85
-rwxr-xr-xtest/apps-x11/transmission-gtk.exp85
-rwxr-xr-xtest/apps-x11/xterm.exp85
6 files changed, 483 insertions, 0 deletions
diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh
new file mode 100755
index 000000000..938d4c993
--- /dev/null
+++ b/test/apps-x11/apps-x11.sh
@@ -0,0 +1,53 @@
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
9which xterm
10if [ "$?" -eq 0 ];
11then
12 echo "TESTING: xterm x11"
13 ./xterm.exp
14else
15 echo "TESTING: xterm not found"
16fi
17
18which firefox
19if [ "$?" -eq 0 ];
20then
21 echo "TESTING: firefox x11"
22 ./firefox.exp
23else
24 echo "TESTING: firefox not found"
25fi
26
27which chromium
28if [ "$?" -eq 0 ];
29then
30 echo "TESTING: chromium x11"
31 ./chromium.exp
32else
33 echo "TESTING: chromium not found"
34fi
35
36which transmission-gtk
37if [ "$?" -eq 0 ];
38then
39 echo "TESTING: transmission-gtk x11"
40 ./transmission-gtk.exp
41else
42 echo "TESTING: transmission-gtk not found"
43fi
44
45which icedove
46if [ "$?" -eq 0 ];
47then
48 echo "TESTING: icedove x11"
49 ./icedove.exp
50else
51 echo "TESTING: icedovenot found"
52fi
53
diff --git a/test/apps-x11/chromium.exp b/test/apps-x11/chromium.exp
new file mode 100755
index 000000000..11677a28f
--- /dev/null
+++ b/test/apps-x11/chromium.exp
@@ -0,0 +1,85 @@
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 --name=test --x11 --net=br0 chromium www.gentoo.org\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "chromium"
22}
23sleep 1
24
25# grsecurity exit
26send -- "file /proc/sys/kernel/grsecurity\r"
27expect {
28 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
29 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
30 "cannot open" {puts "grsecurity not present\n"}
31}
32send -- "firejail --name=blablabla\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "Child process initialized"
36}
37sleep 2
38
39spawn $env(SHELL)
40send -- "firemon --seccomp\r"
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 ":firejail"
44}
45expect {
46 timeout {puts "TESTING ERROR 5.0\n";exit}
47 "chromium"
48}
49expect {
50 timeout {puts "TESTING ERROR 5.1\n";exit}
51 "Seccomp: 0"
52}
53expect {
54 timeout {puts "TESTING ERROR 5.1\n";exit}
55 "name=blablabla"
56}
57sleep 1
58send -- "firemon --caps\r"
59expect {
60 timeout {puts "TESTING ERROR 6\n";exit}
61 ":firejail"
62}
63expect {
64 timeout {puts "TESTING ERROR 6.0\n";exit}
65 "chromium"
66}
67expect {
68 timeout {puts "TESTING ERROR 6.1\n";exit}
69 "CapBnd:"
70}
71expect {
72 timeout {puts "TESTING ERROR 6.2\n";exit}
73 "fffffffff"
74}
75expect {
76 timeout {puts "TESTING ERROR 6.3\n";exit}
77 "name=blablabla"
78}
79sleep 1
80send -- "firejail --shutdown=test\r"
81sleep 3
82
83
84puts "\nall done\n"
85
diff --git a/test/apps-x11/firefox.exp b/test/apps-x11/firefox.exp
new file mode 100755
index 000000000..f7c128690
--- /dev/null
+++ b/test/apps-x11/firefox.exp
@@ -0,0 +1,90 @@
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 --name=test --x11 --net=br0 firefox -no-remote www.gentoo.org\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "firefox" {puts "firefox detected\n";}
22 "iceweasel" {puts "iceweasel detected\n";}
23}
24expect {
25 timeout {puts "TESTING ERROR 3.2\n";exit}
26 "no-remote"
27}
28sleep 1
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 " firefox" {puts "firefox detected\n";}
48 " iceweasel" {puts "iceweasel detected\n";}
49}
50expect {
51 timeout {puts "TESTING ERROR 5.0\n";exit}
52 "no-remote"
53}
54expect {
55 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
56 "Seccomp: 2"
57}
58expect {
59 timeout {puts "TESTING ERROR 5.1\n";exit}
60 "name=blablabla"
61}
62sleep 1
63send -- "firemon --caps\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 " firefox" {puts "firefox detected\n";}
67 " iceweasel" {puts "iceweasel detected\n";}
68}
69expect {
70 timeout {puts "TESTING ERROR 6.0\n";exit}
71 "no-remote"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.1\n";exit}
75 "CapBnd:"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.2\n";exit}
79 "0000000000000000"
80}
81expect {
82 timeout {puts "TESTING ERROR 6.3\n";exit}
83 "name=blablabla"
84}
85sleep 1
86send -- "firejail --shutdown=test\r"
87sleep 3
88
89puts "\nall done\n"
90
diff --git a/test/apps-x11/icedove.exp b/test/apps-x11/icedove.exp
new file mode 100755
index 000000000..ca6a49978
--- /dev/null
+++ b/test/apps-x11/icedove.exp
@@ -0,0 +1,85 @@
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 --name=test --net=br0 --x11 icedove\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "icedove"
22}
23sleep 1
24
25# grsecurity exit
26send -- "file /proc/sys/kernel/grsecurity\r"
27expect {
28 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
29 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
30 "cannot open" {puts "grsecurity not present\n"}
31}
32
33send -- "firejail --name=blablabla\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "Child process initialized"
37}
38sleep 2
39
40spawn $env(SHELL)
41send -- "firemon --seccomp\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 ":firejail"
45}
46expect {
47 timeout {puts "TESTING ERROR 5.0\n";exit}
48 "icedove"
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}
58sleep 2
59send -- "firemon --caps\r"
60expect {
61 timeout {puts "TESTING ERROR 6\n";exit}
62 ":firejail"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.0\n";exit}
66 "icedove"
67}
68expect {
69 timeout {puts "TESTING ERROR 6.1\n";exit}
70 "CapBnd"
71}
72expect {
73 timeout {puts "TESTING ERROR 6.2\n";exit}
74 "0000000000000000"
75}
76expect {
77 timeout {puts "TESTING ERROR 6.3\n";exit}
78 "name=blablabla"
79}
80sleep 1
81send -- "firejail --shutdown=test\r"
82sleep 3
83
84puts "\nall done\n"
85
diff --git a/test/apps-x11/transmission-gtk.exp b/test/apps-x11/transmission-gtk.exp
new file mode 100755
index 000000000..67b3fd202
--- /dev/null
+++ b/test/apps-x11/transmission-gtk.exp
@@ -0,0 +1,85 @@
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 --name=test --net=br0 --x11 transmission-gtk\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "transmission-gtk"
22}
23sleep 1
24
25# grsecurity exit
26send -- "file /proc/sys/kernel/grsecurity\r"
27expect {
28 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
29 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
30 "cannot open" {puts "grsecurity not present\n"}
31}
32
33send -- "firejail --name=blablabla\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "Child process initialized"
37}
38sleep 2
39
40spawn $env(SHELL)
41send -- "firemon --seccomp\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 ":firejail"
45}
46expect {
47 timeout {puts "TESTING ERROR 5.0\n";exit}
48 "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}
58sleep 1
59send -- "firemon --caps\r"
60expect {
61 timeout {puts "TESTING ERROR 6\n";exit}
62 ":firejail"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.0\n";exit}
66 "transmission-gtk"
67}
68expect {
69 timeout {puts "TESTING ERROR 6.1\n";exit}
70 "CapBnd"
71}
72expect {
73 timeout {puts "TESTING ERROR 6.2\n";exit}
74 "0000000000000000"
75}
76expect {
77 timeout {puts "TESTING ERROR 6.3\n";exit}
78 "name=blablabla"
79}
80sleep 1
81send -- "firejail --shutdown=test\r"
82sleep 3
83
84puts "\nall done\n"
85
diff --git a/test/apps-x11/xterm.exp b/test/apps-x11/xterm.exp
new file mode 100755
index 000000000..26e58953e
--- /dev/null
+++ b/test/apps-x11/xterm.exp
@@ -0,0 +1,85 @@
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 --name=test --net=br0 --x11 xterm\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "xterm"
22}
23sleep 1
24
25# grsecurity exit
26send -- "file /proc/sys/kernel/grsecurity\r"
27expect {
28 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
29 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
30 "cannot open" {puts "grsecurity not present\n"}
31}
32
33send -- "firejail --name=blablabla\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "Child process initialized"
37}
38sleep 2
39
40spawn $env(SHELL)
41send -- "firemon --seccomp\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 ":firejail"
45}
46expect {
47 timeout {puts "TESTING ERROR 5.0\n";exit}
48 "xterm"
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}
58sleep 1
59send -- "firemon --caps\r"
60expect {
61 timeout {puts "TESTING ERROR 6\n";exit}
62 ":firejail"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.0\n";exit}
66 "xterm"
67}
68expect {
69 timeout {puts "TESTING ERROR 6.1\n";exit}
70 "CapBnd"
71}
72expect {
73 timeout {puts "TESTING ERROR 6.2\n";exit}
74 "0000000000000000"
75}
76expect {
77 timeout {puts "TESTING ERROR 6.3\n";exit}
78 "name=blablabla"
79}
80sleep 1
81send -- "firejail --shutdown=test\r"
82sleep 3
83
84puts "\nall done\n"
85