diff options
Diffstat (limited to 'test/functional/functions.sh')
-rw-r--r-- | test/functional/functions.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/functional/functions.sh b/test/functional/functions.sh index b96931a74..7301669a2 100644 --- a/test/functional/functions.sh +++ b/test/functional/functions.sh @@ -60,14 +60,13 @@ function teardown() function check_output() { - _output="$1" - _pattern="$2" + _pattern="$1" - echo "$_output" | egrep "$_pattern" > /dev/null 2>&1 + echo "$output" | egrep "$_pattern" > /dev/null 2>&1 _saved_exit=$? if [ $_saved_exit -ne 0 ] ; then - echo "$_output" > ${TMPDIR}/rspamc.output + echo "$output" > ${TMPDIR}/rspamc.err save_error 'rspamc' "Expected pattern $_pattern is not found" return $_saved_exit fi @@ -86,13 +85,13 @@ function run_rspamc() *) _host="localhost:56789" ;; esac - output=`$_rspamc -h $_host $@ 2>&1` + output=`$_rspamc -h $_host $_command $@ 2>&1` + echo "$output" > ${TMPDIR}/rspamc.output if [ $? -eq 0 ] ; then export output return 0 else - echo $output > ${TMPDIR}/rspamc.output save_error 'rspamc' "Wrong exit code" fi @@ -105,12 +104,12 @@ function run() shift output=`$_command $@ 2>&1` + echo "$output" > "${TMPDIR}/${_command}.output" if [ $? -eq 0 ] ; then export output return 0 else - echo $output > ${TMPDIR}/${_command}.output save_error "${_command}" "Wrong exit code" fi |