#8890 Nightly test failure (rawhide) in test_ipa_cert_fix.py::TestIpaCertFix::test_missing_startup
Closed: fixed 3 years ago by frenaud. Opened 3 years ago by frenaud.

The nightly test test_ipa_cert_fix.py::TestIpaCertFix::test_missing_startup is failing in rawhide, see PR #992 with the following logs and report:

self = <ipatests.test_integration.test_ipa_cert_fix.TestIpaCertFix object at 0x7fbe89e7c790>
expire_cert_critical = <function expire_cert_critical.<locals>._expire_cert_critical at 0x7fbe89f13640>

    def test_missing_startup(self, expire_cert_critical):
        """
        Test ipa-cert-fix fails when startup directive is missing from CS.cfg

        This test checks that if 'selftests.container.order.startup' directive
        is missing from CS.cfg, ipa-cert-fix fails and throw proper error
        message. It also checks that underlying command 'pki-server cert-fix'
        should fail to renew the cert.

        related: https://pagure.io/freeipa/issue/8721
        """
        expire_cert_critical(self.master)
        # pki must be stopped in order to edit CS.cfg
        self.master.run_command(['ipactl', 'stop'])
        self.master.run_command([
            'sed', '-i', r'/selftests\.container\.order\.startup/d',
            paths.CA_CS_CFG_PATH
        ])
        # dirsrv needs to be up in order to run ipa-cert-fix
        self.master.run_command(['ipactl', 'start',
                                 '--ignore-service-failures'])

        result = self.master.run_command(['ipa-cert-fix', '-v'],
                                         stdin_text='yes\n',
                                         raiseonerr=False)
        err_msg1 = "ERROR: 'selftests.container.order.startup'"
        # check that pki-server cert-fix command fails
        err_msg2 = ("ERROR: CalledProcessError(Command "
                    "['pki-server', 'cert-fix'")
>       assert err_msg1 and err_msg2 in result.stderr_text
E       assert ("ERROR: 'selftests.container.order.startup'" and "ERROR: CalledProcessError(Command ['pki-server', 'cert-fix'" in "ipapython.admintool: DEBUG: Not logging to a file\nipalib.sysrestore: DEBUG: Loading StateFile from '/var/lib/ipa/sys...r=ipa: INFO: The ipactl command was successful\n\nipapython.admintool: INFO: The ipa-cert-fix command was successful\n")
E        +  where "ipapython.admintool: DEBUG: Not logging to a file\nipalib.sysrestore: DEBUG: Loading StateFile from '/var/lib/ipa/sys...r=ipa: INFO: The ipactl command was successful\n\nipapython.admintool: INFO: The ipa-cert-fix command was successful\n" = <pytest_multihost.transport.SSHCommand object at 0x7fbe89b80490>.stderr_text

Test scenario:
- edit CS.cfg and remove the directive 'selftests.container.order.startup'
- restart pki
- run ipa-cert-fix

The test expects a failure in ipa-cert-fix but PKI fixed the issue in BZ 1930586, which means that the test should not expect failure any more.

The fix was done in the master branch of pki:
269a38bac cert-fix: emit warning if subsystem has selftests configured
714ef899b cert-fix: avoid crash on missing CS.cfg param
and released in pki-server-10.11.0-0.4.alpha1. Rawhide now ships pki-server-10.11.0-0.4.alpha2.fc35.noarch with the fix.

We need to change the test, so that it does not expect a failure if pki 10.11.0+ is installed.


master:

  • ea8f4b6 ipatests: Test ipa-cert-fix warns when startup directive is missing from CS.cfg

ipa-4-9:

  • 02c0da3 ipatests: Test ipa-cert-fix warns when startup directive is missing from CS.cfg

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 years ago

master:

  • bb38fbc ipatests: Look for warning into stderr instead of stdout

ipa-4-9:

  • 96dd8ac ipatests: Look for warning into stderr instead of stdout

Log in to comment on this ticket.

Metadata