Commit 14b485b TESTS: Add a basic test of `sssctl domain-list`

1 file Authored by fidencio 5 months ago , Committed by jhrozek 5 months ago ,
TESTS: Add a basic test of `sssctl domain-list`

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>

    
 1 @@ -34,7 +34,7 @@
 2   import config
 3   import ds_openldap
 4   import ldap_ent
 5 - from util import unindent
 6 + from util import unindent, get_call_output
 7   
 8   LDAP_BASE_DN = "dc=example,dc=com"
 9   INTERACTIVE_TIMEOUT = 4
10 @@ -194,7 +194,7 @@
11       return unindent("""\
12           [sssd]
13           debug_level         = 0xffff
14 -         domains             = LDAP
15 +         domains             = LDAP, app
16           services            = nss, ifp
17           enable_files_domain = false
18   
19 @@ -212,6 +212,9 @@
20           id_provider         = ldap
21           ldap_uri            = {ldap_conn.ds_inst.ldap_url}
22           ldap_search_base    = {ldap_conn.ds_inst.base_dn}
23 + 
24 +         [application/app]
25 +         inherit_from = LDAP
26       """).format(**locals())
27   
28   
29 @@ -532,3 +535,13 @@
30   
31       assert len(res) == 2
32       assert sorted(res) == ['single_user_group', 'two_user_group']
33 + 
34 + 
35 + def test_sssctl_domain_list_app_domain(dbus_system_bus,
36 +                                        ldap_conn,
37 +                                        sanity_rfc2307):
38 +     output = get_call_output(["sssctl", "domain-list"], subprocess.STDOUT)
39 + 
40 +     assert "Error" not in output
41 +     assert output.find("LDAP") != -1
42 +     assert output.find("app") != -1