asterisk/main/minimime/test.sh
Russell Bryant 0a9750ef9f Merged revisions 60603 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r60603 | russell | 2007-04-06 15:58:43 -0500 (Fri, 06 Apr 2007) | 13 lines

To be able to achieve the things that we would like to achieve with the
Asterisk GUI project, we need a fully functional HTTP interface with access
to the Asterisk manager interface.  One of the things that was intended to be
a part of this system, but was never actually implemented, was the ability for
the GUI to be able to upload files to Asterisk.  So, this commit adds this in
the most minimally invasive way that we could come up with.

A lot of work on minimime was done by Steve Murphy.  He fixed a lot of bugs in
the parser, and updated it to be thread-safe.  The ability to check
permissions of active manager sessions was added by Dwayne Hubbard.  Then,
hacking this all together and do doing the modifications necessary to the HTTP
interface was done by me.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 21:16:38 +00:00

55 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
# MiniMIME test cases
[ ! -x ./tests/parse -o ! -x ./tests/create ] && {
echo "You need to compile the test suite first to accomplish tests"
exit 1
}
LD_LIBRARY_PATH=${PWD}
export LD_LIBRARY_PATH
DIRECTORY=${1:-tests/messages}
FILES=${2:-"*"}
TESTS=0
F_ERRORS=0
F_INVALID=""
M_ERRORS=0
M_INVALID=""
for f in ${DIRECTORY}/${FILES}; do
if [ -f "${f}" ]; then
TESTS=$((TESTS + 2))
echo -n "Running PARSER test for $f (file)... "
output=`./tests/parse $f 2>&1`
[ $? != 0 ] && {
echo "FAILED ($output)"
F_ERRORS=$((F_ERRORS + 1))
F_INVALID="${F_INVALID} ${f} "
} || {
echo "PASSED"
}
echo -n "Running PARSER test for $f (memory)... "
output=`./tests/parse -m $f 2>&1`
[ $? != 0 ] && {
echo "FAILED ($output)"
M_ERRORS=$((M_ERRORS + 1))
M_INVALID="${M_INVALID} ${f} "
} || {
echo "PASSED"
}
fi
done
echo "Ran a total of ${TESTS} tests"
if [ ${F_ERRORS} -gt 0 ]; then
echo "!! ${F_ERRORS} messages had errors in file based parsing"
echo "-> ${F_INVALID}"
fi
if [ ${M_ERRORS} -gt 0 ]; then
echo "!! ${F_ERRORS} messages had errors in memory based parsing"
fi
unset LD_LIBRARY_PATH