aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2020-10-05 11:20:43 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2020-10-05 11:20:43 -0400
commita3bf167404043700ec3b561c3c9b1f7a10f35632 (patch)
treed8a55d93cab405ebc4f23196811b64771924c8df /test
parentset as 0.9.64rc2 for development until we release the real one (diff)
downloadfirejail-a3bf167404043700ec3b561c3c9b1f7a10f35632.tar.gz
firejail-a3bf167404043700ec3b561c3c9b1f7a10f35632.tar.zst
firejail-a3bf167404043700ec3b561c3c9b1f7a10f35632.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/appimage/appimage-args.exp4
-rwxr-xr-xtest/appimage/appimage-v1.exp4
-rwxr-xr-xtest/apps-x11-xorg/apps-x11-xorg.sh9
-rwxr-xr-xtest/apps-x11-xorg/firefox.exp4
-rwxr-xr-xtest/apps-x11-xorg/thunderbird.exp4
-rwxr-xr-xtest/apps-x11-xorg/transmission-gtk.exp4
-rwxr-xr-xtest/apps-x11-xorg/transmission-qt.exp85
-rwxr-xr-xtest/filters/seccomp-chmod-profile.exp2
-rwxr-xr-xtest/filters/seccomp-chmod.exp2
-rwxr-xr-xtest/filters/seccomp-run-files.exp4
10 files changed, 108 insertions, 14 deletions
diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp
index 03c7218ac..cee01d509 100755
--- a/test/appimage/appimage-args.exp
+++ b/test/appimage/appimage-args.exp
@@ -56,7 +56,7 @@ expect {
56sleep 2 56sleep 2
57 57
58spawn $env(SHELL) 58spawn $env(SHELL)
59send -- "firemon --seccomp --nowrap\r" 59send -- "firemon --seccomp --wrap\r"
60expect { 60expect {
61 timeout {puts "TESTING ERROR 8\n";exit} 61 timeout {puts "TESTING ERROR 8\n";exit}
62 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 62 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -71,7 +71,7 @@ expect {
71 "name=blablabla" 71 "name=blablabla"
72} 72}
73after 100 73after 100
74send -- "firemon --caps --nowrap\r" 74send -- "firemon --caps --wrap\r"
75expect { 75expect {
76 timeout {puts "TESTING ERROR 11\n";exit} 76 timeout {puts "TESTING ERROR 11\n";exit}
77 "appimage Leafpad" 77 "appimage Leafpad"
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp
index 7b6fa2120..80e228145 100755
--- a/test/appimage/appimage-v1.exp
+++ b/test/appimage/appimage-v1.exp
@@ -44,7 +44,7 @@ expect {
44sleep 2 44sleep 2
45 45
46spawn $env(SHELL) 46spawn $env(SHELL)
47send -- "firemon --seccomp --nowrap\r" 47send -- "firemon --seccomp --wrap\r"
48expect { 48expect {
49 timeout {puts "TESTING ERROR 5\n";exit} 49 timeout {puts "TESTING ERROR 5\n";exit}
50 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 50 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -59,7 +59,7 @@ expect {
59 "name=blablabla" 59 "name=blablabla"
60} 60}
61after 100 61after 100
62send -- "firemon --caps --nowrap\r" 62send -- "firemon --caps --wrap\r"
63expect { 63expect {
64 timeout {puts "TESTING ERROR 6\n";exit} 64 timeout {puts "TESTING ERROR 6\n";exit}
65 "appimage Leafpad" 65 "appimage Leafpad"
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"
26fi 26fi
27 27
28which transmission-qt 2>/dev/null
29if [ "$?" -eq 0 ];
30then
31 echo "TESTING: transmission-qt x11 xorg"
32 ./transmission-qt.exp
33else
34 echo "TESTING SKIP: transmission-qt not found"
35fi
36
28which thunderbird 2>/dev/null 37which thunderbird 2>/dev/null
29if [ "$?" -eq 0 ]; 38if [ "$?" -eq 0 ];
30then 39then
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 {
41sleep 2 41sleep 2
42 42
43spawn $env(SHELL) 43spawn $env(SHELL)
44send -- "firemon --seccomp --nowrap\r" 44send -- "firemon --seccomp --wrap\r"
45expect { 45expect {
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}
63sleep 1 63sleep 1
64send -- "firemon --caps --nowrap\r" 64send -- "firemon --caps --wrap\r"
65expect { 65expect {
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 {
38sleep 2 38sleep 2
39 39
40spawn $env(SHELL) 40spawn $env(SHELL)
41send -- "firemon --seccomp --nowrap\r" 41send -- "firemon --seccomp --wrap\r"
42expect { 42expect {
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}
59sleep 2 59sleep 2
60send -- "firemon --caps --nowrap\r" 60send -- "firemon --caps --wrap\r"
61expect { 61expect {
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 {
38sleep 2 38sleep 2
39 39
40spawn $env(SHELL) 40spawn $env(SHELL)
41send -- "firemon --seccomp --nowrap\r" 41send -- "firemon --seccomp --wrap\r"
42expect { 42expect {
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}
59sleep 1 59sleep 1
60send -- "firemon --caps --nowrap\r" 60send -- "firemon --caps --wrap\r"
61expect { 61expect {
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test --x11=xorg --ignore=net --ignore=netfilter --ignore=iprange transmission-qt\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-qt"
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 --wrap\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
45 ":firejail"
46}
47expect {
48 timeout {puts "TESTING ERROR 5.0\n";exit}
49 "transmission-qt"
50}
51expect {
52 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
53 "Seccomp: 2"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1\n";exit}
57 "name=blablabla"
58}
59sleep 1
60send -- "firemon --caps --wrap\r"
61expect {
62 timeout {puts "TESTING ERROR 6\n";exit}
63 ":firejail"
64}
65expect {
66 timeout {puts "TESTING ERROR 6.0\n";exit}
67 "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}
81sleep 1
82send -- "firejail --shutdown=test\r"
83sleep 3
84
85puts "\nall done\n"
diff --git a/test/filters/seccomp-chmod-profile.exp b/test/filters/seccomp-chmod-profile.exp
index 9b61397ca..22392f882 100755
--- a/test/filters/seccomp-chmod-profile.exp
+++ b/test/filters/seccomp-chmod-profile.exp
@@ -41,7 +41,7 @@ expect {
41send -- "chmod +x testfile; echo done\r" 41send -- "chmod +x testfile; echo done\r"
42expect { 42expect {
43 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
44 "Bad system call" 44 "Operation not permitted"
45} 45}
46expect { 46expect {
47 timeout {puts "TESTING ERROR 6\n";exit} 47 timeout {puts "TESTING ERROR 6\n";exit}
diff --git a/test/filters/seccomp-chmod.exp b/test/filters/seccomp-chmod.exp
index 01b9cbaac..c72a68c82 100755
--- a/test/filters/seccomp-chmod.exp
+++ b/test/filters/seccomp-chmod.exp
@@ -41,7 +41,7 @@ expect {
41send -- "chmod +x testfile; echo done\r" 41send -- "chmod +x testfile; echo done\r"
42expect { 42expect {
43 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
44 "Bad system call" 44 "Operation not permitted"
45} 45}
46expect { 46expect {
47 timeout {puts "TESTING ERROR 6\n";exit} 47 timeout {puts "TESTING ERROR 6\n";exit}
diff --git a/test/filters/seccomp-run-files.exp b/test/filters/seccomp-run-files.exp
index fd3033a69..5f468cf24 100755
--- a/test/filters/seccomp-run-files.exp
+++ b/test/filters/seccomp-run-files.exp
@@ -24,7 +24,7 @@ after 100
24send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r" 24send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r"
25expect { 25expect {
26 timeout {puts "TESTING ERROR 3\n";exit} 26 timeout {puts "TESTING ERROR 3\n";exit}
27 "5" 27 "6"
28} 28}
29send -- "exit\r" 29send -- "exit\r"
30sleep 1 30sleep 1
@@ -90,7 +90,7 @@ after 100
90send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r" 90send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r"
91expect { 91expect {
92 timeout {puts "TESTING ERROR 18\n";exit} 92 timeout {puts "TESTING ERROR 18\n";exit}
93 "6" 93 "8"
94} 94}
95send -- "exit\r" 95send -- "exit\r"
96sleep 1 96sleep 1