|
|
ca1eb8 |
From 75710952e74ea6070a53baaf5ea4e80507cdc26c Mon Sep 17 00:00:00 2001
|
|
|
ca1eb8 |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
ca1eb8 |
Date: Thu, 21 Jun 2018 12:37:42 +0200
|
|
|
ca1eb8 |
Subject: [PATCH] TESTS: Allow storing e-mail address for users
|
|
|
ca1eb8 |
MIME-Version: 1.0
|
|
|
ca1eb8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
ca1eb8 |
Content-Transfer-Encoding: 8bit
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
This would allow adding tests for by-e-mail lookups later
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
Related:
|
|
|
ca1eb8 |
https://pagure.io/SSSD/sssd/issue/3607
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
|
|
|
ca1eb8 |
(cherry picked from commit d057eb2e20a19ce975dc2202f7c0e9f204eb9510)
|
|
|
ca1eb8 |
---
|
|
|
ca1eb8 |
src/tests/intg/ldap_ent.py | 11 ++++++++---
|
|
|
ca1eb8 |
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
diff --git a/src/tests/intg/ldap_ent.py b/src/tests/intg/ldap_ent.py
|
|
|
ca1eb8 |
index a4c987969d3dcefba2af69e095b220180e0fa54c..1f23e3ab7a7ee62909babb8338379a5f2d4e37f2 100644
|
|
|
ca1eb8 |
--- a/src/tests/intg/ldap_ent.py
|
|
|
ca1eb8 |
+++ b/src/tests/intg/ldap_ent.py
|
|
|
ca1eb8 |
@@ -25,7 +25,8 @@ def user(base_dn, uid, uidNumber, gidNumber,
|
|
|
ca1eb8 |
loginShell=None,
|
|
|
ca1eb8 |
cn=None,
|
|
|
ca1eb8 |
sn=None,
|
|
|
ca1eb8 |
- sshPubKey=()):
|
|
|
ca1eb8 |
+ sshPubKey=(),
|
|
|
ca1eb8 |
+ mail=None):
|
|
|
ca1eb8 |
"""
|
|
|
ca1eb8 |
Generate an RFC2307(bis) user add-modlist for passing to ldap.add*
|
|
|
ca1eb8 |
"""
|
|
|
ca1eb8 |
@@ -56,6 +57,8 @@ def user(base_dn, uid, uidNumber, gidNumber,
|
|
|
ca1eb8 |
if len(sshPubKey) > 0:
|
|
|
ca1eb8 |
pubkeys = [key.encode('utf-8') for key in sshPubKey]
|
|
|
ca1eb8 |
user[1].append(('sshPublicKey', pubkeys))
|
|
|
ca1eb8 |
+ if mail is not None:
|
|
|
ca1eb8 |
+ user[1].append(('mail', [mail.encode('utf-8')]))
|
|
|
ca1eb8 |
return user
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
@@ -124,7 +127,8 @@ class List(list):
|
|
|
ca1eb8 |
loginShell=None,
|
|
|
ca1eb8 |
cn=None,
|
|
|
ca1eb8 |
sn=None,
|
|
|
ca1eb8 |
- sshPubKey=()):
|
|
|
ca1eb8 |
+ sshPubKey=(),
|
|
|
ca1eb8 |
+ mail=None):
|
|
|
ca1eb8 |
"""Add an RFC2307(bis) user add-modlist."""
|
|
|
ca1eb8 |
self.append(user(base_dn or self.base_dn,
|
|
|
ca1eb8 |
uid, uidNumber, gidNumber,
|
|
|
ca1eb8 |
@@ -134,7 +138,8 @@ class List(list):
|
|
|
ca1eb8 |
loginShell=loginShell,
|
|
|
ca1eb8 |
cn=cn,
|
|
|
ca1eb8 |
sn=sn,
|
|
|
ca1eb8 |
- sshPubKey=sshPubKey))
|
|
|
ca1eb8 |
+ sshPubKey=sshPubKey,
|
|
|
ca1eb8 |
+ mail=mail))
|
|
|
ca1eb8 |
|
|
|
ca1eb8 |
def add_group(self, cn, gidNumber, member_uids=[],
|
|
|
ca1eb8 |
base_dn=None):
|
|
|
ca1eb8 |
--
|
|
|
ca1eb8 |
2.17.1
|
|
|
ca1eb8 |
|