Commit 06f145fb authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

[OPENBUS-2722] Lançar o OpenBus Core 2.1.0

- Adaptando scripts de execução de teste para facilitar testes de pacotes gerados.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_00@159962 ae0415b3-e90b-0410-900d-d0be9363c56b
parent ac315ce6
#!/bin/bash
CONSOLE="${OPENBUS_HOME}/bin/busconsole"
mode=$1
testcase=$2
services="server"
if [ "$1" == "DEBUG" ]; then
CONSOLE="$CONSOLE -d"
elif [ "$1" != "RELEASE" ]; then
echo "Usage: runtest.sh [RELEASE|DEBUG] <dir> [services]"
busconsole="${OPENBUS_SDKLUA_HOME}/bin/busconsole"
if [[ "$mode" == "DEBUG" ]]; then
busconsole="$busconsole -d"
elif [[ "$mode" != "RELEASE" ]]; then
echo "Usage: $0 <RELEASE|DEBUG> <test> [services...]"
exit 1
fi
if [[ ${#@} > 2 ]]; then
services="${@:3:${#@}}"
else
services="server"
fi
cd $2
cd $testcase
pid=
for service in $services; do
echo "Starting service '$service' of test '$2'"
$CONSOLE $service.lua $2 &
echo "Starting service '$service' of test '$testcase'"
$busconsole $service.lua $testcase &
pid="$pid $!"
trap "kill $pid > /dev/null 2> /dev/null" 0
trap "kill $pid > /dev/null 2>&1" 0
done
echo -n "Executing test '$2' ... "
$CONSOLE client.lua $2
echo -n "Executing test '$testcase' ... "
$busconsole client.lua $testcase
echo "OK"
cd ../../test
echo -n "Test protocol with server of test '$2' ... "
$CONSOLE openbus/test/Protocol.lua
echo -n "Test protocol with server of test '$testcase' ... "
$busconsole openbus/test/Protocol.lua
echo "OK"
cd ../interop
......@@ -50,8 +50,11 @@ do -- connect to the bus
local function isnotnil(value) assert(value ~= nil) end
for _, offer in ipairs(offers) do
local service = offer.service_ref
testBusCall(bus, login, otherkey, isfalse, service, "_non_existent")
testBusCall(bus, login, otherkey, isnotnil, service, "getComponentId")
local ok, result = pcall(service._non_existent, service)
if (ok and not result)
or (not ok and result._repid ~= "IDL:omg.org/CORBA/TRANSIENT:1.0") then
testBusCall(bus, login, otherkey, isnotnil, service, "getComponentId")
end
end
-- logout from the bus
......
#!/bin/bash
CONSOLE="${OPENBUS_HOME}/bin/busconsole"
mode=$1
if [ "$1" == "DEBUG" ]; then
CONSOLE="$CONSOLE -d"
elif [ "$1" != "RELEASE" ]; then
echo "Usage: runall.sh [RELEASE|DEBUG] bushost busport [verbose]"
if [[ "$mode" == "" ]]; then
mode=RELEASE
elif [[ "$mode" != "RELEASE" && "$mode" != "DEBUG" ]]; then
echo "Usage: $0 <RELEASE|DEBUG>"
exit 1
fi
LUACASES="\
openbus/test/util/tickets \
openbus/test/util/database \
openbus/test/LoginLogout \
openbus/test/Concurrency \
openbus/test/NoLoginIceptorCalls \
openbus/test/assistant/LoginLogout \
openbus/test/assistant/Concurrency \
openbus/test/assistant/NoLoginIceptorCalls \
openbus/test/assistant/AssistantLoginLogout \
"
for case in ${LUACASES}; do
echo -n "Test '${case}' ... "
${CONSOLE} ${case}.lua ${@:2:${#@}} || exit $?
echo "OK"
done
bus1port=20011
bus2port=20021
leasetime=1
passwordpenalty=1
export OPENBUS_TESTCFG=$OPENBUS_TEMP/test.properties
echo "bus.host.port=$bus1port" > $OPENBUS_TESTCFG
echo "bus2.host.port=$bus2port" >> $OPENBUS_TESTCFG
echo "login.lease.time=$leasetime" >> $OPENBUS_TESTCFG
echo "password.penalty.time=$passwordpenalty" >> $OPENBUS_TESTCFG
#echo "openbus.test.verbose=yes" >> $OPENBUS_TESTCFG
source ${OPENBUS_CORE_TEST}/runbus.sh $mode BUS01 $bus1port
source ${OPENBUS_CORE_TEST}/runbus.sh $mode BUS02 $bus2port
genkey $OPENBUS_TEMP/testsyst
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus1port --script=${OPENBUS_CORE_TEST}/test.adm
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus2port --script=${OPENBUS_CORE_TEST}/test.adm
source runtests.sh $mode
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus1port --undo-script=${OPENBUS_CORE_TEST}/test.adm
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus2port --undo-script=${OPENBUS_CORE_TEST}/test.adm
cd ../interop
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus1port --script=script.adm
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus2port --script=script.adm
source runall.sh $mode
sleep 2 # wait for offers to expire
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus1port --undo-script=script.adm
source ${OPENBUS_CORE_TEST}/runadmin.sh $mode localhost $bus2port --undo-script=script.adm
cd ../test
#!/bin/bash
mode=$1
busconsole="${OPENBUS_SDKLUA_HOME}/bin/busconsole"
if [[ "$mode" == "DEBUG" ]]; then
busconsole="$busconsole -d"
elif [[ "$mode" != "RELEASE" ]]; then
echo "Usage: $0 <RELEASE|DEBUG>"
exit 1
fi
cases="\
openbus/test/util/tickets \
openbus/test/util/database \
openbus/test/NoLoginIceptorCalls \
openbus/test/Concurrency \
openbus/test/MakeChainFor \
openbus/test/ChainExport \
openbus/test/LoginLogout \
openbus/test/assistant/Concurrency \
openbus/test/assistant/NoLoginIceptorCalls \
openbus/test/assistant/LoginLogout \
openbus/test/assistant/AssistantLoginLogout \
"
for case in $cases; do
echo -n "Test '${case}' ... "
$busconsole $case.lua ${@:2:${#@}} || exit $?
echo "OK"
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment