URL: https://github.com/freeipa/freeipa/pull/4243 Author: amore17 Title: #4243: [Backport][ipa-4-8] 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/4243/head:pr4243 git checkout pr4243
From 6a5a52c73f0bd5e99da7c1fd3092aef99e812ed5 Mon Sep 17 00:00:00 2001 From: Anuja More <am...@redhat.com> Date: Tue, 11 Feb 2020 13:34:57 +0530 Subject: [PATCH 1/2] Update topology for test_integration/test_sssd.py Added changes in topology for test_sssd.py As in test it needs client also. Signed-off-by: Anuja More <am...@redhat.com> --- ipatests/prci_definitions/nightly_ipa-4-8.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipatests/prci_definitions/nightly_ipa-4-8.yaml b/ipatests/prci_definitions/nightly_ipa-4-8.yaml index 29e9f76739..e190bdaade 100644 --- a/ipatests/prci_definitions/nightly_ipa-4-8.yaml +++ b/ipatests/prci_definitions/nightly_ipa-4-8.yaml @@ -1411,7 +1411,7 @@ jobs: test_suite: test_integration/test_sssd.py template: *ci-master-f30 timeout: 4800 - topology: *ad_master + topology: *ad_master_2client fedora-30/test_ca_custom_sdn: requires: [fedora-30/build] From 490a0409b1c2aca1b8ac14868e888d11a086a748 Mon Sep 17 00:00:00 2001 From: Anuja More <am...@redhat.com> Date: Mon, 3 Feb 2020 12:56:59 +0530 Subject: [PATCH 2/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 57d5de64f3..886c5f20e7 100644 --- a/ipatests/test_integration/test_sssd.py +++ b/ipatests/test_integration/test_sssd.py @@ -21,6 +21,7 @@ class TestSSSDWithAdTrust(IntegrationTest): topology = 'star' num_ad_domains = 1 + num_clients = 1 users = { 'ipa': { @@ -148,3 +149,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)
_______________________________________________ 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