aboutsummaryrefslogtreecommitdiffstats
path: root/test/environment
diff options
context:
space:
mode:
Diffstat (limited to 'test/environment')
-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
12 files changed, 0 insertions, 266 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