aboutsummaryrefslogtreecommitdiffstats
path: root/test/apps-x11/x11-xephyr.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/apps-x11/x11-xephyr.exp')
-rwxr-xr-xtest/apps-x11/x11-xephyr.exp59
1 files changed, 59 insertions, 0 deletions
diff --git a/test/apps-x11/x11-xephyr.exp b/test/apps-x11/x11-xephyr.exp
new file mode 100755
index 000000000..41a413890
--- /dev/null
+++ b/test/apps-x11/x11-xephyr.exp
@@ -0,0 +1,59 @@
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=xephyr xterm\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15
16exit
17
18
19sleep 5
20
21
22expect {
23 timeout {puts "TESTING ERROR 0\n";exit}
24 "use network namespace in firejail"
25}
26sleep 1
27
28send -- "firejail --name=test --net=none --x11=none\r"
29expect {
30 timeout {puts "TESTING ERROR 1\n";exit}
31 "Child process initialized"
32}
33sleep 1
34
35send -- "ls -al /tmp/.X11-unix\r"
36expect {
37 timeout {puts "TESTING ERROR 2\n";exit}
38 "cannot open directory"
39}
40after 100
41
42send -- "xterm\r"
43expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "DISPLAY is not set"
46}
47after 100
48
49send -- "export DISPLAY=:0.0\r"
50after 100
51send -- "xterm\r"
52expect {
53 timeout {puts "TESTING ERROR 4\n";exit}
54 "Xt error"
55}
56after 100
57
58puts "\nall done\n"
59