]> git.sur5r.net Git - openldap/commitdiff
allow to use 'swamp' from slapd-tester
authorPierangelo Masarati <ando@openldap.org>
Sat, 28 Aug 2010 21:38:47 +0000 (21:38 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 28 Aug 2010 21:38:47 +0000 (21:38 +0000)
tests/progs/slapd-tester.c

index 382a224c7431c751e4fa561cf5b9f2d7bfbef7a7..1b49c5433d53049d9807edd7f508d4a3b2b32dce 100644 (file)
@@ -139,6 +139,8 @@ main( int argc, char **argv )
        int             sanum;
        int             sextra_args = 0;
        char            scmd[MAXPATHLEN];
+       int             swamp = 0;
+       char            swampopt[sizeof("-SSS")];
        /* static so that its address can be used in initializer below. */
        static char     sloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)];
        /* read */
@@ -209,7 +211,7 @@ main( int argc, char **argv )
        mloops[0] = '\0';
        bloops[0] = '\0';
 
-       while ( ( i = getopt( argc, argv, "AB:CD:d:FH:h:Ii:j:L:l:NP:p:r:t:Ww:y:" ) ) != EOF )
+       while ( ( i = getopt( argc, argv, "AB:CD:d:FH:h:Ii:j:L:l:NP:p:r:St:Ww:y:" ) ) != EOF )
        {
                switch ( i ) {
                case 'A':
@@ -336,6 +338,10 @@ main( int argc, char **argv )
                        retries = strdup( optarg );
                        break;
 
+               case 'S':
+                       swamp++;
+                       break;
+
                case 't':               /* the delay in seconds between each retry */
                        delay = strdup( optarg );
                        break;
@@ -544,6 +550,13 @@ main( int argc, char **argv )
                sargs[sanum++] = "-i";
                sargs[sanum++] = ignore;
        }
+       if ( swamp ) {
+               swampopt[0] = '-';
+               if ( swamp > 3 ) swamp = 3;
+               swampopt[swamp + 1] = '\0';
+               for ( ; swamp-- > 0; ) swampopt[swamp + 1] = 'S';
+               sargs[sanum++] = swampopt;
+       }
        sargs[sanum++] = "-b";
        sargs[sanum++] = NULL;          /* will hold the search base */
        sargs[sanum++] = "-s";