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

[OPENBUS-2189] Remover as dependências da biblioteca OpenBusLua com as...

[OPENBUS-2189] Remover as dependências da biblioteca OpenBusLua com as bibliotecas LuaFileSystem e 'luuid' de Lua
- Removendo dependência com o 'luuid'.
- Ajustando o descritor do 'openbus-lua' para descrever apenas as dependência de compilação. Para as dependências de execução (runtime), veja os descritores dos binários que utilizam essa biblioteca.


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/trunk@137384 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 7cb5f323
local oil = require "oil"
local log = require "openbus.util.logger"
local openbus = require "openbus"
local ComponentContext = require "scs.core.ComponentContext"
......
......@@ -8,11 +8,10 @@ OPENBUSLIB= ${OPENBUS_HOME}/lib
SRC= console.c
LIBS:= lce luuid lfs luavararg luastruct luasocket loop luatuple \
LIBS:= lce lfs luavararg luastruct luasocket loop luatuple \
luacoroutine luacothread luainspector luaidl oil luascs luaopenbus lua5.1
INCLUDES+= . $(SRCLUADIR) \
$(OPENBUSINC)/luuid \
$(OPENBUSINC)/lce \
$(OPENBUSINC)/luafilesystem \
$(OPENBUSINC)/luavararg \
......@@ -37,16 +36,12 @@ ifeq "$(TEC_SYSNAME)" "SunOS"
endif
ifdef USE_STATIC
SLIB:= $(foreach libname, $(LIBS) uuid crypto, $(OPENBUSLIB)/lib$(libname).a)
SLIB:= $(foreach libname, $(LIBS) crypto, $(OPENBUSLIB)/lib$(libname).a)
ifeq "$(TEC_SYSNAME)" "SunOS"
LIBS:= rt nsl socket resolv
else
LIBS:=
endif
else
ifneq "$(TEC_SYSNAME)" "Darwin"
LIBS+= uuid
endif
endif
LIBS+= dl
......@@ -17,7 +17,6 @@
#include "lauxlib.h"
#include "lualib.h"
#include "luuid.h"
#include "lce.h"
#include "lfs.h"
#include "luavararg.h"
......@@ -408,7 +407,6 @@ static int pmain (lua_State *L) {
/* preload binded C libraries */
luaL_findtable(L, LUA_GLOBALSINDEX, "package.preload", 1);
lua_pushcfunction(L,luaopen_uuid);lua_setfield(L,-2,"uuid");
lua_pushcfunction(L,luaopen_lfs);lua_setfield(L,-2,"lfs");
lua_pushcfunction(L,luaopen_vararg);lua_setfield(L,-2,"vararg");
lua_pushcfunction(L,luaopen_struct);lua_setfield(L,-2,"struct");
......
......@@ -3,10 +3,6 @@ LIBNAME= $(PROJNAME)
SRC= $(PRELOAD_DIR)/$(LIBNAME).c
OPENBUSOLDIDL= ${OPENBUS_HOME}/idl/v1_05
OPENBUSNEWIDL= ${OPENBUS_HOME}/idl/v2_0
OPENBUSLIBIDL= ${OPENBUS_HOME}/idl/lib
LUADIR= ../lua
LUASRC= \
$(LUADIR)/openbus/assistant.lua \
......@@ -31,21 +27,21 @@ LUASRC= \
$(LUADIR)/openbus/util/tickets.lua \
$(LUADIR)/openbus.lua
LIBIDL= $(OPENBUSLIBIDL)/openbus.idl
LIBIDL= $(OPENBUS_LIBIDL)/openbus.idl
NEWIDL= \
$(OPENBUSNEWIDL)/access_control.idl \
$(OPENBUSNEWIDL)/offer_registry.idl
$(OPENBUS_NEWIDL)/access_control.idl \
$(OPENBUS_NEWIDL)/offer_registry.idl
OLDIDL= \
$(OPENBUSOLDIDL)/access_control_service.idl \
$(OPENBUSOLDIDL)/registry_service.idl \
$(OPENBUSOLDIDL)/fault_tolerance.idl
$(OPENBUS_OLDIDL)/access_control_service.idl \
$(OPENBUS_OLDIDL)/registry_service.idl \
$(OPENBUS_OLDIDL)/fault_tolerance.idl
include ${OIL_HOME}/openbus/base.mak
$(LUADIR)/openbus/idl/parsed.lua: $(IDL2LUA) $(LIBIDL) $(NEWIDL)
$(OILBIN) $(IDL2LUA) -I $(OPENBUSNEWIDL) -o $@ $(LIBIDL)
$(OILBIN) $(IDL2LUA) -I $(OPENBUS_NEWIDL) -o $@ $(LIBIDL)
$(LUADIR)/openbus/core/idl/parsed.lua: $(IDL2LUA) $(NEWIDL)
$(OILBIN) $(IDL2LUA) -o $@ $(NEWIDL)
......
......@@ -9,7 +9,6 @@ local unpack = _G.unpack
local coroutine = require "coroutine"
local string = require "string"
local io = require "io"
local uuid = require "uuid"
local giop = require "oil.corba.giop"
local cothread = require "cothread"
cothread.plugin(require "cothread.plugin.socket")
......@@ -26,6 +25,7 @@ require "openbus.test.configs"
local smalltime = .1
local connprops = { accesskey = openbus.newKey() }
local usedlogins = {}
-- login as admin and provide additional functionality for the test
local invalidate, shutdown do
......@@ -65,7 +65,7 @@ do log:TEST("Two threads logging in")
repeat cothread.delay(smalltime) until threads == 0
assert(conn.login ~= nil)
assert(uuid.isvalid(conn.login.id))
assert(conn.login.id ~= nil)
assert(conn.login.entity == user)
assert(failures == 1)
......
......@@ -9,7 +9,6 @@ local unpack = _G.unpack
local coroutine = require "coroutine"
local string = require "string"
local io = require "io"
local uuid = require "uuid"
local giop = require "oil.corba.giop"
local cothread = require "cothread"
cothread.plugin(require "cothread.plugin.socket")
......@@ -35,6 +34,14 @@ local OpenBusContext = orb.OpenBusContext
assert(OpenBusContext.orb == orb)
local conns = {}
local checkuuid do
local used = {}
function checkuuid(id)
assert(used[id] == nil)
used[id] = true
end
end
local function catcherr(...)
local ok, err = pcall(...)
assert(not ok)
......@@ -74,8 +81,8 @@ local function assertlogged(conn)
-- check logged in only attributes
assert(conn.login ~= nil)
assert(conn.login.entity == entity)
assert(uuid.isvalid(conn.login.id))
assert(uuid.isvalid(conn.busid))
checkuuid(conn.login.id)
checkuuid(conn.busid)
local loginid = conn.login.id
local busid = conn.busid
-- check the attempt to login again
......
......@@ -9,7 +9,6 @@ local unpack = _G.unpack
local coroutine = require "coroutine"
local string = require "string"
local io = require "io"
local uuid = require "uuid"
local giop = require "oil.corba.giop"
local cothread = require "cothread"
local openbus = require "openbus"
......
......@@ -7,10 +7,6 @@ local newORB = oil.init
local cothread = require "cothread"
local running = cothread.running
local uuid = require "uuid"
local newid = uuid.new
local validid = uuid.isvalid
local hash = require "lce.hash"
local sha256 = hash.sha256
local pubkey = require "lce.pubkey"
......@@ -135,6 +131,14 @@ do -- protocol data encoding functions
end
end
do
local used = {}
function checkuuid(id)
assert(used[id] == nil)
used[id] = true
end
end
do -- protocol predefined formats
NullChain = {
signature = string.rep("\000", EncryptedBlockSize),
......@@ -208,7 +212,7 @@ function loginByPassword(bus, user, password, prvkey)
local pubkey = prvkey:encode("public")
local encrypted = encodeLogin(bus.key, password, pubkey)
local login, lease = bus.AccessControl:loginByPassword(user, pubkey, encrypted)
assert(validid(login.id))
checkuuid(login.id)
assert(login.entity == user)
assert(lease > 0)
login.prvkey = prvkey
......@@ -314,7 +318,7 @@ function testBusCall(bus, login, otherkey, assertresults, proxy, opname, ...)
do -- credential with wrong busid
local credential = {
opname = opname,
bus = newid(),
bus = "f3fc2bd8-64bd-11e2-bbf3-8df49019c88",
login = login.id,
session = reset.session,
ticket = 2,
......@@ -437,7 +441,7 @@ function testBusCall(bus, login, otherkey, assertresults, proxy, opname, ...)
putreqcxt(CredentialContextId, encodeCredential{
opname = opname,
bus = bus.id,
login = newid(),
login = "f41c15ce-64bd-11e2-bbf3-8df49019c88b",
session = reset.session,
ticket = 7,
secret = reset.secret,
......
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