URL: https://github.com/freeipa/freeipa/pull/4255
Author: amore17
 Title: #4255: [Backport][ipa-4-6] ipatests: Test for ipa-extdom-extop plugin 
should allow @ in group name.
Action: opened

PR body:
"""
This is manual back-port of : #4191
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/4255/head:pr4255
git checkout pr4255
From d79ab8749dd679035cfa430066e7f09d83bb47f4 Mon Sep 17 00:00:00 2001
From: Anuja More <am...@redhat.com>
Date: Mon, 3 Feb 2020 12:56:59 +0530
Subject: [PATCH 1/2] ipatests: Add test for ipa-extdom-extop plugin should
 allow @ in group name

If group contains @ in group name on AD,
then it should fetch successfully on ipa-client.

Related to: https://bugzilla.redhat.com/1746951

Signed-off-by: Anuja More <am...@redhat.com>
---
 ipatests/test_integration/test_sssd.py | 32 ++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/ipatests/test_integration/test_sssd.py b/ipatests/test_integration/test_sssd.py
index 00ab2be395..91c0d0329b 100644
--- a/ipatests/test_integration/test_sssd.py
+++ b/ipatests/test_integration/test_sssd.py
@@ -20,6 +20,7 @@ class TestSSSDWithAdTrust(IntegrationTest):
 
     topology = 'star'
     num_ad_domains = 1
+    num_clients = 1
 
     users = {
         'ad': {
@@ -81,3 +82,34 @@ def test_is_user_filtered(self, user):
             dp_req = ("Looking up [{0}] in data provider".format(
                 self.users[user]['name']))
             assert not dp_req.encode() in sssd_log
+
+    def test_extdom_group(self):
+        """ipa-extdom-extop plugin should allow @ in group name.
+
+        Test for : https://bugzilla.redhat.com/show_bug.cgi?id=1746951
+
+        If group contains @ in group name from AD, eg. abc@pqr@AD.DOMAIN
+        then it should fetch successfully on ipa-client.
+        """
+        client = self.clients[0]
+        hosts = [self.master, client]
+        ad_group = 'group@group@{0}'.format(self.ad.domain.name)
+        expression = '((?P<name>.+)@(?P<domain>[^@]+$))'
+        master_conf_backup = tasks.FileBackup(self.master, paths.SSSD_CONF)
+        client_conf_backup = tasks.FileBackup(client, paths.SSSD_CONF)
+        for host in hosts:
+            with tasks.remote_ini_file(host, paths.SSSD_CONF) as sssd_conf:
+                sssd_conf.set('sssd', 're_expression', expression)
+                sssd_conf.set('sssd', 'use_fully_qualified_names', True)
+            tasks.clear_sssd_cache(host)
+        try:
+            cmd = ['getent', 'group', ad_group]
+            result = self.master.run_command(cmd)
+            assert ad_group in result.stdout_text
+            result2 = client.run_command(cmd)
+            assert ad_group in result2.stdout_text
+        finally:
+            master_conf_backup.restore()
+            client_conf_backup.restore()
+            tasks.clear_sssd_cache(self.master)
+            tasks.clear_sssd_cache(client)

From f920b9f1dd4b3388ddacfe89929039652e8ed2df Mon Sep 17 00:00:00 2001
From: Anuja More <am...@redhat.com>
Date: Tue, 18 Feb 2020 12:08:05 +0530
Subject: [PATCH 2/2] Add sssd.py in nightly ipa-4-6.yaml

Signed-off-by: Anuja More <am...@redhat.com>
---
 ipatests/prci_definitions/nightly_ipa-4-6.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ipatests/prci_definitions/nightly_ipa-4-6.yaml b/ipatests/prci_definitions/nightly_ipa-4-6.yaml
index 579b254d21..834e24d11b 100644
--- a/ipatests/prci_definitions/nightly_ipa-4-6.yaml
+++ b/ipatests/prci_definitions/nightly_ipa-4-6.yaml
@@ -1090,3 +1090,15 @@ jobs:
         template: *ci-master-f27
         timeout: 4800
         topology: *ad_master
+
+  fedora-27/test_sssd:
+    requires: [fedora-27/build]
+    priority: 50
+    job:
+      class: RunADTests
+      args:
+        build_url: '{fedora-27/build_url}'
+        test_suite: test_integration/test_sssd.py
+        template: *ci-master-f27
+        timeout: 4800
+        topology: *ad_master_2client
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org

Reply via email to