aboutsummaryrefslogtreecommitdiffstats
path: root/test/apps/firefox.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/apps/firefox.exp')
-rwxr-xr-xtest/apps/firefox.exp100
1 files changed, 100 insertions, 0 deletions
diff --git a/test/apps/firefox.exp b/test/apps/firefox.exp
new file mode 100755
index 000000000..5745d9270
--- /dev/null
+++ b/test/apps/firefox.exp
@@ -0,0 +1,100 @@
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 firefox -no-remote www.gentoo.org\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/firefox.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 10
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 "firefox" {puts "firefox detected\n";}
30 "iceweasel" {puts "iceweasel detected\n";}
31}
32expect {
33 timeout {puts "TESTING ERROR 3.2\n";exit}
34 "no-remote"
35}
36after 100
37
38# grsecurity exit
39send -- "file /proc/sys/kernel/grsecurity\r"
40expect {
41 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
42 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
43 "cannot open" {puts "grsecurity not present\n"}
44}
45
46
47send -- "firejail --name=blablabla\r"
48expect {
49 timeout {puts "TESTING ERROR 4\n";exit}
50 "Child process initialized"
51}
52sleep 2
53
54spawn $env(SHELL)
55send -- "firemon --seccomp\r"
56expect {
57 timeout {puts "TESTING ERROR 5\n";exit}
58 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
59 " firefox" {puts "firefox detected\n";}
60 " iceweasel" {puts "iceweasel detected\n";}
61}
62expect {
63 timeout {puts "TESTING ERROR 5.0\n";exit}
64 "no-remote"
65}
66expect {
67 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
68 "Seccomp: 2"
69}
70expect {
71 timeout {puts "TESTING ERROR 5.1\n";exit}
72 "name=blablabla"
73}
74after 100
75send -- "firemon --caps\r"
76expect {
77 timeout {puts "TESTING ERROR 6\n";exit}
78 " firefox" {puts "firefox detected\n";}
79 " iceweasel" {puts "iceweasel detected\n";}
80}
81expect {
82 timeout {puts "TESTING ERROR 6.0\n";exit}
83 "no-remote"
84}
85expect {
86 timeout {puts "TESTING ERROR 6.1\n";exit}
87 "CapBnd:"
88}
89expect {
90 timeout {puts "TESTING ERROR 6.2\n";exit}
91 "0000000000000000"
92}
93expect {
94 timeout {puts "TESTING ERROR 6.3\n";exit}
95 "name=blablabla"
96}
97after 100
98
99puts "\n"
100