#7855 Automember XML-RPC test failure
Closed: fixed a year ago by frenaud. Opened a year ago by cheimes.

Two automember tests of the XML-RPC test suite have started to fail with 389-DS 1.4.0.21 update. The test failure seems to be related to a change of 389-DS' automember plugin, https://www.port389.org/docs/389ds/design/automember-postop-modify-design.html. Rob and I aren't sure what is going on exactly. The test cases may be bogus.

____ TestAutomemberRebuildHostMembership.test_rebuild_membership_hostgroups ____
self = <ipatests.test_xmlrpc.test_automember_plugin.TestAutomemberRebuildHostMembership object at 0x7f0889dc0518>
automember_hostgroup = <ipatests.test_xmlrpc.tracker.automember_plugin.AutomemberTracker object at 0x7f0889dacc50>
hostgroup1 = <ipatests.test_xmlrpc.tracker.hostgroup_plugin.HostGroupTracker object at 0x7f0889e17dd8>
host1 = <ipatests.test_xmlrpc.tracker.host_plugin.HostTracker object at 0x7f0889dacdd8>
    def test_rebuild_membership_hostgroups(self, automember_hostgroup,
                                           hostgroup1, host1):
        """ Rebuild automember membership for hosts, both synchonously and
            asynchronously. Check the host has been added to the hostgroup. """
        automember_hostgroup.rebuild()
        hostgroup1.attrs.update(member_host=[host1.fqdn])
        hostgroup1.retrieve()
>       hostgroup1.remove_member(dict(host=host1.fqdn))
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/test_automember_plugin.py:267: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/tracker/hostgroup_plugin.py:129: in remove_member
    self.check_remove_member(result)
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/tracker/hostgroup_plugin.py:257: in check_remove_member
    self.check_add_member(result)
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/tracker/hostgroup_plugin.py:219: in check_add_member
    ), result)
/usr/lib/python3.6/site-packages/ipatests/util.py:446: in assert_deepequal
    assert_deepequal(e_sub, g_sub, doc, stack + (key,))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
expected = {'cn': ['thostgroup1'], 'description': ['Automember test hostgroup1'], 'dn': ipapython.dn.DN('cn=thostgroup1,cn=hostgroups,cn=accounts,dc=ipa,dc=test')}
got = {'cn': ('thostgroup1',), 'description': ('Automember test hostgroup1',), 'dn': 'cn=thostgroup1,cn=hostgroups,cn=accounts,dc=ipa,dc=test', 'member_host': ('web1.ipa.test',)}
doc = '', stack = ('result',)
_____ TestAutomemberRebuildGroupMembership.test_rebuild_membership_groups ______
self = <ipatests.test_xmlrpc.test_automember_plugin.TestAutomemberRebuildGroupMembership object at 0x7f0889cf6198>
automember_group = <ipatests.test_xmlrpc.tracker.automember_plugin.AutomemberTracker object at 0x7f0889dd0fd0>
group1 = <ipatests.test_xmlrpc.tracker.group_plugin.GroupTracker object at 0x7f0889dd0160>
user1 = <ipatests.test_xmlrpc.tracker.user_plugin.UserTracker object at 0x7f0889dd0b70>
    def test_rebuild_membership_groups(self, automember_group, group1, user1):
        """ Rebuild automember membership for groups, both synchonously and
            asynchronously. Check the user has been added to the group. """
        automember_group.rebuild()
        group1.attrs.update(member_user=[user1.name])
        group1.retrieve()
>       group1.remove_member(dict(user=user1.name))
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/test_automember_plugin.py:315: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/tracker/group_plugin.py:167: in remove_member
    self.check_remove_member(result)
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/tracker/group_plugin.py:275: in check_remove_member
    self.check_add_member(result)
/usr/lib/python3.6/site-packages/ipatests/test_xmlrpc/tracker/group_plugin.py:226: in check_add_member
    ), result)
/usr/lib/python3.6/site-packages/ipatests/util.py:446: in assert_deepequal
    assert_deepequal(e_sub, g_sub, doc, stack + (key,))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
expected = {'cn': ['tgroup1'], 'description': ['Automember test group1'], 'dn': ipapython.dn.DN('cn=tgroup1,cn=groups,cn=accounts,dc=ipa,dc=test'), 'gidnumber': [Fuzzy('^\\d+$', <class 'str'>, None)]}
got = {'cn': ('tgroup1',), 'description': ('Automember test group1',), 'dn': 'cn=tgroup1,cn=groups,cn=accounts,dc=ipa,dc=test', 'gidnumber': ('422600006',), ...}
doc = '', stack = ('result',)

I'm pretty well-convinced that this test is just bogus (focusing on the host one but this applies to user groups as well).

It was improperly converted from the more verbose form into the newer, compact form.

The previous test created the host and then created the hostgroup and automember rules, thereby preventing its inclusion into the rule (which don't apply to existing hosts). The test retrieved the host to confirm it lacked membership, ran rebuild, then retrieved again to confirm it was now a member.

The replacement test does none of this. The host already exists. The hostgorup already exists. The automember rule already exists. It manually adds the host as a member of the automember hostgroup AFTER the rebuild is executed. This makes zero sense. Then it manually removes the host for some unknown reason. Either way this is not exercising rebuild in any way. It might be exercising the new rebuild-on-mod feature in 389 but that is a side effect, not the purpose.

+1 on marking these as xfail for now so we can write proper tests for rebuild.

master:

  • 0b17ae9 Require 389-ds 1.4.0.21
  • dc33be7 Mark two failing automember tests as xfail

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

a year ago

ipa-4-7:

  • 5845fed Mark two failing automember tests as xfail
  • 7773782 Require 389-ds 1.4.0.21

Metadata Update from @cheimes:
- Issue status updated to: Open (was: Closed)

a year ago

Metadata Update from @pvoborni:
- Custom field test_case adjusted to fedora-29/test_webui_identity

a year ago

Metadata Update from @frenaud:
- Issue assigned to frenaud

a year ago

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

a year ago

Metadata Update from @frenaud:
- Issue set to the milestone: FreeIPA 4.7.3

a year ago

master:

  • 3337840 XML RPC test: fix test_automember_plugin

ipa-4-7:

  • 1b8ba57 XML RPC test: fix test_automember_plugin

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

a year ago

Login to comment on this ticket.

Metadata