aboutsummaryrefslogtreecommitdiffstats
path: root/test/stress
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-02-28 09:51:26 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-02-28 09:51:26 -0500
commit27c4d069f322fbeca07c88e0e96208233103a5db (patch)
treefb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test/stress
parentfix cppcheck/scan-build problems (diff)
downloadfirejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.gz
firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.zst
firejail-27c4d069f322fbeca07c88e0e96208233103a5db.zip
chroot testing
Diffstat (limited to 'test/stress')
-rwxr-xr-xtest/stress/blacklist.exp59
-rwxr-xr-xtest/stress/env.exp31
-rwxr-xr-xtest/stress/net_macvlan.exp51
-rwxr-xr-xtest/stress/stress.sh42
4 files changed, 0 insertions, 183 deletions
diff --git a/test/stress/blacklist.exp b/test/stress/blacklist.exp
deleted file mode 100755
index 3c6801b99..000000000
--- a/test/stress/blacklist.exp
+++ /dev/null
@@ -1,59 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10set MAXi 100
11
12# blacklist testing
13set i 1
14send -- "firejail --profile=blacklist.profile\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
18}
19
20while { $i <= $MAXi } {
21 send -- "cat ~/fj-stress-test/testfile$i\r"
22 expect {
23 timeout {puts "TESTING ERROR 1\n";exit}
24 "denied"
25 }
26 incr i
27 after 100
28}
29after 100
30
31send -- "exit\r"
32sleep 1
33
34# noblacklist testing
35set i 1
36send -- "firejail --profile=noblacklist.profile\r"
37expect {
38 timeout {puts "TESTING ERROR 1\n";exit}
39 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
40}
41
42while { $i <= $MAXi } {
43 send -- "cat ~/fj-stress-test/testfile$i\r"
44 expect {
45 timeout {puts "TESTING ERROR 1\n";exit}
46 "hello"
47 }
48 incr i
49 after 100
50}
51after 100
52
53send -- "exit\r"
54sleep 1
55
56
57
58after 100
59puts "\nall done\n"
diff --git a/test/stress/env.exp b/test/stress/env.exp
deleted file mode 100755
index 66e2d8374..000000000
--- a/test/stress/env.exp
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# env testing
11send -- "firejail --profile=env.profile\r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
15}
16
17send -- "env | grep FJSTRESS77\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "FJSTRESS77=stress"
21}
22
23send -- "env | grep FJSTRESS | wc -l\r"
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "100"
27}
28
29send -- "exit\r"
30after 100
31puts "\nall done\n"
diff --git a/test/stress/net_macvlan.exp b/test/stress/net_macvlan.exp
deleted file mode 100755
index 6471979e9..000000000
--- a/test/stress/net_macvlan.exp
+++ /dev/null
@@ -1,51 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# grab 10 ip addresses
11set MAXi 210
12set i 201
13while { $i <= $MAXi } {
14 spawn $env(SHELL)
15 send -- "firejail --net=eth0 --ip=192.168.1.$i\r"
16 expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
19 }
20 incr i
21 after 100
22}
23
24
25# grab 10 more
26set MAXi 210
27set i 201
28while { $i <= $MAXi } {
29 spawn $env(SHELL)
30 send -- "firejail --net=eth0 --iprange=192.168.1.201,192.168.1.220\r"
31 expect {
32 timeout {puts "TESTING ERROR 2\n";exit}
33 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
34 }
35 puts "************ $i ******************\n"
36 incr i
37 after 100
38}
39
40# the next one should fail, all 20 addresses are in use
41spawn $env(SHELL)
42send -- "firejail --debug --net=eth0 --iprange=192.168.1.201,192.168.1.220\r"
43expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "cannot assign an IP address"
46}
47
48
49
50after 100
51puts "\nall done\n"
diff --git a/test/stress/stress.sh b/test/stress/stress.sh
deleted file mode 100755
index 9db7ac9d3..000000000
--- a/test/stress/stress.sh
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10
11# blacklist testing
12rm -fr ~/fj-stress-test
13mkdir ~/fj-stress-test
14rm blacklist.profile
15rm noblacklist.profile
16rm env.profile
17for i in {1..100}
18do
19 echo "hello" > ~/fj-stress-test/testfile$i
20 echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile
21 echo "blacklist \${PATH}/sh" >> blacklist.profile
22 echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile
23 echo "noblacklist \${PATH}/sh" >> noblacklist.profile
24 echo "env FJSTRESS$i=stress" >> env.profile
25done
26echo "include blacklist.profile" >> noblacklist.profile
27
28echo "TESTING: stress blacklist/noblacklist (/test/stress/blacklist.exp)"
29./blacklist.exp
30
31echo "TESTING: stress env (/test/stress/env.exp)"
32./env.exp
33
34rm -fr ~/fj-stress-test
35
36rm blacklist.profile
37rm noblacklist.profile
38rm env.profile
39
40# network arp testing
41echo "TESTING: macvlan (test/stress/net_macvlan.exp)"
42./net_macvlan.exp