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

jenkins.logilab.org noreply at logilab.org
Wed Mar 8 10:36:31 CET 2017


https://jenkins.logilab.org/job/cubicweb-seda/TOXENV=py27,distributions=debian_jessie/73/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 8.92 KB...]
            unit, unit_alt, unit_alt_seq = create_archive_unit(None, cnx=cnx)
            bdo = create_data_object(unit_alt_seq)
            cnx.commit()
    
            unit.cw_clear_all_caches()
            self.assertEqual(unit.container, ())  # XXX arguable
            unit_alt_seq.cw_clear_all_caches()
            self.assertEqual(unit_alt_seq.container[0].eid, unit.eid)
            bdo.cw_clear_all_caches()
            self.assertEqual(bdo.container[0].eid, unit.eid)
    
            # test clone without reparenting
            cloned = cnx.create_entity(unit.cw_etype, user_annotation=u'clone',
                                       clone_of=unit)
>           cnx.commit()

test/test_entities.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.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 @0x7f9efc3ea110>
_cw = <cubicweb.server.session.Connection object at 0x7f9efcce2750>
action = 'add', kwargs = {'fromeid': 6065, 'toeid': 6057}, 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 @0x7f9eee3b2d90>
_cw = <cubicweb.server.session.Connection object at 0x7f9eeeee2d50>
action = 'add', kwargs = {'fromeid': 6078, 'toeid': 6066}, 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 @0x7f9eee3b2d90>
_cw = <cubicweb.server.session.Connection object at 0x7f9eef3ce850>
action = 'add', kwargs = {'fromeid': 6066, 'toeid': 6058}, 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
==================== 4 failed, 104 passed in 915.85 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