Build failed in Jenkins: cubicweb-seda » py27,debian_jessie #81

jenkins.logilab.org noreply at logilab.org
Tue Mar 14 17:20:11 CET 2017


https://jenkins.logilab.org/job/cubicweb-seda/TOXENV=py27,distributions=debian_jessie/81/Changes:

[Sylvain Thénault <sylvain.thenault at logilab.fr>] [test] Fix typo

[Sylvain Thénault <sylvain.thenault at logilab.fr>] [schema] Fix permissions of the clone_of relation

so user can clone entities.

------------------------------------------
[...truncated 12.33 KB...]
E       Unauthorized: You are not allowed to perform add operation on relation SEDAArchiveUnit clone_of SEDAArchiveUnit

.tox/py27/local/lib/python2.7/site-packages/cubicweb/schema.py:732: Unauthorized
____________________ ContainerTC.test_container_clone_clone ____________________

self = <test_entities.ContainerTC testMethod=test_container_clone_clone>

    def test_container_clone_clone(self):
        """Functional test for SEDA component clone."""
        with self.admin_access.repo_cnx() as cnx:
            unit, unit_alt, unit_alt_seq = create_archive_unit(None, cnx=cnx)
            cnx.commit()
    
            cloned = cnx.create_entity(unit.cw_etype, user_annotation=u'x', clone_of=unit)
>           cnx.commit()

test/test_entities.py:148: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:190: in check_open
    return func(cnx, *args, **kwargs)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:878: in commit
    operation.handle_event('precommit_event')
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/hook.py:769: in handle_event
    getattr(self, event)()
.tox/py27/local/lib/python2.7/site-packages/cubicweb/hooks/security.py:87: in precommit_event
    rdef.check_perm(cnx, action, fromeid=eidfrom, toeid=eidto)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <relation SEDAArchiveUnit clone_of SEDAArchiveUnit at @0x7f43517cc350>
_cw = <cubicweb.server.session.Connection object at 0x7f4351eedd50>
action = 'add', kwargs = {'fromeid': 6063, 'toeid': 6059}, DBG = False
groups = frozenset(['users'])

    def check_perm(self, _cw, action, **kwargs):
        # NB: _cw may be a server transaction or a request object.
        #
        # check user is in an allowed group, if so that's enough internal
        # transactions should always stop there
        DBG = False
        if server.DEBUG & server.DBG_SEC:
            if action in server._SECURITY_CAPS:
                _self_str = str(self)
                if server._SECURITY_ITEMS:
                    if any(item in _self_str for item in server._SECURITY_ITEMS):
                        DBG = True
                else:
                    DBG = True
        groups = self.get_groups(action)
        if _cw.user.matching_groups(groups):
            if DBG:
                print('check_perm: %r %r: user matches %s' % (action, _self_str, groups))
            return
        # if 'owners' in allowed groups, check if the user actually owns this
        # object, if so that's enough
        #
        # NB: give _cw to user.owns since user is not be bound to a transaction on
        # the repository side
        if 'owners' in groups and (
                kwargs.get('creating')
                or ('eid' in kwargs and _cw.user.owns(kwargs['eid']))):
            if DBG:
                print('check_perm: %r %r: user is owner or creation time' %
                      (action, _self_str))
            return
        # else if there is some rql expressions, check them
        if DBG:
            print('check_perm: %r %r %s' %
                  (action, _self_str, [(rqlexpr, kwargs, rqlexpr.check(_cw, **kwargs))
                                       for rqlexpr in self.get_rqlexprs(action)]))
        if any(rqlexpr.check(_cw, **kwargs)
               for rqlexpr in self.get_rqlexprs(action)):
            return
>       raise Unauthorized(action, str(self))
E       Unauthorized: You are not allowed to perform add operation on relation SEDAArchiveUnit clone_of SEDAArchiveUnit

.tox/py27/local/lib/python2.7/site-packages/cubicweb/schema.py:732: Unauthorized
_________________ CloneImportTC.test_import_multiple_entities __________________

self = <test_views.CloneImportTC testMethod=test_import_multiple_entities>

    def test_import_multiple_entities(self):
        with self.admin_access.cnx() as cnx:
            unit, unit_alt, unit_alt_seq = testutils.create_archive_unit(
                None, cnx=cnx,
                user_cardinality=u'0..1', user_annotation=u'plouf')
            cnx.commit()
        to_clone = [self.unit_eid, unit.eid]
        params = dict(eid=text_type(self.transfer_eid),
                      cloned=','.join([text_type(self.unit_eid), text_type(unit.eid)]))
        with self.admin_access.web_request(**params) as req:
            path, _ = self.expect_redirect_handle_request(
>               req, 'seda.doimport')

test/test_views.py:511: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/devtools/testlib.py:876: in expect_redirect_handle_request
    self.app_handle_request(req)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/devtools/testlib.py:731: in app_handle_request
    return self.app.core_handle(req)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/web/application.py:61: in wrapper
    return func(self, req)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/web/application.py:423: in core_handle
    result = self.error_handler(req, ex, tb=False)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/web/application.py:406: in core_handle
    txuuid = req.cnx.commit()
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:190: in check_open
    return func(cnx, *args, **kwargs)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:878: in commit
    operation.handle_event('precommit_event')
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/hook.py:769: in handle_event
    getattr(self, event)()
.tox/py27/local/lib/python2.7/site-packages/cubicweb/hooks/security.py:87: in precommit_event
    rdef.check_perm(cnx, action, fromeid=eidfrom, toeid=eidto)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <relation SEDAArchiveUnit clone_of SEDAArchiveUnit at @0x7f4343fb2710>
_cw = <cubicweb.server.session.Connection object at 0x7f4343b321d0>
action = 'add', kwargs = {'fromeid': 6080, 'toeid': 6068}, DBG = False
groups = frozenset(['users'])

    def check_perm(self, _cw, action, **kwargs):
        # NB: _cw may be a server transaction or a request object.
        #
        # check user is in an allowed group, if so that's enough internal
        # transactions should always stop there
        DBG = False
        if server.DEBUG & server.DBG_SEC:
            if action in server._SECURITY_CAPS:
                _self_str = str(self)
                if server._SECURITY_ITEMS:
                    if any(item in _self_str for item in server._SECURITY_ITEMS):
                        DBG = True
                else:
                    DBG = True
        groups = self.get_groups(action)
        if _cw.user.matching_groups(groups):
            if DBG:
                print('check_perm: %r %r: user matches %s' % (action, _self_str, groups))
            return
        # if 'owners' in allowed groups, check if the user actually owns this
        # object, if so that's enough
        #
        # NB: give _cw to user.owns since user is not be bound to a transaction on
        # the repository side
        if 'owners' in groups and (
                kwargs.get('creating')
                or ('eid' in kwargs and _cw.user.owns(kwargs['eid']))):
            if DBG:
                print('check_perm: %r %r: user is owner or creation time' %
                      (action, _self_str))
            return
        # else if there is some rql expressions, check them
        if DBG:
            print('check_perm: %r %r %s' %
                  (action, _self_str, [(rqlexpr, kwargs, rqlexpr.check(_cw, **kwargs))
                                       for rqlexpr in self.get_rqlexprs(action)]))
        if any(rqlexpr.check(_cw, **kwargs)
               for rqlexpr in self.get_rqlexprs(action)):
            return
>       raise Unauthorized(action, str(self))
E       Unauthorized: You are not allowed to perform add operation on relation SEDAArchiveUnit clone_of SEDAArchiveUnit

.tox/py27/local/lib/python2.7/site-packages/cubicweb/schema.py:732: Unauthorized
_____________________ CloneImportTC.test_import_one_entity _____________________

self = <test_views.CloneImportTC testMethod=test_import_one_entity>

    def test_import_one_entity(self):
        params = dict(eid=text_type(self.transfer_eid),
                      cloned=text_type(self.unit_eid))
        with self.admin_access.web_request(**params) as req:
            path, _ = self.expect_redirect_handle_request(
>               req, 'seda.doimport')

test/test_views.py:482: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/devtools/testlib.py:876: in expect_redirect_handle_request
    self.app_handle_request(req)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/devtools/testlib.py:731: in app_handle_request
    return self.app.core_handle(req)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/web/application.py:61: in wrapper
    return func(self, req)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/web/application.py:423: in core_handle
    result = self.error_handler(req, ex, tb=False)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/web/application.py:406: in core_handle
    txuuid = req.cnx.commit()
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:190: in check_open
    return func(cnx, *args, **kwargs)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:878: in commit
    operation.handle_event('precommit_event')
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/hook.py:769: in handle_event
    getattr(self, event)()
.tox/py27/local/lib/python2.7/site-packages/cubicweb/hooks/security.py:87: in precommit_event
    rdef.check_perm(cnx, action, fromeid=eidfrom, toeid=eidto)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <relation SEDAArchiveUnit clone_of SEDAArchiveUnit at @0x7f4343fb2710>
_cw = <cubicweb.server.session.Connection object at 0x7f434567a6d0>
action = 'add', kwargs = {'fromeid': 6068, 'toeid': 6060}, DBG = False
groups = frozenset(['users'])

    def check_perm(self, _cw, action, **kwargs):
        # NB: _cw may be a server transaction or a request object.
        #
        # check user is in an allowed group, if so that's enough internal
        # transactions should always stop there
        DBG = False
        if server.DEBUG & server.DBG_SEC:
            if action in server._SECURITY_CAPS:
                _self_str = str(self)
                if server._SECURITY_ITEMS:
                    if any(item in _self_str for item in server._SECURITY_ITEMS):
                        DBG = True
                else:
                    DBG = True
        groups = self.get_groups(action)
        if _cw.user.matching_groups(groups):
            if DBG:
                print('check_perm: %r %r: user matches %s' % (action, _self_str, groups))
            return
        # if 'owners' in allowed groups, check if the user actually owns this
        # object, if so that's enough
        #
        # NB: give _cw to user.owns since user is not be bound to a transaction on
        # the repository side
        if 'owners' in groups and (
                kwargs.get('creating')
                or ('eid' in kwargs and _cw.user.owns(kwargs['eid']))):
            if DBG:
                print('check_perm: %r %r: user is owner or creation time' %
                      (action, _self_str))
            return
        # else if there is some rql expressions, check them
        if DBG:
            print('check_perm: %r %r %s' %
                  (action, _self_str, [(rqlexpr, kwargs, rqlexpr.check(_cw, **kwargs))
                                       for rqlexpr in self.get_rqlexprs(action)]))
        if any(rqlexpr.check(_cw, **kwargs)
               for rqlexpr in self.get_rqlexprs(action)):
            return
>       raise Unauthorized(action, str(self))
E       Unauthorized: You are not allowed to perform add operation on relation SEDAArchiveUnit clone_of SEDAArchiveUnit

.tox/py27/local/lib/python2.7/site-packages/cubicweb/schema.py:732: Unauthorized
=================== 5 failed, 105 passed in 1003.02 seconds ====================
ERROR: InvocationError: '<https://jenkins.logilab.org/job/cubicweb-seda/TOXENV=py27,distributions=debian_jessie/ws/.tox/py27/bin/python> -m pytest <https://jenkins.logilab.org/job/cubicweb-seda/TOXENV=py27,distributions=debian_jessie/ws/test'>
___________________________________ summary ____________________________________
ERROR:   py27: commands failed
Build step 'Execute shell' marked build as failure



More information about the saem-devel mailing list