]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9309 test rejection of redundant ppolicy config
authorHoward Chu <hyc@openldap.org>
Mon, 10 Aug 2020 22:08:37 +0000 (23:08 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 10 Aug 2020 22:15:35 +0000 (22:15 +0000)
tests/scripts/test022-ppolicy

index 3bb2d0ee611cc7d236aec093b6020a25c5cbb462..cde344de1fd16b1937ccb1b324b7c7a951424032 100755 (executable)
@@ -60,6 +60,21 @@ fi
 
 echo /dev/null > $TESTOUT
 
+echo "Testing redundant ppolicy instance..."
+$LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
+dn: olcOverlay=ppolicy,olcDatabase={1}$BACKEND,cn=config
+objectClass: olcOverlayConfig
+objectClass: olcPPolicyConfig
+olcOverlay: ppolicy
+olcPPolicyDefault: cn=duplicate policy,ou=policies,dc=example,dc=com
+EOF
+RC=$?
+if test $RC = 0 ; then
+       echo "ldapadd should have failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
 echo "Using ldapadd to populate the database..."
 # may need "-e relax" for draft 09, but not yet.
 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \