#9651 Nightly test failure (f42+) in test_commands
Closed: fixed by frenaud. Opened by frenaud.

The nightly test test_integration/test_commands.py is failing in rawhide (f42) in the tests TestIPACommand::test_ipa_nis_manage_enable. TestIPACommand::test_ipa_nis_manage_disable and TestIPACommandWithoutReplica::test_basesearch_compat_tree.

This failure is related to the update to slapi-nis 0.70.0 which removes support for NIS server.

  • Logs for test_integration/test_commands.py::TestIPACommand::test_ipa_nis_manage_enable:
self = <ipatests.test_integration.test_commands.TestIPACommand object at 0x7f44777ec460>
    def test_ipa_nis_manage_enable(self):
        """
        This testcase checks if ipa-nis-manage enable
        command enables plugin on an IPA master
        """
        dirsrv_service = self.get_dirsrv_id()
        console_msg = (
            "Enabling plugin\n"
            "This setting will not take effect until "
            "you restart Directory Server.\n"
            "The rpcbind service may need to be started"
        )
        status_msg = "Plugin is enabled"
        tasks.kinit_admin(self.master)
>       result = self.master.run_command(
            ["ipa-nis-manage", "enable"],
            stdin_text=self.master.config.admin_password,
        )
console_msg = 'Enabling plugin\nThis setting will not take effect until you restart Directory Server.\nThe rpcbind service may need to be started'
dirsrv_service = 'dirsrv@UFREEIPA-TEST.service'
self       = <ipatests.test_integration.test_commands.TestIPACommand object at 0x7f44777ec460>
status_msg = 'Plugin is enabled'
test_integration/test_commands.py:1286: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
argv = ['ipa-nis-manage', 'enable'], set_env = True, stdin_text = 'Secret.123'
log_stdout = True, raiseonerr = True, cwd = None, bg = False, encoding = 'utf-8'
ok_returncode = 0
    def run_command(self, argv, set_env=True, stdin_text=None,
                    log_stdout=True, raiseonerr=True,
                    cwd=None, bg=False, encoding='utf-8', ok_returncode=0):
        """Wrapper around run_command to log stderr on raiseonerr=True
        :param ok_returncode: return code considered to be correct,
                              you can pass an integer or sequence of integers
        """
        result = super().run_command(
            argv, set_env=set_env, stdin_text=stdin_text,
            log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg,
            encoding=encoding
        )
        # in FIPS mode SSH may print noise to stderr, remove the string
        # "FIPS mode initialized" + optional newline.
        result.stderr_bytes = FIPS_NOISE_RE.sub(b'', result.stderr_bytes)
        try:
            result_ok = result.returncode in ok_returncode
        except TypeError:
            result_ok = result.returncode == ok_returncode
        if not result_ok and raiseonerr:
            result.log.error('stderr: %s', result.stderr_text)
>           raise subprocess.CalledProcessError(
                result.returncode, argv,
                result.stdout_text, result.stderr_text
            )
E           subprocess.CalledProcessError: Command '['ipa-nis-manage', 'enable']' returned non-zero exit status 1.
__class__  = <class 'ipatests.pytest_ipa.integration.host.Host'>
argv       = ['ipa-nis-manage', 'enable']
bg         = False
cwd        = None
encoding   = 'utf-8'
log_stdout = True
ok_returncode = 0
raiseonerr = True
result     = <pytest_multihost.transport.SSHCommand object at 0x7f44777d0e50>
result_ok  = False
self       = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
set_env    = True
stdin_text = 'Secret.123'
pytest_ipa/integration/host.py:202: CalledProcessError
----------------------------- Captured stderr call -----------------------------
ipa: ERROR: stderr: ipaserver.install.ldapupdate: ERROR    Add failure Server is unwilling to perform: Invalid plugin path
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=passwd.byname,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=passwd.byuid,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=group.byname,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=group.bygid,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=netid.byname,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=netgroup,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=ethers.byaddr,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
ipaserver.install.ldapupdate: ERROR    Parent DN of nis-domain=ufreeipa.test+nis-map=ethers.byname,cn=NIS Server,cn=plugins,cn=config may not exist, cannot create the entry
  • Logs for test_integration/test_commands.py::TestIPACommand::test_ipa_nis_manage_disable:
self = <ipatests.test_integration.test_commands.TestIPACommand object at 0x7f44777ec4b0>
    def test_ipa_nis_manage_disable(self):
        """
        This testcase checks if ipa-nis-manage disable
        command disable plugin on an IPA Master
        """
        dirsrv_service = self.get_dirsrv_id()
        msg = (
            "This setting will not take effect "
            "until you restart Directory Server."
        )
        status_msg = "Plugin is not enabled"
        tasks.kinit_admin(self.master)
>       result = self.master.run_command(
            ["ipa-nis-manage", "disable"],
            stdin_text=self.master.config.admin_password,
        )
dirsrv_service = 'dirsrv@UFREEIPA-TEST.service'
msg        = 'This setting will not take effect until you restart Directory Server.'
self       = <ipatests.test_integration.test_commands.TestIPACommand object at 0x7f44777ec4b0>
status_msg = 'Plugin is not enabled'
test_integration/test_commands.py:1320: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
argv = ['ipa-nis-manage', 'disable'], set_env = True, stdin_text = 'Secret.123'
log_stdout = True, raiseonerr = True, cwd = None, bg = False, encoding = 'utf-8'
ok_returncode = 0
    def run_command(self, argv, set_env=True, stdin_text=None,
                    log_stdout=True, raiseonerr=True,
                    cwd=None, bg=False, encoding='utf-8', ok_returncode=0):
        """Wrapper around run_command to log stderr on raiseonerr=True
        :param ok_returncode: return code considered to be correct,
                              you can pass an integer or sequence of integers
        """
        result = super().run_command(
            argv, set_env=set_env, stdin_text=stdin_text,
            log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg,
            encoding=encoding
        )
        # in FIPS mode SSH may print noise to stderr, remove the string
        # "FIPS mode initialized" + optional newline.
        result.stderr_bytes = FIPS_NOISE_RE.sub(b'', result.stderr_bytes)
        try:
            result_ok = result.returncode in ok_returncode
        except TypeError:
            result_ok = result.returncode == ok_returncode
        if not result_ok and raiseonerr:
            result.log.error('stderr: %s', result.stderr_text)
>           raise subprocess.CalledProcessError(
                result.returncode, argv,
                result.stdout_text, result.stderr_text
            )
E           subprocess.CalledProcessError: Command '['ipa-nis-manage', 'disable']' returned non-zero exit status 2.
__class__  = <class 'ipatests.pytest_ipa.integration.host.Host'>
argv       = ['ipa-nis-manage', 'disable']
bg         = False
cwd        = None
encoding   = 'utf-8'
log_stdout = True
ok_returncode = 0
raiseonerr = True
result     = <pytest_multihost.transport.SSHCommand object at 0x7f44778e8c90>
result_ok  = False
self       = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
set_env    = True
stdin_text = 'Secret.123'
pytest_ipa/integration/host.py:202: CalledProcessError
----------------------------- Captured stderr call -----------------------------
ipa: ERROR: stderr: 
------------------------------ Captured log call -------------------------------
INFO     ipatests.pytest_ipa.integration.host.Host.master.IPAOpenSSHTransport:transport.py:391 RUN ['kinit', 'admin']
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd453:transport.py:513 RUN ['kinit', 'admin']
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd453:transport.py:557 Password for admin@UFREEIPA.TEST: 
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd453:transport.py:217 Exit code: 0
INFO     ipatests.pytest_ipa.integration.host.Host.master.IPAOpenSSHTransport:transport.py:391 RUN ['ipa-nis-manage', 'disable']
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd454:transport.py:513 RUN ['ipa-nis-manage', 'disable']
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd454:transport.py:557 Directory Manager password: 
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd454:transport.py:557 Plugin is already disabled
DEBUG    ipatests.pytest_ipa.integration.host.Host.master.cmd454:transport.py:217 Exit code: 2
ERROR    ipatests.pytest_ipa.integration.host.Host.master.cmd454:host.py:201 stderr:
  • Logs for test_integration/test_commands.py::TestIPACommandWithoutReplica::test_basesearch_compat_tree:
self = <ipatests.test_integration.test_commands.TestIPACommandWithoutReplica object at 0x7f4477d07d90>
    def test_basesearch_compat_tree(self):
        """Test ldapsearch against compat tree is working
        This to ensure that ldapsearch with base scope is not failing.
        related: https://bugzilla.redhat.com/show_bug.cgi?id=1958909
        """
        version = self.master.run_command(
            ["rpm", "-qa", "--qf", "%{VERSION}", "slapi-nis"]
        )
        if tasks.get_platform(self.master) == "fedora" and parse_version(
                version.stdout_text) <= parse_version("0.56.7"):
            pytest.skip("Test requires slapi-nis with fix on fedora")
        tasks.kinit_admin(self.master)
        base_dn = str(self.master.domain.basedn)
        base = "cn=admins,cn=groups,cn=compat,{basedn}".format(basedn=base_dn)
>       tasks.ldapsearch_dm(self.master, base, ldap_args=[], scope='sub')
base       = 'cn=admins,cn=groups,cn=compat,dc=ufreeipa,dc=test'
base_dn    = 'dc=ufreeipa,dc=test'
self       = <ipatests.test_integration.test_commands.TestIPACommandWithoutReplica object at 0x7f4477d07d90>
version    = <pytest_multihost.transport.SSHCommand object at 0x7f4477718590>
test_integration/test_commands.py:1700: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pytest_ipa/integration/tasks.py:2168: in ldapsearch_dm
    return host.run_command(args, **kwargs)
        args       = ['ldapsearch', '-x', '-ZZ', '-H', 'ldap://master.ufreeipa.test', '-D', ...]
        base       = 'cn=admins,cn=groups,cn=compat,dc=ufreeipa,dc=test'
        host       = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
        kwargs     = {}
        ldap_args  = []
        scope      = 'sub'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
argv = ['ldapsearch', '-x', '-ZZ', '-H', 'ldap://master.ufreeipa.test', '-D', ...]
set_env = True, stdin_text = None, log_stdout = True, raiseonerr = True
cwd = None, bg = False, encoding = 'utf-8', ok_returncode = 0
    def run_command(self, argv, set_env=True, stdin_text=None,
                    log_stdout=True, raiseonerr=True,
                    cwd=None, bg=False, encoding='utf-8', ok_returncode=0):
        """Wrapper around run_command to log stderr on raiseonerr=True
        :param ok_returncode: return code considered to be correct,
                              you can pass an integer or sequence of integers
        """
        result = super().run_command(
            argv, set_env=set_env, stdin_text=stdin_text,
            log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg,
            encoding=encoding
        )
        # in FIPS mode SSH may print noise to stderr, remove the string
        # "FIPS mode initialized" + optional newline.
        result.stderr_bytes = FIPS_NOISE_RE.sub(b'', result.stderr_bytes)
        try:
            result_ok = result.returncode in ok_returncode
        except TypeError:
            result_ok = result.returncode == ok_returncode
        if not result_ok and raiseonerr:
            result.log.error('stderr: %s', result.stderr_text)
>           raise subprocess.CalledProcessError(
                result.returncode, argv,
                result.stdout_text, result.stderr_text
            )
E           subprocess.CalledProcessError: Command '['ldapsearch', '-x', '-ZZ', '-H', 'ldap://master.ufreeipa.test', '-D', 'cn=Directory Manager', '-w', 'Secret.123', '-s', 'sub', '-b', 'cn=admins,cn=groups,cn=compat,dc=ufreeipa,dc=test', '-o', 'ldif-wrap=no', '-LLL']' returned non-zero exit status 32.
__class__  = <class 'ipatests.pytest_ipa.integration.host.Host'>
argv       = ['ldapsearch', '-x', '-ZZ', '-H', 'ldap://master.ufreeipa.test', '-D', ...]
bg         = False
cwd        = None
encoding   = 'utf-8'
log_stdout = True
ok_returncode = 0
raiseonerr = True
result     = <pytest_multihost.transport.SSHCommand object at 0x7f4477718c90>
result_ok  = False
self       = <ipatests.pytest_ipa.integration.host.Host master.ufreeipa.test (master)>
set_env    = True
stdin_text = None
pytest_ipa/integration/host.py:202: CalledProcessError
----------------------------- Captured stderr call -----------------------------
ipa: ERROR: stderr: No such object (32)
Matched DN: dc=ufreeipa,dc=test

The compat tree searches seem broken with slapi-nis 0.70.0, see https://pagure.io/slapi-nis/issue/54


https://github.com/freeipa/freeipa/pull/7336 removes all these tests along with NIS configuration. The failures are expected until this PR is merged.

PR 7336 has been merged, closing as Fixed.

Metadata