diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-09 15:11:49 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-09 15:11:49 +0100 |
commit | aac27905de964f0f91f6a9366f596b1197d574ff (patch) | |
tree | 9936d6bf55482403ed0386969108fc39c6faefe7 | |
parent | a88cb1b54f6ec99886e9a6a4e54124150f7bfff6 (diff) | |
download | rspamd-aac27905de964f0f91f6a9366f596b1197d574ff.tar.gz rspamd-aac27905de964f0f91f6a9366f596b1197d574ff.zip |
Use standard functions definitions.
-rw-r--r-- | test/functional/functions.sh | 18 | ||||
-rw-r--r-- | test/functional/tests.sh | 6 |
2 files changed, 8 insertions, 16 deletions
diff --git a/test/functional/functions.sh b/test/functional/functions.sh index 7301669a2..50c29948b 100644 --- a/test/functional/functions.sh +++ b/test/functional/functions.sh @@ -1,5 +1,4 @@ -function save_error() -{ +save_error() { _where=$1 _reason=$2 @@ -10,8 +9,7 @@ function save_error() exit 1 } -function run_rspamd() -{ +run_rspamd() { RSPAMD_USER=${RSPAMD_USER:-"nobody"} RSPAMD_GROUP=${RSPAMD_GROUP:-"nogroup"} RSPAMD=${RSPAMD:-"$TEST_DIRNAME/../../src/rspamd"} @@ -36,8 +34,7 @@ function run_rspamd() } -function teardown() -{ +teardown() { RSPAMD_PID=`cat ${TMPDIR}/rspamd.pid` if [ F"${RSPAMD_PID}" != F"" ] ; then @@ -58,8 +55,7 @@ function teardown() fi } -function check_output() -{ +check_output() { _pattern="$1" echo "$output" | egrep "$_pattern" > /dev/null 2>&1 @@ -74,8 +70,7 @@ function check_output() return 0 } -function run_rspamc() -{ +run_rspamc() { _command=$1 shift _rspamc="$TEST_DIRNAME/../../src/client/rspamc" @@ -98,8 +93,7 @@ function run_rspamc() return 1 } -function run() -{ +run() { _command=$1 shift diff --git a/test/functional/tests.sh b/test/functional/tests.sh index d6eb612a6..245ac7dd7 100644 --- a/test/functional/tests.sh +++ b/test/functional/tests.sh @@ -11,13 +11,11 @@ SKIPPED_TESTS=0 . ${TEST_DIRNAME}/functions.sh -function make_tempdir() -{ +make_tempdir() { export TMPDIR=`mktemp -d /tmp/rspamd-test-XXXXXX` } -function run_test() -{ +run_test() { TEST_NAME=`basename $1 | sed -e 's/.sh$//'` TEST_DESCRIPTION=`head -1 $1 | sed -e 's/^# *//'` |