environment.sh 2.65 KB
Newer Older
netblue30's avatar
netblue30 committed
1 2
#!/bin/bash
# This file is part of Firejail project
3
# Copyright (C) 2014-2019 Firejail Authors
netblue30's avatar
netblue30 committed
4 5 6 7 8
# License GPL v2

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

netblue30's avatar
netblue30 committed
9

10 11 12
echo "TESTING: timeout (test/environment/timeout.exp)"
./timeout.exp

netblue30's avatar
netblue30 committed
13 14 15
echo "TESTING: DNS (test/environment/dns.exp)"
./dns.exp

netblue30's avatar
netblue30 committed
16 17 18 19 20 21
echo "TESTING: machine-id (test/environment/machineid.exp)"
./machineid.exp

echo "TESTING: hosts file (test/environment/hostfile.exp)"
./hostfile.exp

netblue30's avatar
netblue30 committed
22 23 24 25 26 27 28 29 30 31 32 33 34
echo "TESTING: doubledash (test/environment/doubledash.exp"
mkdir -- -testdir
touch -- -testdir/ttt
cp -- /bin/bash -testdir/.
./doubledash.exp
rm -fr -- -testdir

echo "TESTING: output (test/environment/output.exp)"
./output.exp

echo "TESTING: extract command (extract_command.exp)"
./extract_command.exp

netblue30's avatar
netblue30 committed
35 36 37 38 39 40
echo "TESTING: environment variables (test/environment/env.exp)"
./env.exp

echo "TESTING: shell none(test/environment/shell-none.exp)"
./shell-none.exp

41
which dash 2>/dev/null
netblue30's avatar
netblue30 committed
42 43 44 45 46
if [ "$?" -eq 0 ];
then
        echo "TESTING: dash (test/environment/dash.exp)"
        ./dash.exp
else
47
        echo "TESTING SKIP: dash not found"
netblue30's avatar
netblue30 committed
48 49
fi

50
which csh 2>/dev/null
netblue30's avatar
netblue30 committed
51 52 53 54 55
if [ "$?" -eq 0 ];
then
        echo "TESTING: csh (test/environment/csh.exp)"
        ./csh.exp
else
56
        echo "TESTING SKIP: csh not found"
netblue30's avatar
netblue30 committed
57 58
fi

59
which zsh 2>/dev/null
netblue30's avatar
netblue30 committed
60 61 62
if [ "$?" -eq 0 ];
then
        echo "TESTING: zsh (test/environment/zsh.exp)"
Reiner Herrmann's avatar
Reiner Herrmann committed
63
        ./zsh.exp
netblue30's avatar
netblue30 committed
64
else
65
        echo "TESTING SKIP: zsh not found"
netblue30's avatar
netblue30 committed
66 67
fi

netblue30's avatar
netblue30 committed
68 69 70
echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail-in-firejail.exp)"
./firejail-in-firejail.exp

71
which aplay 2>/dev/null
72 73 74 75 76
if [ "$?" -eq 0 ];
then
        echo "TESTING: sound (test/environment/sound.exp)"
        ./sound.exp
else
77
        echo "TESTING SKIP: aplay not found"
78
fi
netblue30's avatar
netblue30 committed
79

netblue30's avatar
netblue30 committed
80
echo "TESTING: nice (test/environment/nice.exp)"
netblue30's avatar
netblue30 committed
81
./nice.exp
netblue30's avatar
netblue30 committed
82 83 84 85

echo "TESTING: quiet (test/environment/quiet.exp)"
./quiet.exp

86
which strace 2>/dev/null
netblue30's avatar
netblue30 committed
87 88 89 90 91 92 93
if [ "$?" -eq 0 ];
then
        echo "TESTING: --allow-debuggers (test/environment/allow-debuggers.exp)"
        ./allow-debuggers.exp
else
        echo "TESTING SKIP: strace not found"
fi
netblue30's avatar
netblue30 committed
94

netblue30's avatar
netblue30 committed
95 96 97 98 99 100 101 102 103
# to install ibus:
#       $ sudo apt-get install ibus-table-array30
#       $ ibus-setup

find ~/.config/ibus/bus | grep unix-0
if [ "$?" -eq 0 ];
then
	echo "TESTING: ibus (test/environment/ibus.exp)"
	./ibus.exp
netblue30's avatar
netblue30 committed
104 105
else
        echo "TESTING SKIP: ibus not configured"
netblue30's avatar
netblue30 committed
106
fi
netblue30's avatar
netblue30 committed
107

108
echo "TESTING: rlimit (test/environment/rlimit.exp)"
netblue30's avatar
netblue30 committed
109 110
./rlimit.exp

111
echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)"
netblue30's avatar
netblue30 committed
112 113
./rlimit-profile.exp

114
echo "TESTING: rlimit errors (test/environment/rlimit-bad.exp)"
netblue30's avatar
netblue30 committed
115 116
./rlimit-bad.exp

117
echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)"
netblue30's avatar
netblue30 committed
118
./rlimit-bad-profile.exp