sssd/0007-TESTS-Add-a-basic-test-of-sssctl-domain-list.patch
Fabiano Fidêncio 2a59fc635f Resolves: upstream#3658 - Application domain is not interpreted correctly
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 563dd33f72)
(cherry picked from commit 4d2103b723)
2018-03-30 15:24:57 +02:00

74 lines
2.3 KiB
Diff

From 15ab42ad5349485c9156234f5a6d1c6635c36de3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Thu, 15 Mar 2018 16:28:41 +0100
Subject: [PATCH 07/15] TESTS: Add a basic test of `sssctl domain-list`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Let's just add a test for `sssctl domain-list` in order to avoid
regressing https://pagure.io/SSSD/sssd/issue/3658.
The test has been added as part of test_infopipe.py in order to take
advantage of the machinery already provided there.
Resolves:
https://pagure.io/SSSD/sssd/issue/3658
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
---
src/tests/intg/test_infopipe.py | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/tests/intg/test_infopipe.py b/src/tests/intg/test_infopipe.py
index 3a7961403..b851bbd91 100644
--- a/src/tests/intg/test_infopipe.py
+++ b/src/tests/intg/test_infopipe.py
@@ -34,7 +34,7 @@ import dbus
import config
import ds_openldap
import ldap_ent
-from util import unindent
+from util import unindent, get_call_output
LDAP_BASE_DN = "dc=example,dc=com"
INTERACTIVE_TIMEOUT = 4
@@ -194,7 +194,7 @@ def format_basic_conf(ldap_conn, schema):
return unindent("""\
[sssd]
debug_level = 0xffff
- domains = LDAP
+ domains = LDAP, app
services = nss, ifp
enable_files_domain = false
@@ -212,6 +212,9 @@ def format_basic_conf(ldap_conn, schema):
id_provider = ldap
ldap_uri = {ldap_conn.ds_inst.ldap_url}
ldap_search_base = {ldap_conn.ds_inst.base_dn}
+
+ [application/app]
+ inherit_from = LDAP
""").format(**locals())
@@ -532,3 +535,13 @@ def test_get_user_groups(dbus_system_bus, ldap_conn, sanity_rfc2307):
assert len(res) == 2
assert sorted(res) == ['single_user_group', 'two_user_group']
+
+
+def test_sssctl_domain_list_app_domain(dbus_system_bus,
+ ldap_conn,
+ sanity_rfc2307):
+ output = get_call_output(["sssctl", "domain-list"], subprocess.STDOUT)
+
+ assert "Error" not in output
+ assert output.find("LDAP") != -1
+ assert output.find("app") != -1
--
2.14.3