diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-19 09:49:09 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-19 09:49:09 -0500 |
commit | d30ae468d925199359aa7c6d4cdec7e9e15587dd (patch) | |
tree | 0d90762b6f55ca8bad2b923d4682f8a337a32600 | |
parent | testing (diff) | |
download | firejail-d30ae468d925199359aa7c6d4cdec7e9e15587dd.tar.gz firejail-d30ae468d925199359aa7c6d4cdec7e9e15587dd.tar.zst firejail-d30ae468d925199359aa7c6d4cdec7e9e15587dd.zip |
testing
-rw-r--r-- | Makefile.in | 7 | ||||
-rwxr-xr-x | test/chroot/chroot-resolvconf.exp (renamed from test/chroot-resolvconf.exp) | 0 | ||||
-rwxr-xr-x | test/chroot/fs_chroot.exp (renamed from test/fs_chroot.exp) | 0 | ||||
-rwxr-xr-x | test/environment/environment.sh | 15 | ||||
-rwxr-xr-x | test/environment/rlimit-bad-profile.exp | 35 | ||||
-rwxr-xr-x | test/environment/rlimit-bad.exp | 34 | ||||
-rw-r--r-- | test/environment/rlimit-bad1.profile | 1 | ||||
-rw-r--r-- | test/environment/rlimit-bad2.profile | 1 | ||||
-rw-r--r-- | test/environment/rlimit-bad3.profile | 1 | ||||
-rw-r--r-- | test/environment/rlimit-bad4.profile | 1 | ||||
-rwxr-xr-x | test/environment/rlimit-profile.exp (renamed from test/rlimit/rlimit-profile.exp) | 0 | ||||
-rwxr-xr-x | test/environment/rlimit.exp (renamed from test/rlimit/rlimit.exp) | 0 | ||||
-rw-r--r-- | test/environment/rlimit.profile (renamed from test/rlimit/rlimit.profile) | 0 | ||||
-rwxr-xr-x | test/rlimit/rlimit.sh | 14 |
14 files changed, 90 insertions, 19 deletions
diff --git a/Makefile.in b/Makefile.in index 6501989a9..772dc8c06 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -147,7 +147,7 @@ uninstall: | |||
147 | rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg | 147 | rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg |
148 | 148 | ||
149 | DISTFILES = "src etc platform configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES" | 149 | DISTFILES = "src etc platform configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES" |
150 | DISTFILES_TEST = "test/rlimit test/apps test/apps-x11 test/apps-x11-xorg test/root test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils" | 150 | DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/root test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils" |
151 | 151 | ||
152 | dist: | 152 | dist: |
153 | mv config.status config.status.old | 153 | mv config.status config.status.old |
@@ -225,13 +225,10 @@ test-arguments: | |||
225 | test-fs: | 225 | test-fs: |
226 | cd test/fs; ./fs.sh | grep TESTING | 226 | cd test/fs; ./fs.sh | grep TESTING |
227 | 227 | ||
228 | test-rlimit: | ||
229 | cd test/rlimit; ./rlimit.sh | grep TESTING | ||
230 | |||
231 | test-fcopy: | 228 | test-fcopy: |
232 | cd test/fcopy; ./fcopy.sh | grep TESTING | 229 | cd test/fcopy; ./fcopy.sh | grep TESTING |
233 | 230 | ||
234 | test: test-profiles test-fcopy test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments test-rlimit | 231 | test: test-profiles test-fcopy test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments |
235 | echo "TEST COMPLETE" | 232 | echo "TEST COMPLETE" |
236 | 233 | ||
237 | ########################################## | 234 | ########################################## |
diff --git a/test/chroot-resolvconf.exp b/test/chroot/chroot-resolvconf.exp index 2d0da2fb0..2d0da2fb0 100755 --- a/test/chroot-resolvconf.exp +++ b/test/chroot/chroot-resolvconf.exp | |||
diff --git a/test/fs_chroot.exp b/test/chroot/fs_chroot.exp index aeb5669e1..aeb5669e1 100755 --- a/test/fs_chroot.exp +++ b/test/chroot/fs_chroot.exp | |||
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index c2a6c435a..2bb5a249e 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -95,4 +95,19 @@ if [ "$?" -eq 0 ]; | |||
95 | then | 95 | then |
96 | echo "TESTING: ibus (test/environment/ibus.exp)" | 96 | echo "TESTING: ibus (test/environment/ibus.exp)" |
97 | ./ibus.exp | 97 | ./ibus.exp |
98 | else | ||
99 | echo "TESTING SKIP: ibus not configured" | ||
98 | fi | 100 | fi |
101 | |||
102 | echo "TESTING: rlimit (test/rlimit/rlimit.exp)" | ||
103 | ./rlimit.exp | ||
104 | |||
105 | echo "TESTING: rlimit profile (test/rlimit/rlimit-profile.exp)" | ||
106 | ./rlimit-profile.exp | ||
107 | |||
108 | echo "TESTING: rlimit errors (test/rlimit/rlimit-bad.exp)" | ||
109 | ./rlimit-bad.exp | ||
110 | |||
111 | echo "TESTING: rlimit errors profile (test/rlimit/rlimit-bad-profile.exp)" | ||
112 | ./rlimit-bad-profile.exp | ||
113 | |||
diff --git a/test/environment/rlimit-bad-profile.exp b/test/environment/rlimit-bad-profile.exp new file mode 100755 index 000000000..80693a4a0 --- /dev/null +++ b/test/environment/rlimit-bad-profile.exp | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | |||
8 | send -- "firejail --profile=rlimit-bad1.profile\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 4\n";exit} | ||
11 | "Invalid rlimit option" | ||
12 | } | ||
13 | after 100 | ||
14 | |||
15 | send -- "firejail --profile=rlimit-bad2.profile\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 5\n";exit} | ||
18 | "Invalid rlimit option" | ||
19 | } | ||
20 | after 100 | ||
21 | |||
22 | send -- "firejail --profile=rlimit-bad3.profile\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 6\n";exit} | ||
25 | "Invalid rlimit option" | ||
26 | } | ||
27 | after 100 | ||
28 | send -- "firejail --profile=rlimit-bad4.profile\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 7\n";exit} | ||
31 | "Invalid rlimit option" | ||
32 | } | ||
33 | after 100 | ||
34 | |||
35 | puts "\nall done\n" | ||
diff --git a/test/environment/rlimit-bad.exp b/test/environment/rlimit-bad.exp new file mode 100755 index 000000000..574e7e174 --- /dev/null +++ b/test/environment/rlimit-bad.exp | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --rlimit-fsize=-1024\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "invalid rlimt fsize" | ||
11 | } | ||
12 | after 100 | ||
13 | |||
14 | send -- "firejail --rlimit-nofile=asdf\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "invalid rlimt nofile" | ||
18 | } | ||
19 | after 100 | ||
20 | |||
21 | send -- "firejail --rlimit-nproc=100.23\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | "invalid rlimt nproc" | ||
25 | } | ||
26 | after 100 | ||
27 | send -- "firejail --rlimit-sigpending=2345-78\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 3\n";exit} | ||
30 | "invalid rlimt sigpending" | ||
31 | } | ||
32 | after 100 | ||
33 | |||
34 | puts "\nall done\n" | ||
diff --git a/test/environment/rlimit-bad1.profile b/test/environment/rlimit-bad1.profile new file mode 100644 index 000000000..b6d3340d8 --- /dev/null +++ b/test/environment/rlimit-bad1.profile | |||
@@ -0,0 +1 @@ | |||
rlimit-fsize -1024 | |||
diff --git a/test/environment/rlimit-bad2.profile b/test/environment/rlimit-bad2.profile new file mode 100644 index 000000000..ef3f243c6 --- /dev/null +++ b/test/environment/rlimit-bad2.profile | |||
@@ -0,0 +1 @@ | |||
rlimit-nofile asdf | |||
diff --git a/test/environment/rlimit-bad3.profile b/test/environment/rlimit-bad3.profile new file mode 100644 index 000000000..af016a29f --- /dev/null +++ b/test/environment/rlimit-bad3.profile | |||
@@ -0,0 +1 @@ | |||
rlimit-nproc 100.23 | |||
diff --git a/test/environment/rlimit-bad4.profile b/test/environment/rlimit-bad4.profile new file mode 100644 index 000000000..aabe3d008 --- /dev/null +++ b/test/environment/rlimit-bad4.profile | |||
@@ -0,0 +1 @@ | |||
rlimit-sigpending 67asd56 \ No newline at end of file | |||
diff --git a/test/rlimit/rlimit-profile.exp b/test/environment/rlimit-profile.exp index a9e54a405..a9e54a405 100755 --- a/test/rlimit/rlimit-profile.exp +++ b/test/environment/rlimit-profile.exp | |||
diff --git a/test/rlimit/rlimit.exp b/test/environment/rlimit.exp index 611f69821..611f69821 100755 --- a/test/rlimit/rlimit.exp +++ b/test/environment/rlimit.exp | |||
diff --git a/test/rlimit/rlimit.profile b/test/environment/rlimit.profile index 271891c03..271891c03 100644 --- a/test/rlimit/rlimit.profile +++ b/test/environment/rlimit.profile | |||
diff --git a/test/rlimit/rlimit.sh b/test/rlimit/rlimit.sh deleted file mode 100755 index d85497176..000000000 --- a/test/rlimit/rlimit.sh +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | |||
9 | echo "TESTING: rlimit (test/rlimit/rlimit.exp)" | ||
10 | ./rlimit.exp | ||
11 | |||
12 | echo "TESTING: rlimit profile (test/rlimit/rlimit-profile.exp)" | ||
13 | ./rlimit-profile.exp | ||
14 | |||