reSIProcate/repro  9694
Defines | Functions
genUsers.cxx File Reference
#include <cassert>
#include <iostream>
#include "repro/UserStore.hxx"
#include "repro/AbstractDb.hxx"
#include "repro/BerkeleyDb.hxx"
#include "rutil/Data.hxx"
#include "rutil/Logger.hxx"
Include dependency graph for genUsers.cxx:

Go to the source code of this file.

Defines

#define RESIPROCATE_SUBSYSTEM   Subsystem::REPRO

Functions

int main (int argc, char *argv[])

Define Documentation

#define RESIPROCATE_SUBSYSTEM   Subsystem::REPRO

Definition at line 15 of file genUsers.cxx.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 19 of file genUsers.cxx.

{
   Log::initialize(Log::Cerr, Log::Err, argv[0]);
   Log::setLevel(Log::Info);
   
   const int numUsers = 100*1000;
   
   AbstractDb* db = new BerkeleyDb;

   UserStore store( *db );
   
   for ( int i=0; i<numUsers;i++)
   {
      Data user = Data("User") + Data(i);
      
      store.addUser( user,
                     "localhost", // domain
                     "localhost", // realm
                     "password", // password 
                     true,       // apply hash to password
                     "Alice W. Here", // fullName
                     "alice@example.com" /*email*/ );

      if ( i%100 == 0 )
      {
         InfoLog( << "Created " << user );
      }
   }

   return 0;
}