#8553 Random failure in test_backup_and_restore.py::TestBackupRoles::test_rolecheck_Trust
Opened a month ago by frenaud. Modified a month ago

The nightly test test_backup_and_restore.py::TestBackupRoles::test_rolecheck_Trust randomly fails, see in PR #488 with the following report:

self = <ipatests.test_integration.test_backup_and_restore.TestBackupRoles object at 0x7fa76166a340>

    def test_rolecheck_Trust(self):
        """ipa-backup rolecheck: add Trust controllers/agents.

        # install AD Trust packages on replica first
        tasks.install_packages(self.replicas[0], ['*ipa-server-trust-ad'])
        tasks.install_packages(self.master, ['*ipa-server-trust-ad'])

        # make replicas[0] become Trust Controller
            'ipa-adtrust-install', '-U', '--netbios-name', 'IPA',
            '-a', self.master.config.admin_password,
        # double-check
        assert self._ipa_replica_role_check(
            self.replicas[0].hostname, self.serverroles['ADTC']
        # check that master has no AD Trust-related role
        assert not self._ipa_replica_role_check(
            self.master.hostname, self.serverroles['ADTA']

        # make master become Trust Agent
        cmd_input = (
            # admin password:
            self.master.config.admin_password + '\n' +
            # WARNING: The smb.conf already exists. Running ipa-adtrust-install
            # will break your existing samba configuration.
            # Do you wish to continue? [no]:
            # Enable trusted domains support in slapi-nis? [no]:
            '\n' +
            # WARNING: 1 IPA masters are not yet able to serve information
            # about users from trusted forests.
            # Installer can add them to the list of IPA masters allowed to
            # access information about trusts.
            # If you choose to do so, you also need to restart LDAP service on
            # those masters.
            # Refer to ipa-adtrust-install(1) man page for details.
            # IPA master[replica1.testrelm.test]?[no]:
            'ipa-adtrust-install', '--add-agents'], stdin_text=cmd_input
        # check that master is now an AD Trust agent
>       assert self._ipa_replica_role_check(
            self.master.hostname, self.serverroles['ADTA']
E       AssertionError: assert False
E        +  where False = <bound method TestBackupRoles._ipa_replica_role_check of <ipatests.test_integration.test_backup_and_restore.TestBackupRoles object at 0x7fa76166a340>>('master.ipa.test', 'AD trust agent')
E        +    where <bound method TestBackupRoles._ipa_replica_role_check of <ipatests.test_integration.test_backup_and_restore.TestBackupRoles object at 0x7fa76166a340>> = <ipatests.test_integration.test_backup_and_restore.TestBackupRoles object at 0x7fa76166a340>._ipa_replica_role_check
E        +    and   'master.ipa.test' = <ipatests.pytest_ipa.integration.host.Host master.ipa.test (master)>.hostname
E        +      where <ipatests.pytest_ipa.integration.host.Host master.ipa.test (master)> = <ipatests.test_integration.test_backup_and_restore.TestBackupRoles object at 0x7fa76166a340>.master

test_integration/test_backup_and_restore.py:1059: AssertionError

The test scenario is the following:
- make replicas[0] a trust controller
- make master a trust agent
- query server role on the master, should show master as trust agent.

The test can randomly fail if the query for the server role is executed before the replication had time to replicate the changes on cn=adtrust agents,cn=sysaccounts,cn=etc,dc=ipa,dc=test, as the server role is read using this entry.

Login to comment on this ticket.