From 1b6578786cf3978226dcfc8d14afc685c42fdc36 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 16 Aug 2016 11:42:08 +0200 Subject: [PATCH 2/2] intg: Test extra attributes duplicate Regresion test for ticket #3120 Resolves: https://fedorahosted.org/sssd/ticket/3120 --- src/tests/intg/test_ldap.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/tests/intg/test_ldap.py b/src/tests/intg/test_ldap.py index c40ce09579755d8e952e990283e93284811f1020..3da2ff6dcb614bb4293a7c9102b7791d29f7bd30 100644 --- a/src/tests/intg/test_ldap.py +++ b/src/tests/intg/test_ldap.py @@ -734,3 +734,29 @@ def test_special_characters_in_names(ldap_conn, sanity_rfc2307): "group(_u)ser1", dict(name="group(_u)ser1", passwd="*", gid=5001, mem=ent.contains_only("t(u)ser"))) + + +@pytest.fixture +def extra_attributes(request, ldap_conn): + ent_list = ldap_ent.List(ldap_conn.ds_inst.base_dn) + ent_list = ldap_ent.List(ldap_conn.ds_inst.base_dn) + ent_list.add_user("user", 2001, 2000) + ent_list.add_group("group", 2000) + create_ldap_fixture(request, ldap_conn, ent_list) + conf = \ + format_basic_conf(ldap_conn, SCHEMA_RFC2307) + \ + unindent("""\ + [domain/LDAP] + ldap_user_extra_attrs = mail, name:uid + """).format(**locals()) + create_conf_fixture(request, conf) + create_sssd_fixture(request) + + +def test_extra_attribute_already_exists(ldap_conn, extra_attributes): + """Test the effect of the "vetoed_shells" option""" + + ent.assert_passwd_by_name( + 'user', + dict(name="user", uid=2001, gid=2000, shell="/bin/bash"), + ) -- 2.9.3