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

« back to all changes in this revision

Viewing changes to tests/scripts/test055-valregex

  • 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
#! /bin/sh
 
2
# $OpenLDAP: pkg/ldap/tests/scripts/test055-valregex,v 1.2.2.2 2009/01/22 00:01:20 kurt Exp $
 
3
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 
4
##
 
5
## Copyright 1998-2009 The OpenLDAP Foundation.
 
6
## All rights reserved.
 
7
##
 
8
## Redistribution and use in source and binary forms, with or without
 
9
## modification, are permitted only as authorized by the OpenLDAP
 
10
## Public License.
 
11
##
 
12
## A copy of this license is available in the file LICENSE in the
 
13
## top-level directory of the distribution or, alternatively, at
 
14
## <http://www.OpenLDAP.org/license.html>.
 
15
 
 
16
case "$BACKEND" in
 
17
bdb|hdb)
 
18
        ;;
 
19
*)
 
20
        echo "Test does not support $BACKEND backend"
 
21
        exit 0
 
22
esac
 
23
 
 
24
echo "running defines.sh"
 
25
. $SRCDIR/scripts/defines.sh
 
26
LVL=acl
 
27
 
 
28
mkdir -p $TESTDIR $DBDIR1
 
29
 
 
30
echo "Running slapadd to build slapd database..."
 
31
. $CONFFILTER $BACKEND $MONITORDB < $VALREGEXCONF > $CONF1
 
32
$SLAPADD -f $CONF1 -l $LDIFORDERED
 
33
RC=$?
 
34
if test $RC != 0 ; then
 
35
        echo "slapadd failed ($RC)!"
 
36
        exit $RC
 
37
fi
 
38
 
 
39
echo "Starting slapd on TCP/IP port $PORT1..."
 
40
$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
 
41
PID=$!
 
42
if test $WAIT != 0 ; then
 
43
    echo PID $PID
 
44
    read foo
 
45
fi
 
46
KILLPIDS="$PID"
 
47
 
 
48
sleep 1
 
49
 
 
50
echo "Testing attribute value regex subsitution..."
 
51
for i in 0 1 2 3 4 5; do
 
52
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
 
53
                'objectclass=*' > /dev/null 2>&1
 
54
        RC=$?
 
55
        if test $RC = 0 ; then
 
56
                break
 
57
        fi
 
58
        echo "Waiting 5 seconds for slapd to start..."
 
59
        sleep 5
 
60
done
 
61
 
 
62
if test $RC != 0 ; then
 
63
        echo "ldapsearch failed ($RC)!"
 
64
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
65
        exit $RC
 
66
fi
 
67
 
 
68
cat /dev/null > $SEARCHOUT
 
69
 
 
70
echo "# Try an attribute vale regex that match, but substitute does not"
 
71
echo "# this should fail"
 
72
$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj >> \
 
73
        $TESTOUT 2>&1 << EOMODS
 
74
dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
 
75
changetype: modify
 
76
replace: sn
 
77
sn: foobarbuz
 
78
EOMODS
 
79
RC=$?
 
80
case $RC in
 
81
50)
 
82
        echo "ldapmodify failed as expected"
 
83
        ;;
 
84
0)
 
85
        echo "ldapmodify should have failed ($RC)!"
 
86
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
87
        exit -1
 
88
        ;;
 
89
*)
 
90
        echo "ldapmodify failed ($RC)!"
 
91
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
92
        exit $RC
 
93
        ;;
 
94
esac
 
95
 
 
96
echo "# Try an attribute vale regex that match and substitute does"
 
97
echo "# this should succeed"
 
98
$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj >> \
 
99
        $TESTOUT 2>&1 << EOMODS
 
100
dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
 
101
changetype: modify
 
102
replace: sn
 
103
sn: James A Jones 1
 
104
EOMODS
 
105
RC=$?
 
106
 
 
107
test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
108
 
 
109
case $RC in
 
110
0)
 
111
        echo "ldapmodify succeed as expected"
 
112
        ;;
 
113
*)
 
114
        echo "ldapmodify failed ($RC)!"
 
115
        exit $RC
 
116
        ;;
 
117
esac
 
118
 
 
119
echo ">>>>> Test succeeded"
 
120
 
 
121
test $KILLSERVERS != no && wait
 
122
 
 
123
exit 0