#8421 Multiple similar failures in test_smb.py (test_smb_access_for_ipa_user_at_ipa_client, test_smb_mount_and_access_by_different_users, test_samba_reinstall...)
Closed: fixed by frenaud. Opened by fcami.

testing_master_latest Nightly PR #295 failed in test_smb:

any access to /mnt/smb/$user failed like:

subprocess.CalledProcessError: Command '['su', '-l', 'user2', '-c', 'cd /mnt/smb; mkdir testdir_user2']' returned non-zero exit status 1.

also in testing_master_latest Nightly PR #303, report contains:

[21484] 1595295446.863864: Getting initial credentials for testuser\@ad.test@IPA.TEST
[21484] 1595295446.863866: Sending unauthenticated request
[21484] 1595295446.863867: Sending request (182 bytes) to IPA.TEST
[21484] 1595295446.863868: Initiating TCP connection to stream 192.168.122.6:88
[21484] 1595295446.863869: Sending TCP request to stream 192.168.122.6:88
[21484] 1595295446.863870: Received answer (136 bytes) from stream 192.168.122.6:88
[21484] 1595295446.863871: Terminating TCP connection to stream 192.168.122.6:88
[21484] 1595295446.863872: Response was from master KDC
[21484] 1595295446.863873: Received error from KDC: -1765328316/Realm not local to KDC
[21484] 1595295446.863874: Following referral to realm AD.TEST
[21484] 1595295446.863876: Sending unauthenticated request
[21484] 1595295446.863877: Sending request (180 bytes) to AD.TEST
[21484] 1595295446.863878: Sending DNS URI query for _kerberos.AD.TEST.
[21484] 1595295446.863879: No URI records found
[21484] 1595295446.863880: Sending DNS SRV query for _kerberos._udp.AD.TEST.
[21484] 1595295446.863881: Sending DNS SRV query for _kerberos._tcp.AD.TEST.
[21484] 1595295446.863882: No SRV records found
gss_acquire_cred_impersonate_name(): Unspecified GSS failure.  Minor code may provide more information
Cannot find KDC for requested realm

This looks like a configuration error in the test's Active Directory setup. According to MS-ADTS 6.3.2.3, SRV records for _kerberos.{_udp,_tcp}.X (where X is a realm name, e.g. AD.TEST) are registered by non-RODC. If they weren't registered, it means a misconfiguration.

MS-ADTS 6.3.2.3: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/c1987d42-1847-4cc9-acf7-aab2136d6952

The issue was reported in samba project as 14464, closed as a duplicate of 14427 which got fixed in samba 4.12.6 (see the release notes). Since Fedora 32 now ships samba 4.12.6 in the stable repo, we can close this issue.

The last run with [testing_master_latest] in PR #358 shows the issue has been solved (report).

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

Metadata