Blame SOURCES/0003-ipatests-skip-tests-for-AD-trust-with-shared-secret-_rhbz#1932289.patch

5c8636
From 6d7b2d7d1b4711255ea72d62d27b5c5f4ec7c6e1 Mon Sep 17 00:00:00 2001
5c8636
From: Sergey Orlov <sorlov@redhat.com>
5c8636
Date: Tue, 16 Feb 2021 12:32:55 +0100
5c8636
Subject: [PATCH] ipatests: skip tests for AD trust with shared secret in FIPS
5c8636
 mode
5c8636
5c8636
Related to https://pagure.io/freeipa/issue/8715
5c8636
5c8636
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
5c8636
---
5c8636
 ipatests/test_integration/test_trust.py | 22 ++++++++++++++++++++++
5c8636
 1 file changed, 22 insertions(+)
5c8636
5c8636
diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py
5c8636
index 3e522617d..c8a348212 100644
5c8636
--- a/ipatests/test_integration/test_trust.py
5c8636
+++ b/ipatests/test_integration/test_trust.py
5c8636
@@ -5,6 +5,7 @@ from __future__ import absolute_import
5c8636
 import re
5c8636
 import textwrap
5c8636
 import time
5c8636
+import functools
5c8636
 
5c8636
 import pytest
5c8636
 
5c8636
@@ -13,6 +14,7 @@ from ipaplatform.paths import paths
5c8636
 
5c8636
 from ipatests.test_integration.base import IntegrationTest
5c8636
 from ipatests.pytest_ipa.integration import tasks
5c8636
+from ipatests.pytest_ipa.integration import fips
5c8636
 from ipapython.dn import DN
5c8636
 from collections import namedtuple
5c8636
 from contextlib import contextmanager
5c8636
@@ -20,6 +22,18 @@ from contextlib import contextmanager
5c8636
 TestDataRule = namedtuple('TestDataRule',
5c8636
                           ['name', 'ruletype', 'user', 'subject'])
5c8636
 
5c8636
+
5c8636
+def skip_in_fips_mode_due_to_issue_8715(test_method):
5c8636
+    @functools.wraps(test_method)
5c8636
+    def wrapper(instance):
5c8636
+        if fips.is_fips_enabled(instance.master):
5c8636
+            pytest.skip('Skipping in FIPS mode due to '
5c8636
+                        'https://pagure.io/freeipa/issue/8715')
5c8636
+        else:
5c8636
+            test_method(instance)
5c8636
+    return wrapper
5c8636
+
5c8636
+
5c8636
 class BaseTestTrust(IntegrationTest):
5c8636
     num_clients = 1
5c8636
     topology = 'line'
5c8636
@@ -751,6 +765,7 @@ class TestTrust(BaseTestTrust):
5c8636
 
5c8636
     # Test for one-way forest trust with shared secret
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_establish_forest_trust_with_shared_secret(self):
5c8636
         tasks.configure_dns_for_trust(self.master, self.ad)
5c8636
         tasks.configure_windows_dns_for_trust(self.ad, self.master)
5c8636
@@ -775,6 +790,7 @@ class TestTrust(BaseTestTrust):
5c8636
         tasks.establish_trust_with_ad(
5c8636
             self.master, self.ad_domain, shared_secret=self.shared_secret)
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_trustdomains_found_in_forest_trust_with_shared_secret(self):
5c8636
         result = self.master.run_command(
5c8636
             ['ipa', 'trust-fetch-domains', self.ad.domain.name],
5c8636
@@ -783,6 +799,7 @@ class TestTrust(BaseTestTrust):
5c8636
         self.check_trustdomains(
5c8636
             self.ad_domain, [self.ad_domain, self.ad_subdomain])
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_user_gid_uid_resolution_in_forest_trust_with_shared_secret(self):
5c8636
         """Check that user has SID-generated UID"""
5c8636
         # Using domain name since it is lowercased realm name for AD domains
5c8636
@@ -801,6 +818,7 @@ class TestTrust(BaseTestTrust):
5c8636
         assert re.search(
5c8636
             testuser_regex, result.stdout_text), result.stdout_text
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_remove_forest_trust_with_shared_secret(self):
5c8636
         ps_cmd = (
5c8636
             '[System.DirectoryServices.ActiveDirectory.Forest]'
5c8636
@@ -823,6 +841,7 @@ class TestTrust(BaseTestTrust):
5c8636
 
5c8636
     # Test for one-way external trust with shared secret
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_establish_external_trust_with_shared_secret(self):
5c8636
         tasks.configure_dns_for_trust(self.master, self.ad)
5c8636
         tasks.configure_windows_dns_for_trust(self.ad, self.master)
5c8636
@@ -838,6 +857,7 @@ class TestTrust(BaseTestTrust):
5c8636
             self.master, self.ad_domain, shared_secret=self.shared_secret,
5c8636
             extra_args=['--range-type', 'ipa-ad-trust', '--external=True'])
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_trustdomains_found_in_external_trust_with_shared_secret(self):
5c8636
         result = self.master.run_command(
5c8636
             ['ipa', 'trust-fetch-domains', self.ad.domain.name],
5c8636
@@ -846,6 +866,7 @@ class TestTrust(BaseTestTrust):
5c8636
         self.check_trustdomains(
5c8636
             self.ad_domain, [self.ad_domain])
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_user_uid_resolution_in_external_trust_with_shared_secret(self):
5c8636
         """Check that user has SID-generated UID"""
5c8636
         # Using domain name since it is lowercased realm name for AD domains
5c8636
@@ -864,6 +885,7 @@ class TestTrust(BaseTestTrust):
5c8636
         assert re.search(
5c8636
             testuser_regex, result.stdout_text), result.stdout_text
5c8636
 
5c8636
+    @skip_in_fips_mode_due_to_issue_8715
5c8636
     def test_remove_external_trust_with_shared_secret(self):
5c8636
         self.ad.run_command(
5c8636
             ['netdom.exe', 'trust', self.master.domain.name,
5c8636
-- 
5c8636
2.29.2
5c8636