def test_ipa_domain_ad(self, mock_sssd): mock_sssd.return_value = SSSDConfig(provider='ad') framework = object() registry.initialize(framework, config.Config) registry.trust_agent = True f = IPADomainCheck(registry) self.results = capture_results(f) assert len(self.results) == 4 for result in self.results.results: assert result.result == constants.ERROR assert result.source == 'ipahealthcheck.ipa.trust' assert result.check == 'IPADomainCheck' assert result.kw.get('provider') == 'ad'
def test_ipa_domain_ok(self, mock_sssd): mock_sssd.return_value = SSSDConfig(provider='ipa') framework = object() registry.initialize(framework, config.Config) # being a trust agent isn't mandatory, test without registry.trust_agent = False f = IPADomainCheck(registry) self.results = capture_results(f) print(self.results.results) assert len(self.results) == 1 result = self.results.results[0] assert result.result == constants.SUCCESS assert result.source == 'ipahealthcheck.ipa.trust' assert result.check == 'IPADomainCheck'