aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-08-21 08:30:09 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2018-08-21 08:30:09 -0400
commited83ad0ed67f3c753f51b186df756c65fdb8ced2 (patch)
treeac5bc2995203a4aa6b3525c7bced639629ea2869 /test
parentremoved --output, --trace, --tracelog (diff)
downloadfirejail-ed83ad0ed67f3c753f51b186df756c65fdb8ced2.tar.gz
firejail-ed83ad0ed67f3c753f51b186df756c65fdb8ced2.tar.zst
firejail-ed83ad0ed67f3c753f51b186df756c65fdb8ced2.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/environment/environment.sh14
-rwxr-xr-xtest/environment/output.exp87
-rwxr-xr-xtest/environment/output.sh9
-rwxr-xr-xtest/environment/rlimit-bad-profile.exp35
-rwxr-xr-xtest/environment/rlimit-bad.exp34
-rw-r--r--test/environment/rlimit-bad1.profile1
-rw-r--r--test/environment/rlimit-bad2.profile1
-rw-r--r--test/environment/rlimit-bad3.profile1
-rw-r--r--test/environment/rlimit-bad4.profile1
-rwxr-xr-xtest/environment/rlimit-profile.exp37
-rwxr-xr-xtest/environment/rlimit.exp41
-rw-r--r--test/environment/rlimit.profile5
-rwxr-xr-xtest/fs/fs.sh6
-rwxr-xr-xtest/fs/private-etc-empty.exp42
-rw-r--r--test/fs/private-etc-empty.profile1
-rwxr-xr-xtest/fs/private-etc.exp72
-rwxr-xr-xtest/utils/trace.exp115
-rwxr-xr-xtest/utils/utils.sh5
18 files changed, 0 insertions, 507 deletions
diff --git a/test/environment/environment.sh b/test/environment/environment.sh
index 97ba8ba58..36811ba07 100755
--- a/test/environment/environment.sh
+++ b/test/environment/environment.sh
@@ -26,9 +26,6 @@ cp -- /bin/bash -testdir/.
26./doubledash.exp 26./doubledash.exp
27rm -fr -- -testdir 27rm -fr -- -testdir
28 28
29echo "TESTING: output (test/environment/output.exp)"
30./output.exp
31
32echo "TESTING: extract command (extract_command.exp)" 29echo "TESTING: extract command (extract_command.exp)"
33./extract_command.exp 30./extract_command.exp
34 31
@@ -105,14 +102,3 @@ else
105 echo "TESTING SKIP: ibus not configured" 102 echo "TESTING SKIP: ibus not configured"
106fi 103fi
107 104
108echo "TESTING: rlimit (test/environment/rlimit.exp)"
109./rlimit.exp
110
111echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)"
112./rlimit-profile.exp
113
114echo "TESTING: rlimit errors (test/environment/rlimit-bad.exp)"
115./rlimit-bad.exp
116
117echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)"
118./rlimit-bad-profile.exp
diff --git a/test/environment/output.exp b/test/environment/output.exp
deleted file mode 100755
index d175ddae2..000000000
--- a/test/environment/output.exp
+++ /dev/null
@@ -1,87 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "rm -f logfile*\r"
8sleep 1
9puts "\n"
10
11send -- "firejail --output=logfile -- ./output.sh\r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "20000"
15}
16expect {
17 timeout {puts "TESTING ERROR 1.1\n";exit}
18 "60000"
19}
20expect {
21 timeout {puts "TESTING ERROR 1.2\n";exit}
22 "100000"
23}
24expect {
25 timeout {puts "TESTING ERROR 1.3\n";exit}
26 "120000"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.4\n";exit}
30 "14999"
31}
32sleep 2
33puts "\n"
34
35
36set timeout 2
37send -- "ls -al logfile*\r"
38expect {
39 timeout {puts "TESTING ERROR 2\n";exit}
40 "logfile"
41}
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "logfile.1"
45}
46expect {
47 timeout {puts "TESTING ERROR 4\n";exit}
48 "logfile.2"
49}
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "logfile.3"
53}
54expect {
55 timeout {puts "TESTING ERROR 6\n";exit}
56 "logfile.4"
57}
58expect {
59 timeout {puts "TESTING ERROR 7\n";exit}
60 "logfile.5"
61}
62after 100
63send -- "rm -f logfile*\r"
64
65
66send -- "firejail --output=../logfile -- ./output.sh\r"
67expect {
68 timeout {puts "TESTING ERROR 8\n";exit}
69 "invalid output file"
70}
71after 100
72
73send -- "firejail --output=/etc -- ./output.sh\r"
74expect {
75 timeout {puts "TESTING ERROR 9\n";exit}
76 "invalid output file"
77}
78after 100
79
80send -- "firejail --output=/etc/firejail/zoom.profile -- ./output.sh\r"
81expect {
82 timeout {puts "TESTING ERROR 10\n";exit}
83 "the output file needs to be owned by the current user"
84}
85
86after 100
87puts "\nall done\n"
diff --git a/test/environment/output.sh b/test/environment/output.sh
deleted file mode 100755
index 2be188e3a..000000000
--- a/test/environment/output.sh
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/bash
2
3i="0"
4
5while [ $i -lt 150000 ]
6do
7 echo message number $i
8 i=$[$i+1]
9done
diff --git a/test/environment/rlimit-bad-profile.exp b/test/environment/rlimit-bad-profile.exp
deleted file mode 100755
index cd77402fd..000000000
--- a/test/environment/rlimit-bad-profile.exp
+++ /dev/null
@@ -1,35 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7
8send -- "firejail --profile=rlimit-bad1.profile\r"
9expect {
10 timeout {puts "TESTING ERROR 4\n";exit}
11 "invalid rlimit"
12}
13after 100
14
15send -- "firejail --profile=rlimit-bad2.profile\r"
16expect {
17 timeout {puts "TESTING ERROR 5\n";exit}
18 "invalid rlimit"
19}
20after 100
21
22send -- "firejail --profile=rlimit-bad3.profile\r"
23expect {
24 timeout {puts "TESTING ERROR 6\n";exit}
25 "invalid rlimit"
26}
27after 100
28send -- "firejail --profile=rlimit-bad4.profile\r"
29expect {
30 timeout {puts "TESTING ERROR 7\n";exit}
31 "invalid rlimit"
32}
33after 100
34
35puts "\nall done\n"
diff --git a/test/environment/rlimit-bad.exp b/test/environment/rlimit-bad.exp
deleted file mode 100755
index 0a2fe9c98..000000000
--- a/test/environment/rlimit-bad.exp
+++ /dev/null
@@ -1,34 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --rlimit-fsize=-1024\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "invalid rlimit"
11}
12after 100
13
14send -- "firejail --rlimit-nofile=asdf\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "invalid rlimit"
18}
19after 100
20
21send -- "firejail --rlimit-nproc=100.23\r"
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 "invalid rlimit"
25}
26after 100
27send -- "firejail --rlimit-sigpending=2345-78\r"
28expect {
29 timeout {puts "TESTING ERROR 3\n";exit}
30 "invalid rlimit"
31}
32after 100
33
34puts "\nall done\n"
diff --git a/test/environment/rlimit-bad1.profile b/test/environment/rlimit-bad1.profile
deleted file mode 100644
index b6d3340d8..000000000
--- a/test/environment/rlimit-bad1.profile
+++ /dev/null
@@ -1 +0,0 @@
1rlimit-fsize -1024
diff --git a/test/environment/rlimit-bad2.profile b/test/environment/rlimit-bad2.profile
deleted file mode 100644
index ef3f243c6..000000000
--- a/test/environment/rlimit-bad2.profile
+++ /dev/null
@@ -1 +0,0 @@
1rlimit-nofile asdf
diff --git a/test/environment/rlimit-bad3.profile b/test/environment/rlimit-bad3.profile
deleted file mode 100644
index af016a29f..000000000
--- a/test/environment/rlimit-bad3.profile
+++ /dev/null
@@ -1 +0,0 @@
1rlimit-nproc 100.23
diff --git a/test/environment/rlimit-bad4.profile b/test/environment/rlimit-bad4.profile
deleted file mode 100644
index 6156b34a7..000000000
--- a/test/environment/rlimit-bad4.profile
+++ /dev/null
@@ -1 +0,0 @@
1rlimit-sigpending 67asd56
diff --git a/test/environment/rlimit-profile.exp b/test/environment/rlimit-profile.exp
deleted file mode 100755
index 43d6a3ee0..000000000
--- a/test/environment/rlimit-profile.exp
+++ /dev/null
@@ -1,37 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4#cd /home
5spawn $env(SHELL)
6match_max 100000
7
8send -- "firejail --profile=rlimit.profile\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "cat /proc/self/limits\r"
16expect {
17 timeout {puts "TESTING ERROR 1.1\n";exit}
18 "Max file size 1024 1024"
19}
20expect {
21 timeout {puts "TESTING ERROR 1.2\n";exit}
22 "Max processes 1000 1000"
23}
24expect {
25 timeout {puts "TESTING ERROR 1.3\n";exit}
26 "Max open files 500 500"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.4\n";exit}
30 "Max address space 123456789012 123456789012"
31}
32expect {
33 timeout {puts "TESTING ERROR 1.5\n";exit}
34 "Max pending signals 200 200"
35}
36after 100
37puts "\nall done\n"
diff --git a/test/environment/rlimit.exp b/test/environment/rlimit.exp
deleted file mode 100755
index 38cdc3eea..000000000
--- a/test/environment/rlimit.exp
+++ /dev/null
@@ -1,41 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4cd /home
5spawn $env(SHELL)
6match_max 100000
7
8send -- "firejail --rlimit-fsize=1024 --rlimit-nproc=1000 --rlimit-nofile=500 --rlimit-sigpending=200 --rlimit-as=123456789012\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "cat /proc/self/limits; pwd\r"
16expect {
17 timeout {puts "TESTING ERROR 1.1\n";exit}
18 "Max file size 1024 1024"
19}
20expect {
21 timeout {puts "TESTING ERROR 1.2\n";exit}
22 "Max processes 1000 1000"
23}
24expect {
25 timeout {puts "TESTING ERROR 1.3\n";exit}
26 "Max open files 500 500"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.4\n";exit}
30 "Max address space 123456789012 123456789012"
31}
32expect {
33 timeout {puts "TESTING ERROR 1.5\n";exit}
34 "Max pending signals 200 200"
35}
36expect {
37 timeout {puts "TESTING ERROR 1.6\n";exit}
38 "home"
39}
40after 100
41puts "\nall done\n"
diff --git a/test/environment/rlimit.profile b/test/environment/rlimit.profile
deleted file mode 100644
index a57471604..000000000
--- a/test/environment/rlimit.profile
+++ /dev/null
@@ -1,5 +0,0 @@
1 rlimit-fsize 1024
2rlimit-nproc 1000
3 rlimit-nofile 500
4rlimit-sigpending 200
5rlimit-as 123456789012
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index 28f7185da..b4d2cf9c2 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -43,12 +43,6 @@ echo "TESTING: private home dir (test/fs/private-home-dir.exp)"
43echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)" 43echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)"
44./private-homedir.exp 44./private-homedir.exp
45 45
46echo "TESTING: private-etc (test/fs/private-etc.exp)"
47./private-etc.exp
48
49echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)"
50./private-etc-empty.exp
51
52echo "TESTING: macros (test/fs/macro..exp)" 46echo "TESTING: macros (test/fs/macro..exp)"
53./macro.exp 47./macro.exp
54 48
diff --git a/test/fs/private-etc-empty.exp b/test/fs/private-etc-empty.exp
deleted file mode 100755
index 8506b664c..000000000
--- a/test/fs/private-etc-empty.exp
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --private-etc=blablabla\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "ls -l /etc | wc -l\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "0" {puts "Debian\n"}
21 "1" {puts "Arch\n"}
22}
23send -- "exit\r"
24sleep 1
25
26send -- "firejail --profile=private-etc-empty.profile\r"
27expect {
28 timeout {puts "TESTING ERROR 0\n";exit}
29 "Child process initialized"
30}
31sleep 1
32
33send -- "ls -l /etc | wc -l\r"
34expect {
35 timeout {puts "TESTING ERROR 1\n";exit}
36 "0" {puts "Debian\n"}
37 "1" {puts "Arch\n"}
38
39}
40
41after 100
42puts "\nall done\n"
diff --git a/test/fs/private-etc-empty.profile b/test/fs/private-etc-empty.profile
deleted file mode 100644
index 38aa8cd68..000000000
--- a/test/fs/private-etc-empty.profile
+++ /dev/null
@@ -1 +0,0 @@
1private-etc blablabla
diff --git a/test/fs/private-etc.exp b/test/fs/private-etc.exp
deleted file mode 100755
index 5edaacd25..000000000
--- a/test/fs/private-etc.exp
+++ /dev/null
@@ -1,72 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# directory with ~
11send -- "firejail --private-etc=passwd,group,resolv.conf,X11\r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 1
17
18send -- "LC_ALL=C ls -al /etc\r"
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "X11"
22}
23expect {
24 timeout {puts "TESTING ERROR 4\n";exit}
25 "group"
26}
27expect {
28 timeout {puts "TESTING ERROR 5\n";exit}
29 "passwd"
30}
31expect {
32 timeout {puts "TESTING ERROR 6\n";exit}
33 "resolv.conf"
34}
35
36
37send -- "file /etc/shadow\r"
38expect {
39 timeout {puts "TESTING ERROR 7\n";exit}
40 "No such file or directory"
41}
42after 100
43send -- "exit\r"
44sleep 1
45
46send -- "firejail --private-etc=shadow\r"
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "invalid file type"
50}
51after 100
52
53send -- "firejail --private-etc=\"bla;bla\"\r"
54expect {
55 timeout {puts "TESTING ERROR 9\n";exit}
56 "is an invalid filename"
57}
58after 100
59
60send -- "firejail --private-etc=../bin/ls\r"
61expect {
62 timeout {puts "TESTING ERROR 10\n";exit}
63 "is an invalid filename"
64}
65after 100
66
67
68
69
70
71after 100
72puts "\nall done\n"
diff --git a/test/utils/trace.exp b/test/utils/trace.exp
deleted file mode 100755
index 37c0b0f30..000000000
--- a/test/utils/trace.exp
+++ /dev/null
@@ -1,115 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 30
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --trace mkdir ttt\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "mkdir:mkdir ttt"
18}
19sleep 1
20
21send -- "firejail --trace rmdir ttt\r"
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 "Child process initialized"
25}
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "rmdir:rmdir ttt"
29}
30sleep 1
31
32send -- "firejail --trace touch ttt\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "Child process initialized"
36}
37expect {
38 timeout {puts "TESTING ERROR 5\n";exit}
39 "touch:open ttt" {puts "OK\n";}
40 "touch:open64 ttt" {puts "OK\n";}
41}
42sleep 1
43
44send -- "firejail --trace rm ttt\r"
45expect {
46 timeout {puts "TESTING ERROR 6\n";exit}
47 "Child process initialized"
48}
49expect {
50 timeout {puts "TESTING ERROR 7\n";exit}
51 "rm:unlinkat ttt"
52}
53sleep 1
54
55send -- "firejail --trace wget -q debian.org\r"
56#expect {
57# timeout {puts "TESTING ERROR 8.1\n";exit}
58# "Child process initialized"
59#}
60#expect {
61# timeout {puts "TESTING ERROR 8.2\n";exit}
62# "bash:open /dev/tty" {puts "OK\n";}
63# "bash:open64 /dev/tty" {puts "OK\n";}
64#}
65expect {
66 timeout {puts "TESTING ERROR 8.3\n";exit}
67 "wget:fopen64 /etc/wgetrc" {puts "OK\n";}
68 "wget:fopen /etc/wgetrc" {puts "OK\n";}
69}
70expect {
71 timeout {puts "TESTING ERROR 8.4\n";exit}
72 "wget:fopen /etc/hosts"
73}
74expect {
75 timeout {puts "TESTING ERROR 8.5\n";exit}
76 "wget:connect"
77}
78expect {
79 timeout {puts "TESTING ERROR 8.6\n";exit}
80 "wget:fopen64 index.html" {puts "OK\n";}
81 "wget:fopen index.html" {puts "OK\n";}
82 "Parent is shutting down" {puts "OK\n";}
83}
84sleep 1
85
86send -- "firejail --trace rm index.html\r"
87expect {
88 timeout {puts "TESTING ERROR 9\n";exit}
89 "Child process initialized"
90}
91expect {
92 timeout {puts "TESTING ERROR 10\n";exit}
93 "rm:unlinkat index.html" {puts "OK\n";}
94 "Parent is shutting down" {puts "OK\n";}
95}
96sleep 1
97
98send -- "firejail --trace\r"
99expect {
100 timeout {puts "TESTING ERROR 11\n";exit}
101 "Child process initialized"
102}
103expect {
104 timeout {puts "TESTING ERROR 12\n";exit}
105 "bash:open /dev/tty" {puts "64bit\n"}
106 "bash:open64 /dev/tty" {puts "32bit\n"}
107}
108expect {
109 timeout {puts "TESTING ERROR 13\n";exit}
110 "bash:access /etc/terminfo/" {puts "debian\n"}
111 "bash:access /usr/share/terminfo/" {puts "arch\n"}
112}
113after 100
114
115puts "\nall done\n"
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index 82d00007b..f12698f0a 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -92,11 +92,6 @@ echo "TESTING: join3 (test/utils/join4.exp)"
92echo "TESTING: join profile (test/utils/join-profile.exp)" 92echo "TESTING: join profile (test/utils/join-profile.exp)"
93./join-profile.exp 93./join-profile.exp
94 94
95echo "TESTING: trace (test/utils/trace.exp)"
96rm -f index.html*
97./trace.exp
98rm -f index.html*
99
100echo "TESTING: top (test/utils/top.exp)" 95echo "TESTING: top (test/utils/top.exp)"
101./top.exp 96./top.exp
102 97