#8462 NIghtly test failure in test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_preconditions::setup
Closed: worksforme by frenaud. Opened by sumedhs.

The nightly test [testing_master_previous] Nightly PR failed at
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_preconditions::setup in PR 345. Logs available location.

The test is failing when calling establish_winsync_agreement. It tries to fetch contents of
/cygdrive/c/Windows/System32/CertSrv/CertEnroll/ad-root.ad.test_ad-AD-ROOT-CA.crt via get_file_contents

cls = <class 'ipatests.test_integration.test_winsyncmigrate.TestWinsyncMigrate'>
mh = <pytest_multihost.plugin.MultihostFixture object at 0x7f37369b82d0>
    @classmethod
    def install(cls, mh):
        super(TestWinsyncMigrate, cls).install(mh)
        cls.ad = cls.ads[0]
        cls.trust_test_user = '%s@%s' % (cls.ad_user, cls.ad.domain.name)
        tasks.configure_dns_for_trust(cls.master, cls.ad)
        tasks.install_adtrust(cls.master)
        cls.create_test_objects()
>       establish_winsync_agreement(cls.master, cls.ad)
test_integration/test_winsyncmigrate.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test_integration/test_winsyncmigrate.py:34: in establish_winsync_agreement
    win_cert = get_windows_certificate(ad)
test_integration/test_winsyncmigrate.py:24: in get_windows_certificate
    return ad_host.get_file_contents(os.path.join(certs_path, cert_filename))
../pytest_multihost/host.py:191: in get_file_contents
    return self.transport.get_file_contents(filename, encoding=encoding)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <ipatests.pytest_ipa.integration.transport.IPAOpenSSHTransport object at 0x7f3736a53250>
filename = '/cygdrive/c/Windows/System32/CertSrv/CertEnroll/ad-root.ad.test_ad-AD-ROOT-CA.crt'
encoding = None
    def get_file_contents(self, filename, encoding=None):
        self.log.info('GET %s', filename)
        cmd = self._run(['cat', filename], log_stdout=False)
        cmd.wait(raiseonerr=False)
        if cmd.returncode == 0:
            result = cmd.stdout_bytes
            if encoding:
                result = result.decode(encoding)
            return result
        else:
>           raise IOError('File %r could not be read' % filename)
E           OSError: File '/cygdrive/c/Windows/System32/CertSrv/CertEnroll/ad-root.ad.test_ad-AD-ROOT-CA.crt' could not be read
../pytest_multihost/transport.py:445: OSError

Following tests are failing due the same error mentioned above.

test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_preconditions::setup  
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_migration::setup  
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_replication_agreement_deleted::setup  
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_user_deleted_from_ipa_server::setup   
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_user_attributes_preserved::setup  
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_idoverride::setup     
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_groups_membership_preserved::setup    
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_role_membership_preserved::setup  
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_selinuxusermap_membership_preserved::setup    
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_hbacrule_membership_preserved::setup  
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_non_posix_chars_in_group_names_replaced::setup    
test_integration/test_winsyncmigrate.py::TestWinsyncMigrate::test_collisions_resolved::setup

Metadata Update from @frenaud:
- Issue tagged with: test-failure, tests

Issue happened only once, closing as worksforme.

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

@mpolovka
in PR741, the error happens at a different location:

E           subprocess.CalledProcessError: Command '['ipa-replica-manage', 'connect', '--winsync', '--binddn', 'cn=Administrator,cn=users,dc=ad,dc=test', '--bindpw', 'Secret123', '--password', 'Secret.123', '--cacert', '/tmp/tmp.CUrmoApGjR', '--passsync', 'dummy', 'ad-root.ad.test', '-v']' returned non-zero exit status 1.

which looks like issue 8691. Same comment for PR739.

=> we can keep this issue closed, let's focus rather on 8691.

Metadata