Commit 002f8706 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Release tag of version 2.0.0.8

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/tags/02_00_00_08@169253 ae0415b3-e90b-0410-900d-d0be9363c56b
parents 97fcd6c7 8922c3ee
......@@ -598,6 +598,38 @@ 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)
checks.assert(subscription, isOfferRegSubscription(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{
......@@ -973,6 +1005,38 @@ 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)
checks.assert(subscription, isOfferSubscription(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,
},
},
},
......
......@@ -4,11 +4,10 @@ mode=$1
bushost=$2
busport=$3
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"
busconsole="$busconsole DEBUG"
elif [[ "$mode" != "RELEASE" ]]; then
echo "Usage: $0 <RELEASE|DEBUG> <bus host> <bus port> <args>"
exit 1
......
......@@ -9,7 +9,7 @@ elif [[ "$mode" != "RELEASE" && "$mode" != "DEBUG" ]]; then
exit 1
fi
busport=20010
busport=20200
leasetime=6
passwordpenalty=6
......
......@@ -4,8 +4,8 @@ mode=$1
name=$2
port=$3
busssl="${OPENBUS_OPENSSL_HOME}/bin/openssl"
buscore="${OPENBUS_CORE_HOME}/bin/busservices"
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"
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=20208
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
......@@ -24,7 +24,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