aboutsummaryrefslogtreecommitdiffstats
path: root/test/stress/stress.sh
blob: 6a140ab22658b2a77faa46f1918147ebcab8bcc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# This file is part of Firejail project
# Copyright (C) 2014-2017 Firejail Authors
# License GPL v2

export MALLOC_CHECK_=3
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))


# blacklist testing
rm -fr ~/fj-stress-test
mkdir ~/fj-stress-test
rm blacklist.profile
rm noblacklist.profile
rm env.profile
for i in `seq 1 100`;
do
	echo "hello" > ~/fj-stress-test/testfile$i
	echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile
	echo "blacklist \${PATH}/sh" >> blacklist.profile
	echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile
	echo "noblacklist \${PATH}/sh" >> noblacklist.profile
	echo "env FJSTRESS$i=stress" >> env.profile
done
echo "include blacklist.profile" >> noblacklist.profile

echo "TESTING: stress blacklist/noblacklist (/test/stress/blacklist.exp)"
./blacklist.exp

echo "TESTING: stress env (/test/stress/env.exp)"
./env.exp

rm -fr ~/fj-stress-test

rm blacklist.profile
rm noblacklist.profile
rm env.profile

# network arp testing
echo "TESTING: macvlan (test/stress/net_macvlan.exp)"
./net_macvlan.exp