diff options
Diffstat (limited to 'test/apps-x11-xorg')
-rwxr-xr-x | test/apps-x11-xorg/apps-x11-xorg.sh | 9 | ||||
-rwxr-xr-x | test/apps-x11-xorg/firefox.exp | 4 | ||||
-rwxr-xr-x | test/apps-x11-xorg/thunderbird.exp | 4 | ||||
-rwxr-xr-x | test/apps-x11-xorg/transmission-gtk.exp | 4 | ||||
-rwxr-xr-x | test/apps-x11-xorg/transmission-qt.exp | 85 |
5 files changed, 100 insertions, 6 deletions
diff --git a/test/apps-x11-xorg/apps-x11-xorg.sh b/test/apps-x11-xorg/apps-x11-xorg.sh index 843fdc50b..568dee85d 100755 --- a/test/apps-x11-xorg/apps-x11-xorg.sh +++ b/test/apps-x11-xorg/apps-x11-xorg.sh | |||
@@ -25,6 +25,15 @@ else | |||
25 | echo "TESTING SKIP: transmission-gtk not found" | 25 | echo "TESTING SKIP: transmission-gtk not found" |
26 | fi | 26 | fi |
27 | 27 | ||
28 | which transmission-qt 2>/dev/null | ||
29 | if [ "$?" -eq 0 ]; | ||
30 | then | ||
31 | echo "TESTING: transmission-qt x11 xorg" | ||
32 | ./transmission-qt.exp | ||
33 | else | ||
34 | echo "TESTING SKIP: transmission-qt not found" | ||
35 | fi | ||
36 | |||
28 | which thunderbird 2>/dev/null | 37 | which thunderbird 2>/dev/null |
29 | if [ "$?" -eq 0 ]; | 38 | if [ "$?" -eq 0 ]; |
30 | then | 39 | then |
diff --git a/test/apps-x11-xorg/firefox.exp b/test/apps-x11-xorg/firefox.exp index 0a43db568..8322e2d0e 100755 --- a/test/apps-x11-xorg/firefox.exp +++ b/test/apps-x11-xorg/firefox.exp | |||
@@ -41,7 +41,7 @@ expect { | |||
41 | sleep 2 | 41 | sleep 2 |
42 | 42 | ||
43 | spawn $env(SHELL) | 43 | spawn $env(SHELL) |
44 | send -- "firemon --seccomp --nowrap\r" | 44 | send -- "firemon --seccomp --wrap\r" |
45 | expect { | 45 | expect { |
46 | timeout {puts "TESTING ERROR 5\n";exit} | 46 | timeout {puts "TESTING ERROR 5\n";exit} |
47 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | 47 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} |
@@ -61,7 +61,7 @@ expect { | |||
61 | "name=blablabla" | 61 | "name=blablabla" |
62 | } | 62 | } |
63 | sleep 1 | 63 | sleep 1 |
64 | send -- "firemon --caps --nowrap\r" | 64 | send -- "firemon --caps --wrap\r" |
65 | expect { | 65 | expect { |
66 | timeout {puts "TESTING ERROR 6\n";exit} | 66 | timeout {puts "TESTING ERROR 6\n";exit} |
67 | " firefox" {puts "firefox detected\n";} | 67 | " firefox" {puts "firefox detected\n";} |
diff --git a/test/apps-x11-xorg/thunderbird.exp b/test/apps-x11-xorg/thunderbird.exp index 8cf0ac244..24549e6c8 100755 --- a/test/apps-x11-xorg/thunderbird.exp +++ b/test/apps-x11-xorg/thunderbird.exp | |||
@@ -38,7 +38,7 @@ expect { | |||
38 | sleep 2 | 38 | sleep 2 |
39 | 39 | ||
40 | spawn $env(SHELL) | 40 | spawn $env(SHELL) |
41 | send -- "firemon --seccomp --nowrap\r" | 41 | send -- "firemon --seccomp --wrap\r" |
42 | expect { | 42 | expect { |
43 | timeout {puts "TESTING ERROR 5\n";exit} | 43 | timeout {puts "TESTING ERROR 5\n";exit} |
44 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | 44 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} |
@@ -57,7 +57,7 @@ expect { | |||
57 | "name=blablabla" | 57 | "name=blablabla" |
58 | } | 58 | } |
59 | sleep 2 | 59 | sleep 2 |
60 | send -- "firemon --caps --nowrap\r" | 60 | send -- "firemon --caps --wrap\r" |
61 | expect { | 61 | expect { |
62 | timeout {puts "TESTING ERROR 6\n";exit} | 62 | timeout {puts "TESTING ERROR 6\n";exit} |
63 | ":firejail" | 63 | ":firejail" |
diff --git a/test/apps-x11-xorg/transmission-gtk.exp b/test/apps-x11-xorg/transmission-gtk.exp index fdbf388e9..b688bc619 100755 --- a/test/apps-x11-xorg/transmission-gtk.exp +++ b/test/apps-x11-xorg/transmission-gtk.exp | |||
@@ -38,7 +38,7 @@ expect { | |||
38 | sleep 2 | 38 | sleep 2 |
39 | 39 | ||
40 | spawn $env(SHELL) | 40 | spawn $env(SHELL) |
41 | send -- "firemon --seccomp --nowrap\r" | 41 | send -- "firemon --seccomp --wrap\r" |
42 | expect { | 42 | expect { |
43 | timeout {puts "TESTING ERROR 5\n";exit} | 43 | timeout {puts "TESTING ERROR 5\n";exit} |
44 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | 44 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} |
@@ -57,7 +57,7 @@ expect { | |||
57 | "name=blablabla" | 57 | "name=blablabla" |
58 | } | 58 | } |
59 | sleep 1 | 59 | sleep 1 |
60 | send -- "firemon --caps --nowrap\r" | 60 | send -- "firemon --caps --wrap\r" |
61 | expect { | 61 | expect { |
62 | timeout {puts "TESTING ERROR 6\n";exit} | 62 | timeout {puts "TESTING ERROR 6\n";exit} |
63 | ":firejail" | 63 | ":firejail" |
diff --git a/test/apps-x11-xorg/transmission-qt.exp b/test/apps-x11-xorg/transmission-qt.exp new file mode 100755 index 000000000..5864bb845 --- /dev/null +++ b/test/apps-x11-xorg/transmission-qt.exp | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2020 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=test --x11=xorg --ignore=net --ignore=netfilter --ignore=iprange transmission-qt\r" | ||
11 | sleep 10 | ||
12 | |||
13 | spawn $env(SHELL) | ||
14 | send -- "firejail --list\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 3\n";exit} | ||
17 | ":firejail" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
21 | "transmission-qt" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | # grsecurity exit | ||
26 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
27 | expect { | ||
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 | |||
33 | send -- "firejail --name=blablabla\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "Child process initialized" | ||
37 | } | ||
38 | sleep 2 | ||
39 | |||
40 | spawn $env(SHELL) | ||
41 | send -- "firemon --seccomp --wrap\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 5\n";exit} | ||
44 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
45 | ":firejail" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5.0\n";exit} | ||
49 | "transmission-qt" | ||
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
53 | "Seccomp: 2" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
57 | "name=blablabla" | ||
58 | } | ||
59 | sleep 1 | ||
60 | send -- "firemon --caps --wrap\r" | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 6\n";exit} | ||
63 | ":firejail" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6.0\n";exit} | ||
67 | "transmission-qt" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
71 | "CapBnd" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
75 | "0000000000000000" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
79 | "name=blablabla" | ||
80 | } | ||
81 | sleep 1 | ||
82 | send -- "firejail --shutdown=test\r" | ||
83 | sleep 3 | ||
84 | |||
85 | puts "\nall done\n" | ||