components/krb5/patches/071-t_kdb-slapd.patch
author Neng Xue <neng.xue@oracle.com>
Mon, 26 Sep 2016 15:58:55 -0700
changeset 6978 14cbeb78966a
parent 6599 1d033832c5e7
permissions -rw-r--r--
24669827 Update Userland krb5 to MIT 1.14.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6311
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     1
#
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     2
# Patch to allow the t_kdb.py test to test a KDC using a LDAP backend provided
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     3
# by the Solaris OpenLDAP slapd for the KDB.  MIT have been notified and they
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     4
# say they will update t_kdb.py to work on S12 by the 1.15 release.
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     5
#
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     6
# Patch source: in-house
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     7
#
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     8
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 6311
diff changeset
     9
--- a/src/tests/t_kdb.py
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 6311
diff changeset
    10
+++ b/src/tests/t_kdb.py
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 6311
diff changeset
    11
@@ -14,7 +14,10 @@ if (not os.path.exists(os.path.join(plugins, 'kdb', 'kldap.so')) and
6311
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    12
 
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    13
 system_slapd = which('slapd')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    14
 if not system_slapd:
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    15
-    skip_rest('LDAP KDB tests', 'slapd not found')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    16
+    if os.path.isfile('/usr/lib/slapd'):
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    17
+        system_slapd = '/usr/lib/slapd'
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    18
+    else:
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    19
+        skip_rest('LDAP KDB tests', 'slapd not found')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    20
 
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    21
 ldapdir = os.path.abspath('ldap')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    22
 slapd = os.path.join(ldapdir, 'slapd')
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 6311
diff changeset
    23
@@ -44,6 +47,8 @@ shutil.copy(system_slapd, slapd)
6311
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    24
 core_schema = None
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    25
 if os.path.isfile('/etc/ldap/schema/core.schema'):
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    26
     core_schema = '/etc/ldap/schema/core.schema'
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    27
+elif os.path.isfile('/etc/openldap/schema/core.schema'):
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    28
+    core_schema = '/etc/openldap/schema/core.schema'
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    29
 
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    30
 # Make a slapd config file.  This is deprecated in OpenLDAP 2.3 and
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    31
 # later, but it's easier than using LDIF and slapadd.  Include some
6599
1d033832c5e7 24377741 Update Userland krb5 to MIT 1.14.3
Shawn Emery <shawn.emery@oracle.com>
parents: 6311
diff changeset
    32
@@ -54,8 +59,7 @@ file.write('pidfile %s\n' % slapd_pidfile)
6311
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    33
 file.write('include %s\n' % schema)
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    34
 if core_schema:
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    35
     file.write('include %s\n' % core_schema)
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    36
-file.write('moduleload back_bdb\n')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    37
-file.write('database bdb\n')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    38
+file.write('database mdb\n')
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    39
 file.write('suffix %s\n' % top_dn)
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    40
 file.write('rootdn %s\n' % admin_dn)
b926fcac67df 23726723 t_kdb.py can't find slapd so tests aren't run
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    41
 file.write('rootpw %s\n' % admin_pw)