#6312 Failing ldap backend test because service not found
Closed: Fixed None Opened 7 years ago by lryznaro.

ipatests/test_ipaserver/test_ldap.py::test_Backend fails:

self = <ipatests.test_ipaserver.test_ldap.test_ldap object at 0x7f744555f9d0>

    def test_Backend(self):
        """
            Test using the ldap2 Backend directly (ala ipa-server-install)
            """

        # Create our own api because the one generated for the tests is
        # a client-only api. Then we register in the commands and objects
        # we need for the test.
        myapi = create_api(mode=None)
        myapi.bootstrap(context='cli', in_server=True, in_tree=True)
        myapi.finalize()

        pwfile = api.env.dot_ipa + os.sep + ".dmpw"
        if ipautil.file_exists(pwfile):
            fp = open(pwfile, "r")
            dm_password = fp.read().rstrip()
            fp.close()
        else:
            raise nose.SkipTest("No directory manager password in %s" % pwfile)
        myapi.Backend.ldap2.connect(bind_dn=DN(('cn', 'Directory Manager')), bind_pw=dm_password)

>       result = myapi.Command['service_show']('ldap/%s@%s' %  (api.env.host, api.env.realm,))

ipatests/test_ipaserver/test_ldap.py:130: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ipalib/frontend.py:449: in __call__
    return self.__do_call(*args, **options)
ipalib/frontend.py:477: in __do_call
    ret = self.run(*args, **options)
ipalib/frontend.py:799: in run
    return self.execute(*args, **options)
ipaserver/plugins/baseldap.py:1321: in execute
    self.obj.handle_not_found(*keys)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = ipaserver.plugins.service.service(), keys = (<ipapython.kerberos.Principal object at 0x7f74454f9a50>,), pkey = <ipapython.kerberos.Principal object at 0x7f74454f9a50>

    def handle_not_found(self, *keys):
        pkey = ''
        if self.primary_key:
            pkey = keys[-1]
        raise errors.NotFound(
            reason=self.object_not_found_msg % {
>               'pkey': pkey, 'oname': self.object_name,
            }
        )
E       NotFound: ldap/vm-030.abc.idm.lab.eng.brq.redhat.com@DOM-030.ABC.IDM.LAB.ENG.BRQ.REDHAT.COM: service not found

ipaserver/plugins/baseldap.py:759: NotFound

This fail occurs only when run after tests that user create_test_api method (e.g. test_ipalib/test_backend.py::test_Executioner).


master:

  • 8c6f677 Tests: Fix failing ldap.backend test

ipa-4-4:

  • 0670721 Tests: Fix failing ldap.backend test

Metadata Update from @lryznaro:
- Issue assigned to lryznaro
- Issue set to the milestone: FreeIPA 4.4.2

7 years ago

Login to comment on this ticket.

Metadata