#6349 Tests: incomplete cleanup of CA plugin XMLRPC tests
Closed: Fixed None Opened 7 years ago by mbabinsk.

CA plugin tests leave behind a couple of sub-CA certificates which are not deleted after the testing sub-CAs are removed:

# ipa cert-find --revocation-reason=0
----------------------
4 certificates matched
----------------------
  Issuing CA: ipa
  Subject: CN=crud subca test,O=crud testing inc
  Issuer: CN=Certificate Authority,O=IPA.TEST
  Serial number: 30
  Serial number (hex): 0x1E
  Status: REVOKED
  Revoked: True

  Issuing CA: ipa
  Subject: CN=crud subca test,O=crud testing inc
  Issuer: CN=Certificate Authority,O=IPA.TEST
  Serial number: 31
  Serial number (hex): 0x1F
  Status: REVOKED
  Revoked: True

  Issuing CA: ipa
  Subject: CN=caacl test subca,O=test industries inc.
  Issuer: CN=Certificate Authority,O=IPA.TEST
  Serial number: 32
  Serial number (hex): 0x20
  Status: REVOKED
  Revoked: True

  Issuing CA: ipa
  Subject: CN=SMIME CA,O=test industries Inc.
  Issuer: CN=Certificate Authority,O=IPA.TEST
  Serial number: 37
  Serial number (hex): 0x25
  Status: REVOKED
  Revoked: True
----------------------------
Number of entries returned 4
----------------------------

When the whole RPC test suite is run together, these leftovers cause one failure in cert plugin suite:

===================================================== FAILURES =====================================================
________________________________ test_cert_find.test_0007_find_revocation_reason_0 _________________________________

self = <ipatests.test_xmlrpc.test_cert_plugin.test_cert_find object at 0x7f1574c2e190>

    def test_0007_find_revocation_reason_0(self):
        """
            Find all certificates with revocation reason 0
            """
        res = api.Command['cert_find'](revocation_reason=0)
>       assert 'count' in res and res['count'] == 0
E       assert ('count' in {'count': 4, 'result': ({'cacn': 'ipa', 'issuer': 'CN=Certificate Authority,O=IPA.TEST', 'revoked': True, 'serial_numb...rity,O=IPA.TEST', 'revoked': True, 'serial_number': 37, ...}), 'summary': '4 certificates matched', 'truncated': False} and 4 == 0)

test_xmlrpc/test_cert_plugin.py:304: AssertionError
=============================== 1 failed, 1912 passed, 52 skipped in 728.17 seconds ===============================

Fix the test_ca_plugin.py teardown so that there are no leftovers leaking and breaking other test suites.


master:

  • c9c92e3 Tests: Remove invalid certplugin tests
  • 8f04d1a Tests: Certificate revocation

Patches for IPA 4.4 will come later

ipa-4-4:

  • afabdd3 Tests: Remove invalid certplugin tests
  • c8cdc6a Tests: Certificate revocation

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

7 years ago

Login to comment on this ticket.

Metadata