Commit 029fed36 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

[OPENBUS-2682] (Lua) Adicionar suporte a exportação de dados em versões legadas (OpenBus 2.0)

- Ajuste para o teste de interop. 'sharedauth' usar um arquivo num caminho absoluto para facilitar executar com testes de interop. de outras linguages ou versões.
- Ajuste para exibir mensagens de erro em falhas do interop. chaining sejam exibidas.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_01@158903 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 879783ca
......@@ -23,16 +23,18 @@ local OpenBusContext = orb.OpenBusContext
-- create service implementation
local hello = {}
function hello:fetchHello(encodedChain)
if not pcall(function ()
local ok, ex = pcall(function ()
local chain = OpenBusContext:decodeChain(encodedChain)
OpenBusContext:joinChain(chain)
end) then
end)
if not ok then
print(ex)
sysex.BAD_PARAM()
end
local result
if not pcall(function ()
local ok, ex = pcall(function ()
-- define service properties
properties[#properties+1] =
{name="openbus.component.interface",value=serviface.repID}
......@@ -50,7 +52,9 @@ function hello:fetchHello(encodedChain)
log:TEST("got result from service of ",entity)
break
end
end) then
end)
if not ok then
print(ex)
sysex.NO_RESOURCES()
end
......
......@@ -23,7 +23,7 @@ OpenBusContext:setDefaultConnection(conn)
-- read shared authentication data
log:TEST("retrieve shared authentication data")
local secret = OpenBusContext:decodeSharedAuth(waitfile("sharedauth.dat"))
local secret = OpenBusContext:decodeSharedAuth(waitfile(sharedauthfile))
-- login to the bus
conn:loginBySharedAuth(secret)
......
......@@ -52,6 +52,6 @@ log:TEST("hello service ready!")
-- serialize shared authentication data
local secret = conn:startSharedAuth()
local encoded = OpenBusContext:encodeSharedAuth(secret)
assert(oil.writeto("sharedauth.dat", encoded, "wb"))
assert(oil.writeto(sharedauthfile, encoded, "wb"))
log:TEST("shared authentication data written to file!")
......@@ -49,3 +49,4 @@ ldappat = get("ldap.pattern" , "cn=%U,ou=usuarios,dc=tecgraf,dc=pu
ldaptimeout = get("ldap.timeout" , 5)
admscript = get("admin.script.test" , "testscript.adm")
admoutput = get("admin.output.file" , "busadmin.txt")
sharedauthfile = get("system.sharedauth" , testbase.."sharedauth.dat")
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