Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ticket 49248 - update eduPerson to 201602
Bug Description: Update the eduPerson schema (commonly used by high education institutes) to match the 201602 release found: http://software.internet2.edu/eduperson/internet2-mace-dir-eduperson-201602.html Fix Description: Update the schema, and add a test asserting the values work as expected. https://pagure.io/389-ds-base/issue/49248 Author: wibrown Review by: mreynolds (Thanks!)
- Loading branch information
Showing
2 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2017 Red Hat, Inc. | ||
# All rights reserved. | ||
# | ||
# License: GPL (version 3 or any later version). | ||
# See LICENSE for details. | ||
# --- END COPYRIGHT BLOCK --- | ||
# | ||
|
||
|
||
import os | ||
import logging | ||
import pytest | ||
import ldap | ||
|
||
from lib389.idm.user import UserAccounts | ||
from lib389.topologies import topology_st as topology | ||
from lib389._constants import DEFAULT_SUFFIX | ||
|
||
DEBUGGING = os.getenv('DEBUGGING', False) | ||
|
||
if DEBUGGING is not False: | ||
DEBUGGING = True | ||
|
||
if DEBUGGING: | ||
logging.getLogger(__name__).setLevel(logging.DEBUG) | ||
else: | ||
logging.getLogger(__name__).setLevel(logging.INFO) | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def test_account_locking(topology): | ||
""" | ||
Test the eduperson schema works | ||
""" | ||
if DEBUGGING: | ||
# Add debugging steps(if any)... | ||
pass | ||
|
||
users = UserAccounts(topology.standalone, DEFAULT_SUFFIX) | ||
|
||
user_properties = { | ||
'uid': 'testuser', | ||
'cn' : 'testuser', | ||
'sn' : 'user', | ||
'uidNumber' : '1000', | ||
'gidNumber' : '2000', | ||
'homeDirectory' : '/home/testuser', | ||
} | ||
testuser = users.create(properties=user_properties) | ||
|
||
# Extend the user with eduPerson | ||
testuser.add('objectClass', 'eduPerson') | ||
|
||
# now add eduPerson attrs | ||
testuser.add('eduPersonAffiliation', 'value') # From 2002 | ||
testuser.add('eduPersonNickName', 'value') # From 2002 | ||
testuser.add('eduPersonOrgDN', 'ou=People,%s' % DEFAULT_SUFFIX) # From 2002 | ||
testuser.add('eduPersonOrgUnitDN', 'ou=People,%s' % DEFAULT_SUFFIX) # From 2002 | ||
testuser.add('eduPersonPrimaryAffiliation', 'value') # From 2002 | ||
testuser.add('eduPersonPrincipalName', 'value') # From 2002 | ||
testuser.add('eduPersonEntitlement', 'value') # From 2002 | ||
testuser.add('eduPersonPrimaryOrgUnitDN', 'ou=People,%s' % DEFAULT_SUFFIX) # From 2002 | ||
testuser.add('eduPersonScopedAffiliation', 'value') # From 2003 | ||
testuser.add('eduPersonTargetedID', 'value') # From 2003 | ||
testuser.add('eduPersonAssurance', 'value') # From 2008 | ||
testuser.add('eduPersonPrincipalNamePrior', 'value') # From 2012 | ||
testuser.add('eduPersonUniqueId', 'value') # From 2013 | ||
testuser.add('eduPersonOrcid', 'value') # From 2016 | ||
|
||
log.info('Test PASSED') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters