~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to tests/scripts/test049-sync-config

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Steve Langasek, Mathias Gug
  • Date: 2009-02-18 18:44:00 UTC
  • mfrom: (1.1.2 upstream) (0.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20090218184400-zw4mjse9eywt5566
Tags: 2.4.14-0ubuntu1
[ Steve Langasek ]
* New upstream version
  - Fixes a bug with the pcache overlay not returning cached entries
    (closes: #497697)
  - Update evolution-ntlm patch to apply to current Makefiles.
  - (tentatively) drop gnutls-ciphers, since this bug was reported to be
    fixed upstream in 2.4.8.  The fix applied in 2.4.8 didn't match the
    patch from the bug report, so this should be watched for regressions.
* Build against db4.7 instead of db4.2 at last!  Closes: #421946.
* Build with --disable-ndb, to avoid a misbuild when libmysqlclient is
  installed in the build environment.
* New patch, no-crlcheck-for-gnutls, to fix a build failure when using
  --with-tls=gnutls.

[ Mathias Gug ]
* Merge from debian unstable, remaining changes:
  - debian/apparmor-profile: add AppArmor profile
  - debian/slapd.postinst: Reload AA profile on configuration
  - updated debian/slapd.README.Debian for note on AppArmor
  - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6
  - debian/control: Conflicts with apparmor-profiles << 2.1+1075-0ubuntu4
    to make sure that if earlier version of apparmour-profiles gets
    installed it won't overwrite our profile.
  - Modify Maintainer value to match the DebianMaintainerField
    speficication.
  - follow ApparmorProfileMigration and force apparmor compalin mode on 
    some upgrades (LP: #203529)
  - debian/slapd.dirs: add etc/apparmor.d/force-complain
  - debian/slapd.preinst: create symlink for force-complain on pre-feisty
    upgrades, upgrades where apparmor-profiles profile is unchanged (ie
    non-enforcing) and upgrades where apparmor profile does not exist.
  - debian/slapd.postrm: remove symlink in force-complain/ on purge
  - debian/patches/fix-ucred-libc due to changes how newer glibc handle
    the ucred struct now.
  - debian/control:
    - Build-depend on libltdl7-dev rather then libltdl3-dev.
  - debian/patches/autogen.sh:
    - Call libtoolize with the --install option to install config.{guess,sub}
      files.
  - Don't use local statement in config script as it fails if /bin/sh
    points to bash (LP: #286063).
  - Disable the testsuite on hppa. Allows building of packages on this
    architecture again, once this package is in the archive.
    LP: #288908.
  - debian/slapd.postinst, debian/slapd.script-common: set correct ownership
    and permissions on /var/lib/ldap, /etc/ldap/slapd.d (group readable) and
    /var/run/slapd (world readable). (LP: #257667).
  - debian/patches/nssov-build, debian/rules: 
    Build and package the nss overlay.
    debian/schema/misc.ldif: add ldif file for the misc schema, which defines
    rfc822MailMember (required by the nss overlay).
  - debian/{control,rules}: enable PIE hardening
  - Use cn=config as the default configuration backend instead of 
    slapd.conf. Migrate slapd.conf  file to /etc/ldap/slapd.d/ on upgrade
    asking the end user to enter a new password to control the access to the
    cn=config tree.
* debian/patches/corrupt-contextCSN: The contextCSN can get corrupted at
  times. (ITS: #5947)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
 
# $OpenLDAP: pkg/ldap/tests/scripts/test049-sync-config,v 1.4.2.4 2008/02/11 23:26:51 kurt Exp $
 
2
# $OpenLDAP: pkg/ldap/tests/scripts/test049-sync-config,v 1.4.2.9 2009/02/10 12:29:01 hyc Exp $
3
3
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
##
5
 
## Copyright 1998-2008 The OpenLDAP Foundation.
 
5
## Copyright 1998-2009 The OpenLDAP Foundation.
6
6
## All rights reserved.
7
7
##
8
8
## Redistribution and use in source and binary forms, with or without
22
22
fi 
23
23
 
24
24
PRODIR=$TESTDIR/pro
25
 
CONDIR=$TESTDIR/con
 
25
CONDIR=$TESTDIR/con1
26
26
DBPRO=$PRODIR/db
27
27
DBCON=$CONDIR/db
28
28
CFPRO=$PRODIR/slapd.d
32
32
 
33
33
$SLAPPASSWD -g -n >$CONFIGPWF
34
34
 
 
35
if test x"$SYNCMODE" = x ; then
 
36
        SYNCMODE=rp
 
37
fi
 
38
case "$SYNCMODE" in
 
39
        ro)
 
40
                SYNCTYPE="type=refreshOnly interval=00:00:00:10"
 
41
                ;;
 
42
        rp)
 
43
                SYNCTYPE="type=refreshAndPersist"
 
44
                ;;
 
45
        *)
 
46
                echo "unknown sync mode $SYNCMODE"
 
47
                exit 1;
 
48
                ;;
 
49
esac
 
50
 
35
51
#
36
52
# Test replication of dynamic config:
37
53
# - start producer
97
113
changetype: modify
98
114
add: olcSyncRepl
99
115
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
100
 
  credentials=$CONFIGPW searchbase="cn=config" type=refreshOnly
101
 
  interval=00:00:00:10
 
116
  credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
 
117
  retry="5 5 300 5" timeout=3
102
118
-
103
119
add: olcUpdateRef
104
120
olcUpdateRef: $URI1
154
170
changetype: modify
155
171
add: olcSyncRepl
156
172
olcSyncRepl: rid=001 provider=$URI1 binddn="cn=config" bindmethod=simple
157
 
  credentials=$CONFIGPW searchbase="cn=config" type=refreshOnly
158
 
  interval=00:00:00:10
 
173
  credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
 
174
  retry="5 5 300 5" timeout=3
159
175
-
160
176
add: olcUpdateRef
161
177
olcUpdateRef: $URI1
230
246
olcRootDN: $MANAGERDN
231
247
olcRootPW: $PASSWD
232
248
olcSyncRepl: rid=002 provider=$URI1 binddn="$MANAGERDN" bindmethod=simple
233
 
  credentials=$PASSWD searchbase="$BASEDN" type=refreshOnly
234
 
  interval=00:00:00:10
 
249
  credentials=$PASSWD searchbase="$BASEDN" $SYNCTYPE
 
250
  retry="5 5 300 5" timeout=3
235
251
olcUpdateRef: $URI1
236
252
 
237
253
dn: olcOverlay=syncprov,olcDatabase={1}${BACKEND},cn=config
247
263
        exit $RC
248
264
fi
249
265
 
 
266
case $BACKEND in
 
267
bdb | hdb)
 
268
        $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >>$TESTOUT 2>&1
 
269
dn: olcDatabase={1}$BACKEND,cn=config
 
270
changetype: modify
 
271
add: olcDbIndex
 
272
olcDbIndex: objectClass,entryUUID,entryCSN eq
 
273
olcDbIndex: cn,uid pres,eq,sub
 
274
EOF
 
275
        RC=$?
 
276
        if test $RC != 0 ; then
 
277
                echo "ldapadd modify for database config ($RC)!"
 
278
                test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
279
                exit $RC
 
280
        fi
 
281
        ;;
 
282
esac
 
283
 
250
284
echo "Using ldapadd to populate producer..."
251
285
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $LDIFORDERED \
252
286
        >> $TESTOUT 2>&1
281
315
        exit $RC
282
316
fi
283
317
 
 
318
echo "Replacing olcSyncrepl on producer..."
 
319
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
 
320
dn: olcDatabase={0}config,cn=config
 
321
changetype: modify
 
322
replace: olcSyncRepl
 
323
olcSyncRepl: rid=002 provider=$URI1 binddn="cn=config" bindmethod=simple
 
324
  credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
 
325
  retry="3 5 300 5" timeout=3
 
326
EOF
 
327
echo "Waiting 10 seconds for syncrepl to receive changes..."
 
328
sleep 10
 
329
 
284
330
echo "Using ldapsearch to read config from the producer..."
285
331
$LDAPSEARCH -b cn=config -D cn=config -H $URI1 -y $CONFIGPWF  \
286
332
        'objectclass=*' > $MASTEROUT 2>&1