359N/A * The contents of this file are subject to the terms of the 359N/A * Common Development and Distribution License, Version 1.0 only 359N/A * (the "License"). You may not use this file except in compliance 359N/A * See the License for the specific language governing permissions 359N/A * and limitations under the License. 359N/A * When distributing Covered Code, include this CDDL HEADER in each 6982N/A * If applicable, add the following below this CDDL HEADER, with the 6982N/A * fields enclosed by brackets "[]" replaced with your own identifying 359N/A * Portions Copyright [yyyy] [name of copyright owner] 5176N/A * Copyright 2006-2010 Sun Microsystems, Inc. 5414N/A * Portions Copyright 2011 ForgeRock AS 1329N/A //Root suffix for verify backend 1329N/A //Attribute type in stat entry containing error count 1329N/A //Some DNs needed mostly for DN2ID tests 1329N/A //This index file should not exist 1329N/A "define maildomain=example.com",
1329N/A "define numusers= #numEntries#",
1329N/A "subordinateTemplate: person:[numusers]",
1329N/A "objectClass: organizationalPerson",
1329N/A "objectClass: inetOrgPerson",
1329N/A "initials: {givenName:1}<random:chars:" +
1329N/A "ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1}",
1329N/A "employeeNumber: <sequential:0>",
1329N/A "uid: user.{employeeNumber}",
1329N/A "mail: {uid}@[maildomain]",
1329N/A "telephoneNumber: <random:telephone>",
1329N/A "homePhone: <random:telephone>",
1329N/A "pager: <random:telephone>",
1329N/A "mobile: <random:telephone>",
1329N/A "street: <random:numeric:5> <file:streets> Street",
1329N/A "postalCode: <random:numeric:5>",
1329N/A "postalAddress: {cn}${street}${l}, {st} {postalCode}",
1329N/A "description: This is the description for {cn}.",
1329N/A * Performs a ncomplete verify against a backend using the 1329N/A * entries loaded in the setup initializer. 1329N/A * @throws Exception if error count is not equal to 0. 1329N/A * Adds more than "entry limit" number of entries and runs clean 1329N/A * verify against two indexes. 1329N/A * @throws Exception if error count is not equal to 0. 1329N/A * Runs clean verify jobs against a set of indexes (defined in 1329N/A * @param index An element of the indexes array. 1329N/A * @throws Exception if the error count is not equal to 0. 469N/A * Begin Clean index tests. These are tests that cursor through an index 469N/A * file and validate it's keys and idlists against the id2entry database entries. 469N/A * The complete index tests go the other way. They cursor the id2entry database 469N/A * and validate each entry against the various index files. 1329N/A * Runs clean verify against the dn2id index after adding 1329N/A * various errors in that index file. 1329N/A * @throws Exception if the error count is not equal to 5. 1590N/A //Add a junk DN and non-existent entry id to DN2ID index 1590N/A //Make two DN keys point at same entry. 1590N/A //Add badDN key with bad entry id 1590N/A //Add DN key with malformed entryID 1590N/A //Try to break JebFormat version 1329N/A * Runs clean verify against the id2children index after adding 1329N/A * various errors in that index file. 1329N/A * @throws Exception if the error count is not equal to 6. 1590N/A //Try to break JebFormat version of key entry 1590N/A //put invalid key -- no EntryID matches 1329N/A * Runs clean verify against the id2subtree index after adding 1329N/A * various errors in that index file. 1329N/A * @throws Exception if the error count is not equal to 7. 1590N/A //put invalid ids into entry 3 idlist 1590N/A //Try to break JebFormat version of key entry 1590N/A //put invalid key -- no EntryID matches 1329N/A * Runs clean verify against the telephoneNumber.equality index 1329N/A * after adding various errors in that index file. 1329N/A * @throws Exception if the error count is not equal to 4. 1590N/A //Add entry with bad JEB format Version 1590N/A //Add phone number with various bad id list entryIDs 1590N/A //put duplicate ids in list 1590N/A //put id that doesn't exist 1590N/A //point to bad entry added above 1590N/A //really 5 errors, but duplicate reference doesn't increment error 1948N/A * Runs clean verify against the testvlvindex VLV index 1948N/A * after adding various errors to each of these index files. 1948N/A * @throws Exception if the error count is not equal to 6. 1948N/A // Add an incorrectly ordered values. 1948N/A // Muck up the values of another ID 1329N/A * Begin complete verify index tests. As described above, these are 1329N/A * tests that cursor through the id2entry database and validate 1329N/A * each entry against the various index files. 1329N/A * Runs complete verify against the telephoneNumber index 1329N/A * after adding various errors in the id2entry file. 1329N/A * @throws Exception if the error count is not equal to 3. 1590N/A //add entry with ramdom bytes 1329N/A * Runs complete verify against the dn2id index 1329N/A * after adding various errors in the dn2id file. 1329N/A * @throws Exception if the error count is not equal to 3. 1590N/A //add entry but no corresponding dn2id key 1590N/A //entry has dn2id key but its entryID -- don't need key 1590N/A //insert key with bad entry id (45 instead of 10) 1590N/A //entry has no parent in dn2id 1329N/A * Runs complete verify against the id2children index 1329N/A * after adding various errors in the id2children file. 1329N/A * @throws Exception if the error count is not equal to 3. 1590N/A //Add child entry - don't worry about key 1590N/A //Add its parent entry -- need the key 1329N/A * Runs complete verify against the id2children index 1329N/A * after adding various errors in the id2children file. 1329N/A * This is a second test because the key needed to have 1329N/A * null idlist. This test is really just for coverage and 1329N/A * should have a 0 error count. 1329N/A * @throws Exception if the error count is not equal to 0. 1590N/A //Add child entry - don't worry about key 1329N/A * Runs complete verify against the id2subtree index 1329N/A * after adding various errors in the id2subtree file. 1329N/A * @throws Exception if the error count is not equal to 3. 1329N/A * Runs complete verify against the id2subtree index 1329N/A * after adding various errors in the id2subtree file. 1329N/A * This is a second test because the key needed to have 1329N/A * @throws Exception if the error count is not equal to 1. 1590N/A //Add child entry - don't worry about key 1329N/A * Runs complete verify against the mail indexes 1329N/A * (equality, presence, substring, ordering) 1329N/A * after adding various errors to each of these index files. 1329N/A * @throws Exception if the error count is not equal to 6. 1590N/A //Get db handles to each index. 1590N/A //Add invalid idlist ids to both equality and ordering indexes. 1590N/A //put duplicate ids in list 1590N/A //Add null idlist to both equality and ordering indexes. 1590N/A //Add invalid idlist ids to presence index. 1590N/A //Add invalid idlist ids to substring index. 1948N/A * Runs complete verify against the testvlvindex VLV index 1948N/A * after adding various errors to each of these index files. 1948N/A * @throws Exception if the error count is not equal to 6. 1948N/A // Add an incorrectly ordered values. 1948N/A // Muck up the values of another ID 1329N/A /* Various tests not either clean or complete */ 1329N/A * Try to verify a non-indexed attribute. 1329N/A * @throws Exception if error count is not equal to 0. 1329N/A * Try to verify an nonexistent attribute. 1329N/A * @throws Exception if verify backend fails. 1329N/A * Adds an entry to the id2entry database with a dn and id passed into the 1329N/A * method. Optional flag to set the Jeb version byte for those types of tests. 1329N/A * @param dn the dn string to put in the entry. 1329N/A * @param id to use as the id2entry key, 1329N/A * @param trashFormat true if first byte should be changed to invalid value. 1329N/A * @return Database entry key of the entry. 1329N/A * @throws Exception if the entry is not added to the id2entry database. 1329N/A * Wrapper to do a clean verify. 1329N/A * @param indexToDo index file to run verify against. 1329N/A * @param expectedErrors number of errors expected for this test. 1329N/A * @throws Exception if the verify fails. 1329N/A * Wrapper to do a complete verify. 1329N/A * @param indexToDo index file to run verify against. 1329N/A * @param expectedErrors number of errors expected for this test. 1329N/A * @throws Exception if the verify fails. 1329N/A * Performs either a clean or complete verify depending on 1329N/A * @param indexToDo index file to run verify against. 1329N/A * @param expectedErrors number of errors expected for this test. 1329N/A * @param clean do clean verify if true. 1329N/A * @throws Exception if the verify fails. 1329N/A * Does a pretest setup. Creates some number of entries, gets 1329N/A * backend, rootcontainer, entryContainer objects, as well as 1329N/A * Also starts a transaction. 1329N/A * @param numEntries number of entries to add to the verify backend. 1329N/A * @throws Exception if entries cannot be loaded. 1329N/A * Cleans verify backend and loads some number of entries. 1329N/A * @param numEntries number of entries to load into the backend. 1329N/A * @throws Exception if the entries are not loaded or created. 1329N/A * Gets information from the stat entry and returns that value as a Long. 1329N/A * @param e entry to search. 1329N/A * @param type attribute type 1329N/A * @throws NumberFormatException if the attribute value cannot be parsed. 1329N/A * Builds an entry suitable for using in the verify job to gather statistics about 1329N/A * @param dn to put into the entry. 1329N/A * @return a suitable entry. 1329N/A * @throws DirectoryException if the cannot be created.