Commit a49e9d1f authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

Merge from branch sdk/lua/branches/02_00_01 (r168727)

Merge from branch core/branches/02_00_00 (168721:168728)
[OPENBUS-2864] Erros de validadores de senha ou token resultam em ServiceFailure para o cliente
[OPENBUS-2849] Correção para permitir que o 'busservices' atenda novos clientes quando o número de sockets abertos atinge o limite imposto pelo sistema operacional.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/trunk@168729 ae0415b3-e90b-0410-900d-d0be9363c56b
parents 00fc1142 8ea12f6d
......@@ -104,4 +104,19 @@ do log:TEST("Fail to import chain from invalid token")
conn:logout()
end
do log:TEST("Fail to import chain from token that raises an error")
local conn = OpenBusContext:connectByReference(busref, connprops)
conn:loginByPassword(user, password, domain)
OpenBusContext:setDefaultConnection(conn)
local token = conn.login.entity.."@"..conn.login.id..": ExternalOriginator, ExternalCaller"
local ok, ex = pcall(OpenBusContext.importChain, OpenBusContext, token, baddomain)
assert(ok == false)
assert(ex._repid == idl.types.services.ServiceFailure)
assert(string.find(ex.message, "Oops!") ~= nil)
OpenBusContext:setDefaultConnection(nil)
conn:logout()
end
orb:shutdown()
......@@ -181,6 +181,14 @@ do log:TEST "connect to unavailable port"
end
end
do log:TEST "password validator error"
local bus = orb:newproxy(busref, nil, "::scs::core::IComponent")
local conn = OpenBusContext:connectByReference(bus)
local ex = catcherr(conn.loginByPassword, conn, "error", "Oops!", baddomain)
assert(ex._repid == idl.types.services.ServiceFailure)
assert(string.find(ex.message, "Oops!") ~= nil)
end
do log:TEST "connect to bus"
local bus = orb:newproxy(busref, nil, "::scs::core::IComponent")
local bus2 = orb:newproxy(bus2ref, nil, "::scs::core::IComponent")
......
......@@ -160,6 +160,14 @@ do log:TEST "connect to unavailable port"
end
end
do log:TEST "password validator error"
local busref = orb:newproxy(busref, nil, "::scs::core::IComponent")
local conn = assistant.create{orb=orb, busref=busref}
local ex = catcherr(conn.loginByPassword, conn, "error", "Oops!", baddomain)
assert(ex._repid == idl.types.services.ServiceFailure)
assert(string.find(ex.message, "Oops!") ~= nil)
end
do log:TEST "connect to bus"
for i = 1, 2 do
local busref = orb:newproxy(busref, nil, "::scs::core::IComponent")
......
......@@ -43,6 +43,7 @@ bus2crt = get("bus2.certificate.path",testbase.."BUS02.crt")
admin = get("admin.entity.name" , "admin")
admpsw = get("admin.password" , admin)
domain = get("user.password.domain", "testing")
baddomain = get("bad.password.domain" , "erroneous")
user = get("user.entity.name" , "testuser")
password = get("user.password" , user)
passwordpenalty= get("password.penalty.time", leasetime)
......
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