Commit 6bb99372 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Release tag of version 2.1.0.0

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/tags/02_01_00_00@169255 ae0415b3-e90b-0410-900d-d0be9363c56b
parents f9506333 5bccf916
......@@ -76,6 +76,9 @@ project busservices
<define>OPENBUS_PROGNAME=\\\""busservices\\\""
<toolset>msvc-12.0:<cxxflags>/FS
<debug-symbols>on
: default-build
<variant>release
<link>static
;
make coreservices.c
......@@ -158,7 +161,7 @@ exe busservices
<target-os>darwin:<library>/lualdap//lualdap
<target-os>linux:<library>/lualdap//lualdap
<include>src
<include>.
<include>.
;
explicit busservices ;
......@@ -181,7 +184,8 @@ exe busadmin
/luascs//luascs
/luaopenbus//luaopenbus
/luasec//luasec
: <dependency>/loop//loop
: <dependency>coreadmin.c
<dependency>/loop//loop
<dependency>/loop//luatuple
<dependency>/loop//luacothread
<dependency>/oil//oil
......
......@@ -59,6 +59,9 @@ local ServiceOfferType = offtyp.ServiceOffer
local cvrtyp = oldidl.types.v2_1.services.legacy_support
local LegacyConverterType = cvrtyp.LegacyConverter
local coreutil = require "openbus.core.services.util"
local assertCaller = coreutil.assertCaller
local function traceback(errmsg)
if type(errmsg) == "string" then
return stacktrace(errmsg)
......@@ -226,9 +229,18 @@ end
-- IDL operations
function LoginRegistry:getAllLogins(...)
doexcept(xpcall(assertCaller, traceback, self))
return trymethod(self.__object, "getAllLogins", ...)
end
function LoginRegistry:subscribeObserver(...)
local subscription = trymethod(self.__object, "subscribeObserver", ...)
subscription.__type = LoginObsSubType
wrapmethod(subscription, "watchLogin")
wrapmethod(subscription, "forgetLogin")
wrapmethod(subscription, "watchLogins")
wrapmethod(subscription, "forgetLogins")
wrapmethod(subscription, "remove")
return subscription
end
......
......@@ -610,6 +610,40 @@ return OpenBusFixture{
-- assert no notifications have arrived
checks.assert(observer:_get("offerRegistered"), checks.equal(nil))
end,
UnauthorizedObserverRemoval = function (fixture, openbus)
-- create observer
local context = openbus.context
local observer = newObserver({ offerRegistered = true }, context)
-- subscribe observer
local offers = fixture.offers
local newprops = { SomeOfferProps[1] }
local subscription = offers:subscribeObserver(observer, newprops)
local owner = context:getCurrentConnection().login
checks.assert(subscription, isOfferRegSubscription(owner,
observer,
newprops))
local system = fixture:newConn("system")
context:setCurrentConnection(system)
-- attempt to remove observer
local ok, err = pcall(subscription.remove, subscription)
checks.assert(ok, checks.equal(false))
checks.assert(err, checks.like{ _repid = UnauthorizedOperation })
-- change service offer properties
local comp = fixture.component
local offer = offers:registerService(comp.IComponent, SomeOfferProps)
context:setCurrentConnection(nil)
-- wait for observer notification
local desc = observer:_wait("offerRegistered")
checks.assert(desc, isServiceOfferDesc(comp, system.login, SomeOfferProps))
-- unsubscribe observer
subscription:remove()
-- change service offer properties to the watched properties
context:setCurrentConnection(system)
offer:setProperties(SomeOfferProps)
context:setCurrentConnection(nil)
-- assert no notifications have arrived
checks.assert(observer:_get("offerRegistered"), checks.equal(nil))
end,
},
},
AsSystem = OffersFixture{
......@@ -993,6 +1027,40 @@ return OpenBusFixture{
checks.assert(observer:_get("removed"), checks.equal(nil))
checks.assert(observer:_get("propertiesChanged"), checks.equal(nil))
end,
UnauthorizedObserverRemoval = function (fixture, openbus)
-- create observer
local context = openbus.context
local observer = newObserver({
propertiesChanged = true,
removed = true,
}, context)
-- subscribe observer
local offer = fixture.offer
local comp = fixture.component
local system = fixture.system
local login = system.login
local subscription = offer:subscribeObserver(observer)
local owner = context:getCurrentConnection().login
checks.assert(subscription, isOfferSubscription(owner,
observer,
comp,
login,
SomeOfferProps))
-- attempt to remove observer as other entity
context:setCurrentConnection(system)
local ok, err = pcall(subscription.remove, subscription)
checks.assert(ok, checks.equal(false))
checks.assert(err, checks.like{ _repid = UnauthorizedOperation })
-- remove service offer
offer:remove()
context:setCurrentConnection(nil)
-- wait for observer notification
local desc = observer:_wait("removed")
-- assert the notification is correct
checks.assert(desc, isServiceOfferDesc(comp, login, SomeOfferProps))
-- assert no other notification has arrived
checks.assert(observer:_get("propertiesChanged"), checks.equal(nil))
end,
},
},
},
......
......@@ -6,7 +6,7 @@ busport=$3
param=${4%%=*}
desc=${4#--*=}
busadmin="${OPENBUS_CORE_HOME}/bin/busadmin"
busadmin="env LUA_PATH=${OPENBUS_SDKLUA_TEST}/?.lua ${OPENBUS_CORE_HOME}/bin/busadmin"
busadmdesc="${OPENBUS_CORE_HOME}/bin/busadmdesc.lua"
if [[ "$mode" == "DEBUG" ]]; then
......
......@@ -9,7 +9,7 @@ elif [[ "$mode" != "RELEASE" && "$mode" != "DEBUG" ]]; then
exit 1
fi
busport=21010
busport=21200
leasetime=6
passwordpenalty=6
......
......@@ -4,9 +4,9 @@ mode=$1
name=$2
port=$3
busssl="${OPENBUS_OPENSSL_HOME}/bin/openssl"
buscore="${OPENBUS_CORE_HOME}/bin/busservices"
busadmin="${OPENBUS_CORE_HOME}/bin/busadmin"
busssl="env LD_LIBRARY_PATH=$OPENBUS_OPENSSL_HOME/lib ${OPENBUS_OPENSSL_HOME}/bin/openssl"
buscore="env LUA_PATH=${OPENBUS_CORE_TEST}/?.lua ${OPENBUS_CORE_HOME}/bin/busservices"
busadmin="env LUA_PATH=${OPENBUS_SDKLUA_TEST}/?.lua ${OPENBUS_CORE_HOME}/bin/busadmin"
if [[ "$mode" == "DEBUG" ]]; then
buscore="$buscore DEBUG"
......
#!/bin/bash
mode=$1
if [[ "$mode" == "" ]]; then
mode=RELEASE
elif [[ "$mode" != "RELEASE" && "$mode" != "DEBUG" ]]; then
echo "Usage: $0 [RELEASE|DEBUG]"
exit 1
fi
runbus="source ${OPENBUS_CORE_TEST}/runbus.sh $mode"
runadmin="source ${OPENBUS_CORE_TEST}/runadmin.sh $mode"
runtests="env OPENBUS_SDKLUA_HOME=${OPENBUS_LEGACYSDKLUA_HOME} OPENBUS_SDKLUA_TEST=${OPENBUS_LEGACYSDKLUA_TEST} /bin/bash runtests.sh $mode"
busport=21208
leasetime=6
passwordpenalty=6
export OPENBUS_TESTCFG=$OPENBUS_TEMP/test.properties
echo "bus.host.port=$busport" > $OPENBUS_TESTCFG
echo "login.lease.time=$leasetime" >> $OPENBUS_TESTCFG
echo "password.penalty.time=$passwordpenalty" >> $OPENBUS_TESTCFG
#echo "openbus.test.verbose=yes" >> $OPENBUS_TESTCFG
$runbus BUS01 $busport
genkey $OPENBUS_TEMP/testsyst
$runadmin localhost $busport --script=test.adm
$runtests OpenBus.LoginRegistry
$runtests OpenBus.OfferRegistry
$runadmin localhost $busport --undo-script=test.adm
......@@ -2,7 +2,7 @@
mode=$1
busadmin="${OPENBUS_CORE_HOME}/bin/busadmin"
busadmin="env LUA_PATH=${OPENBUS_SDKLUA_TEST}/?.lua ${OPENBUS_CORE_HOME}/bin/busadmin"
if [[ "$mode" == "DEBUG" ]]; then
busadmin="$busadmin DEBUG"
......@@ -28,7 +28,8 @@ if [ "$2" == "" ]; then
done
fi
TEST_RUNNER="local suite = require('openbus.test.core.services.Suite')
TEST_RUNNER="package.path=package.path..';./?.lua'
local suite = require('openbus.test.core.services.Suite')
local Runner = require('loop.test.Results')
local path = {}
for name in string.gmatch('$2', '[^.]+') do
......
Supports Markdown
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