#7313 trust integration tests need to override test_establish_trust method when using different trust-add options
Closed: fixed Opened by abbra.

Integration test for AD trust with POSIX attributes has two scenarios: one is using autodetection mechanism to create ID range with 'ipa-ad-trust-posix' range type, and another one is using explicit --range-type=ipa-ad-trust-posix option to do the same.

When run as separate test scenarios that is perfectly fine. However, the second test is defined like this:

# in ipatests/test_integration/test_trust.py
class TestEnforcedPosixADTrust(TestPosixADTrust):
    """
    This test is intented to copycat PosixADTrust, since enforcing the POSIX
    trust type should not make a difference.
    """
    def test_establish_trust_with_posix_attributes(self):
        tasks.establish_trust_with_ad(self.master, self.ad_domain,
            extra_args=['--range-type', 'ipa-ad-trust-posix'])

where TestPosixADTrust class defines test_establish_trust test method. As result, pytest runs both test_establish_trust and test_establish_trust_with_posix_attributes within the same test scenario. This leads to creation of ID range for the trust with whatever range type is autodetected. Next run of ipa trust-add --range-type ipa-ad-trust-posix will reuse already existing ID range as we never remove ID range that exists.

As result the second test scenario would fail for Windows Server 2016 where there is no support for MFU/NIS anymore and autodetection wouldn't work, thus resulting in ipa-ad-trust range type.

A simple fix is to rename test_establish_trust_with_posix_attributes method to test_establish_trust.


Metadata Update from @pvoborni:
- Issue priority set to: critical
- Issue set to the milestone: FreeIPA 4.6.3
- Issue tagged with: test-failure, tests

Metadata Update from @rcritten:
- Issue set to the milestone: FreeIPA 4.6.4 (was: FreeIPA 4.6.3)

FreeIPA 4.6.3 has been released, moving to FreeIPA 4.6.4 milestone

https://github.com/freeipa/freeipa/pull/1604

master:

  • 9797309ef92f5a4fc831ab9c2349b7c95cb47c95 Overide trust methods for integration tests

ipa-4-6:

  • 67a32314fc0b65d708ae5d94f9078d1f1d559bab Overide trust methods for integration tests

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

Metadata