URL: https://github.com/SSSD/sssd/pull/113
Author: jhrozek
 Title: #113: Adds an integration test for sssctl netgroup-show so that we 
don't regress again like we did in ticket #3267.
Action: opened

PR body:
"""
None
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/113/head:pr113
git checkout pr113
From 4b2c0ff9c291f41b9009e5e888a51146f1f6384a Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Wed, 21 Dec 2016 11:17:42 +0100
Subject: [PATCH] TESTS: Add an integration test for sssctl netgroup-show

---
 src/tests/intg/test_sssctl.py | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/tests/intg/test_sssctl.py b/src/tests/intg/test_sssctl.py
index 1c3b9c8..60e2e68 100644
--- a/src/tests/intg/test_sssctl.py
+++ b/src/tests/intg/test_sssctl.py
@@ -29,6 +29,7 @@
 import ldap_ent
 import config
 from util import unindent
+import sssd_netgroup
 
 LDAP_BASE_DN = "dc=example,dc=com"
 
@@ -142,6 +143,7 @@ def sanity_rfc2307(request, ldap_conn):
         sudo_provider       = ldap
         ldap_uri            = {ldap_conn.ds_inst.ldap_url}
         ldap_search_base    = {ldap_conn.ds_inst.base_dn}
+        ldap_netgroup_search_base = ou=Netgroups,{ldap_conn.ds_inst.base_dn}
     """).format(**locals())
     create_conf_fixture(request, conf)
     create_sssd_fixture(request)
@@ -359,3 +361,28 @@ def test_group_show_basic_fqname_insensitive(ldap_conn,
     output = get_call_output(["sssctl", "group-show", "camelcasegroup1@LDAP"])
     assert output.find("Name: camelcasegroup1@LDAP") != -1
     assert output.find("Cached in InfoPipe: No") != -1
+
+
+@pytest.fixture
+def add_tripled_netgroup(request, ldap_conn):
+    ent_list = ldap_ent.List(ldap_conn.ds_inst.base_dn)
+
+    ent_list.add_netgroup("tripled_netgroup", ["(host,user,domain)"])
+
+    ent_list.add_netgroup("adv_tripled_netgroup", ["(host1,user1,domain1)",
+                                                   "(host2,user2,domain2)"])
+
+    create_ldap_fixture(request, ldap_conn, ent_list)
+    return None
+
+
+def test_netgroup_show(ldap_conn,
+                       sanity_rfc2307,
+                       portable_LC_ALL,
+                       add_tripled_netgroup):
+    res, _, netgrps = sssd_netgroup.get_sssd_netgroups("tripled_netgroup")
+    assert res == sssd_netgroup.NssReturnCode.SUCCESS
+    assert netgrps == [("host", "user", "domain")]
+
+    output = get_call_output(["sssctl", "netgroup-show", "tripled_netgroup"])
+    assert output.find("Name: tripled_netgroup") != -1
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to