diff options
Diffstat (limited to 'test/rlimit')
-rwxr-xr-x | test/rlimit/rlimit-profile.exp | 33 | ||||
-rwxr-xr-x | test/rlimit/rlimit.exp | 37 | ||||
-rw-r--r-- | test/rlimit/rlimit.profile | 4 |
3 files changed, 74 insertions, 0 deletions
diff --git a/test/rlimit/rlimit-profile.exp b/test/rlimit/rlimit-profile.exp new file mode 100755 index 000000000..a9e54a405 --- /dev/null +++ b/test/rlimit/rlimit-profile.exp | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | #cd /home | ||
5 | spawn $env(SHELL) | ||
6 | match_max 100000 | ||
7 | |||
8 | send -- "firejail --profile=rlimit.profile\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "cat /proc/self/limits\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
18 | "Max file size 1024 1024" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
22 | "Max processes 1000 1000" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
26 | "Max open files 500 500" | ||
27 | } | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
30 | "Max pending signals 200 200" | ||
31 | } | ||
32 | after 100 | ||
33 | puts "\nall done\n" | ||
diff --git a/test/rlimit/rlimit.exp b/test/rlimit/rlimit.exp new file mode 100755 index 000000000..611f69821 --- /dev/null +++ b/test/rlimit/rlimit.exp | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | cd /home | ||
5 | spawn $env(SHELL) | ||
6 | match_max 100000 | ||
7 | |||
8 | send -- "firejail --rlimit-fsize=1024 --rlimit-nproc=1000 --rlimit-nofile=500 --rlimit-sigpending=200\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "cat /proc/self/limits; pwd\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
18 | "Max file size 1024 1024" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
22 | "Max processes 1000 1000" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
26 | "Max open files 500 500" | ||
27 | } | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
30 | "Max pending signals 200 200" | ||
31 | } | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
34 | "home" | ||
35 | } | ||
36 | after 100 | ||
37 | puts "\n" | ||
diff --git a/test/rlimit/rlimit.profile b/test/rlimit/rlimit.profile new file mode 100644 index 000000000..271891c03 --- /dev/null +++ b/test/rlimit/rlimit.profile | |||
@@ -0,0 +1,4 @@ | |||
1 | rlimit-fsize 1024 | ||
2 | rlimit-nproc 1000 | ||
3 | rlimit-nofile 500 | ||
4 | rlimit-sigpending 200 \ No newline at end of file | ||