#9850 Test failure in test_xmlrpc/test_automember_plugin.py/TestAutomemberFindOrphans
Closed: fixed by frenaud. Opened by frenaud.

Issue

The test test_xmlrpc/test_automember_plugin.py/TestAutomemberFindOrphans is failing with the update of 389-ds to 3.1.3.

Example of failing run in PR #7922 in the azure pipeline. Logs are available in publishedArtifacts

More details in runner_xmlrpc.log

[2025-09-04 12:50:04] =================================== FAILURES ===================================
[2025-09-04 12:50:04] _________ TestAutomemberFindOrphans.test_find_orphan_automember_rules __________
[2025-09-04 12:50:04] 
[2025-09-04 12:50:04] self = <ipatests.test_xmlrpc.test_automember_plugin.TestAutomemberFindOrphans object at 0x7fd9c2bc5a90>
[2025-09-04 12:50:04] hostgroup1 = <ipatests.test_xmlrpc.tracker.hostgroup_plugin.HostGroupTracker object at 0x7fd9c1bf7860>
[2025-09-04 12:50:04] 
[2025-09-04 12:50:04]     def test_find_orphan_automember_rules(self, hostgroup1):
[2025-09-04 12:50:04]         """ Remove hostgroup1, find and remove obsolete automember rules. """
[2025-09-04 12:50:04]         # Remove hostgroup1
[2025-09-04 12:50:04]     
[2025-09-04 12:50:04]         hostgroup1.ensure_missing()
[2025-09-04 12:50:04]     
[2025-09-04 12:50:04]         # Test rebuild (is failing)
[2025-09-04 12:50:04]         # rebuild fails if 389-ds is older than 1.4.0.22 where unmembering
[2025-09-04 12:50:04]         # feature was implemented: https://pagure.io/389-ds-base/issue/50077
[2025-09-04 12:50:04]         if not have_ldap2:
[2025-09-04 12:50:04]             pytest.skip('server plugin not available')
[2025-09-04 12:50:04]         ldap = ldap2(api)
[2025-09-04 12:50:04]         ldap.connect()
[2025-09-04 12:50:04]         rootdse = ldap.get_entry(DN(''), ['vendorVersion'])
[2025-09-04 12:50:04]         version = rootdse.single_value.get('vendorVersion')
[2025-09-04 12:50:04]         # The format of vendorVersion is the following:
[2025-09-04 12:50:04]         # 389-Directory/1.3.8.4 B2019.037.1535
[2025-09-04 12:50:04]         # Extract everything between 389-Directory/ and ' B'
[2025-09-04 12:50:04]         mo = re.search(r'389-Directory/(.*) B', version)
[2025-09-04 12:50:04] >       vendor_version = parse_version(mo.groups()[0])
[2025-09-04 12:50:04] 
[2025-09-04 12:50:04] test_xmlrpc/test_automember_plugin.py:1508: 
[2025-09-04 12:50:04] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[2025-09-04 12:50:04] ../packaging/version.py:56: in parse
[2025-09-04 12:50:04]     return Version(version)
[2025-09-04 12:50:04] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[2025-09-04 12:50:04] 
[2025-09-04 12:50:04] self = <[AttributeError("'Version' object has no attribute '_version'") raised in repr()] Version object at 0x7fd9c182dd10>
[2025-09-04 12:50:04] version = '3.1.3.202508211348git1ca3f89'

The error happens when the test tries to parse 389 ds version from the base DN entry.
The returned entry looks like:

dn:
vendorVersion: 389-Directory/3.1.3.202508211348git1ca3f89 B2025.233.0000

and the test is using packaging.version's method parse which expects a format compatible with python versioning guidelines.

With the previous 389 ds version the vendorVersion looked like:

dn:
vendorVersion: 389-Directory/3.0.6 B2025.045.0000

and didn't contain date and git commit hash.

Package: 389-ds-base-3.1.3-2.fc42.x86_64

It is simple to fix the test and remove the version check (rebuild fails if 389-ds is older than 1.4.0.22, and fedora 41 ships 389-ds 3.x so we don't expect any failure).


Metadata Update from @frenaud:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/7923

master:

  • ca29a5a43e1d66f6e25a59009592e58c0f59c393 xmlrpc test: fix test_find_orphan_automember_rules

ipa-4-12:

  • 03f48bffdd82cc48b5952c112db2b024f085d5d4 xmlrpc test: fix test_find_orphan_automember_rules

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

Metadata