The nightly test test_trust.py::TestTrust::test_establish_forest_trust_with_shared_secret is failing in the master branch, see PR #664 with the following logs and report:
test_trust.py::TestTrust::test_establish_forest_trust_with_shared_secret
self = <ipatests.test_integration.test_trust.TestTrust object at 0x7f9c14e1bd60> def test_establish_forest_trust_with_shared_secret(self): tasks.configure_dns_for_trust(self.master, self.ad) tasks.configure_windows_dns_for_trust(self.ad, self.master) # this is a workaround for # https://bugzilla.redhat.com/show_bug.cgi?id=1711958 self.master.run_command( ['ipa', 'dnsrecord-add', self.master.domain.name, self.srv_gc_record_name, '--srv-rec', self.srv_gc_record_value]) # create windows side of trust using powershell bindings # to .Net functions ps_cmd = ( '[System.DirectoryServices.ActiveDirectory.Forest]' '::getCurrentForest()' '.CreateLocalSideOfTrustRelationship("{}", 1, "{}")'.format( self.master.domain.name, self.shared_secret)) > self.ad.run_command(['powershell', '-c', ps_cmd]) test_integration/test_trust.py:614: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../pytest_multihost/host.py:271: in run_command command.wait() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pytest_multihost.transport.SSHCommand object at 0x7f9c14c3e5e0> raiseonerr = True def wait(self, raiseonerr=DEFAULT): """Wait for the remote process to exit Raises an exception if the exit code is not 0, unless ``raiseonerr`` is true. When ``raiseonerr`` is not specified as argument, the ``raiseonerr`` attribute is used. """ if raiseonerr is DEFAULT: raiseonerr = self.raiseonerr if self._done: return self.returncode self._end_process() self._done = True if raiseonerr and self.returncode: self.log.error('Exit code: %s', self.returncode) > raise subprocess.CalledProcessError(self.returncode, self.argv) E subprocess.CalledProcessError: Command '['powershell', '-c', '[System.DirectoryServices.ActiveDirectory.Forest]::getCurrentForest().CreateLocalSideOfTrustRelationship("ipa.test", 1, "qwertyuiopQq!1")']' returned non-zero exit status 1. ../pytest_multihost/transport.py:215: CalledProcessError
The powershell command is failing with the following output:
DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:513 RUN ['powershell', '-c', '[System.DirectoryServices.ActiveDirectory.Forest]::getCurrentForest().CreateLocalSideOfTrustRelationship("ipa.test", 1, "qwertyuiopQq!1")'] DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:557 Could not chdir to home directory /home/Administrator: No such file or directory DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:557 bash: line 1: cd: /home/Administrator: No such file or directory DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:557 bash: line 2: /home/Administrator/env.sh: No such file or directory DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:557 Exception calling "CreateLocalSideOfTrustRelationship" with "3" argument(s): DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:557 "A forest trust relationship exists between "ad.test" and "ipa.test"." DEBUG ipatests.pytest_ipa.integration.host.WinHost.ad-root.cmd8:transport.py:557 At line:1 char:1
A closer look at the previous test test_trust.py::TestTrust::test_remove_external_rootdomain_trust shows that the trust was not removed from AD side:
test_trust.py::TestTrust::test_remove_external_rootdomain_trust
INFO ipatests.pytest_ipa.integration.host.Host.master.IPAOpenSSHTransport:transport.py:391 RUN ['rpcclient', 'ad.test', '-U\\Administrator%Secret123', '-c', 'deletetrustdom ipa.test'] DEBUG ipatests.pytest_ipa.integration.host.Host.master.cmd684:transport.py:513 RUN ['rpcclient', 'ad.test', '-U\\Administrator%Secret123', '-c', 'deletetrustdom ipa.test'] DEBUG ipatests.pytest_ipa.integration.host.Host.master.cmd684:transport.py:557 Cannot connect to server. Error was NT_STATUS_UNSUCCESSFUL DEBUG ipatests.pytest_ipa.integration.host.Host.master.cmd684:transport.py:217 Exit code: 1
Need to investigate why the removal failed.
I think we need to switch creds in rpcclient to FQDN: instead of \\Administrator use Administrator@ad.domain.
\\Administrator
Administrator@ad.domain
Verified on local system with Samba 4.13+:
[root@master samba]# rpcclient win2016.test -U \\\\Administrator%Secret123 Cannot connect to server. Error was NT_STATUS_LOGON_FAILURE [root@master samba]# rpcclient win2016.test -U Administrator@win2016.test%Secret123 rpcclient $>
PR: https://github.com/freeipa/freeipa/pull/5473
@frenaud I didn't add a test commit to run test_trust because we still use F32 for gating where test_trust passes. Please review.
test_trust
master:
ipa-4-9:
Metadata Update from @rcritten: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)