Current release: CONDDB_0_2_0

  How to build and run the CondDBMySQL unit tests using config/make  
 

Supported platforms

  1. In order to use the Conditions Database MySQL implementation, you must use a supported platform and have access to all the required software:
    • Supported compilers:
      • gcc 2.95.2
      • gcc 3.2
      • gcc 3.2.3
      • gcc 3.3
      • Mac OSX 10.x
      • VS 6.0 and V .NET
    • MySQL library
      • 3.23.xx or higher
    At CERN, all machines in the lxplus cluster (lxplus.cern.ch) have the required software and are a good place to try out the CondDBMySQL unit tests.

Get an account on a MySQL server

  1. In order to run the CondDBMySQL unit tests, you need an account on a MySQL server. It is strongly recommended that you get your own development account on one of the MySQL servers available for the ConditionsDB. Please send an e-mail to Dinis Klose if you want to get a development account in one of the servers. .

    Within your account, you can create more than one "condition databases": the different databases, identified by their names, are completely independent from one another and can be separately created, deleted or modified.

    Until you get your own account, you may use the public account for CondDBOracle tests that has been created on the ATLAS atlobk01 server, with username 'conddblcg' and password 'conddb', with privileges to access any database whose name starts with 'conddblcg_'. In this case, please follow strictly the conventions and recommendations to run the unit tests and scripts: this will make sure that you will use always the same condition database in the public account, with name equal to 'conddblcg_' followed by your O/S username (${USER}). For example, for user 'myuser' you should use the database name 'conddblcg_myuser'.

Download and build the CondDBMySQL package and run its unit tests

  1. At CERN, it is recommended that you use the lxplus cluster:
    ssh lxplus
    tcsh
    
    In the following, for simplicty, all instructions are given assuming the use of tcsh or a related shell. If you prefer to use sh or a related shell, just use "export" instead of "setenv" and "unset" instead of "unsetenv".
  2. Create a directory where you will work:
    mkdir ~/myLCG
    
  3. Get access to the CONDDB CVS repository so that you will be able to check out the source code of the CondDBMySQL implementation and unit tests:
    setenv CVSROOT :pserver:anonymous@conditionsdb.cvs.cern.ch:/cvs/conditionsdb
    
  4. Download the CondDBMySQL package:
    cd ~/myLCG/
    rm -rf ~/myLCG/CondDBMySQL
    cvs co -P -d CondDBMySQL -r CondDBMySQLLisbon-0-5-1 conddb/CondDBMySQL 
    
  5. Configure your favourite compiler. At CERN, it is recommended that you use the gcc3.2 compiler:
    setenv PATH /usr/local/gcc-alt-3.2/bin:${PATH}
    if ( ! ${?LD_LIBRARY_PATH} ) setenv LD_LIBRARY_PATH ""
    setenv LD_LIBRARY_PATH /usr/local/gcc-alt-3.2/lib:${LD_LIBRARY_PATH}
    
  6. Build the CondDBMySQL library and the unit tests:
    cd ~/myLCG/CondDBMySQL/
    ./configure --with-conddbprofile=atlobk01:conddblcg_${USER}:conddblcg:conddb \
      --with-mysql-lib=/afs/cern.ch/sw/lcg/external/mysql/4.0.13/rh73_gcc32/lib/ \
      --with-mysql-inc=/afs/cern.ch/sw/lcg/external/mysql/4.0.13/rh73_gcc32/include/
    make
    

    The --with-conddbprofile option specifies the default MySQL server, account name, password and database that will be used by the CondDBMySQL library (unless the COND_DB_INIT environment variables specifies different values, in the format hostname:db_name:username:password). The account specified in this case is the public account on atlobk01 mentioned above.

    The --with-mysql-lib and --with-mysql-inc options specify the path to the MySQL libraries and include files. If you omit this option, the configure script will search automatically for the MySQL libraries and include files in the "standard" places. The libraries specified in this case are the MySQL 4.0.13 libraries appropriate to the gcc3.2 compiler on RedHat7.3 systems.

    Optionally, you can also pass the --prefix=PREFIX option to the configure script with the directory in which you want to install the bin, lib and include files.

    The following executables will appear under the ~/myLCG/CondDBMySQL/tests/ directory, in subdirectories with the same name:

    basicSession
    createTags
    performanceTests
    readDatax
    readTable
    readTableVer
    storeDataOnChange
    storeDatax
    storeDatay
    storeTable
    storeTableVer
    testFolders
    testTableTags
    testTags
    
  7. Set up the run-time environment for MySQL:
    setenv MYSQL_BASE /afs/cern.ch/sw/lcg/external/mysql/4.0.13/rh73_gcc32
    setenv PATH ${MYSQL_BASE}/bin:${PATH}
    setenv LD_LIBRARY_PATH ${MYSQL_BASE}/lib:${LD_LIBRARY_PATH}
    
  8. Before you execute the unit tests, you may want to increase the verbosity of the CondDBMySQL library from the default ('none') to one of 'prof', 'user', 'devl', more', 'all', and change the debug output destination from the default (file "cdb.log"), for instance:
    setenv COND_DB_DEBUG all
    setenv COND_DB_DEBUGLOG /dev/stderr
    
  9. Test that your account has been activated and that your environment is correctly set up by executing the following script, which will display the different condition databases which have been created in your account.

    If you are using the public account, type (this will list all MySQL databases visible from the public account):

    ~/myLCG/CondDBMySQL/scripts/condDBMySQL_listCondDBs.csh conddblcg conddb atlobk01
    
    If you are using your private account, type:
    ~/myLCG/CondDBMySQL/scripts/condDBMySQL_listCondDBs.csh username password hostname
    
  10. Delete the condition database that will be (re-)created in the unit tests, if it exists (otherwise you cannot check whether insertion of data in the tests really works as expected). If the condition database with the name specified does not exist (i.e. you have not seen it listed when executing condDBMySQL_listCondDBs.csh), you do not need to execute these commands (and it is normal that you get an error if you do!).

    If you are using the public account, type:

    ~/myLCG/CondDBMySQL/scripts/condDBMySQL_dropCondDB.csh \
      conddblcg conddb atlobk01 conddblcg_${USER}
    
    If you are using a private account, type:
    ~/myLCG/CondDBMySQL/scripts/condDBMySQL_dropCondDB.csh \
      username password hostname db_name
    
  11. Execute the basic example programs, in the following order.

    ~/myLCG/CondDBMySQL/tests/basicSession/basicSession
    
    ~/myLCG/CondDBMySQL/tests/storeDatax/storeDatax 10
    ~/myLCG/CondDBMySQL/tests/storeDatay/storeDatay 10
    ~/myLCG/CondDBMySQL/tests/readDatax/readDatax 
    
    ~/myLCG/CondDBMySQL/tests/createTags/createTags
    ~/myLCG/CondDBMySQL/tests/testTags/testTags
    
    ~/myLCG/CondDBMySQL/tests/storeTable/storeTable
    ~/myLCG/CondDBMySQL/tests/readTable/readTable
    
    ~/myLCG/CondDBMySQL/tests/storeTableVer/storeTableVer
    ~/myLCG/CondDBMySQL/tests/readTableVer/readTableVer
    ~/myLCG/CondDBMySQL/tests/testTableTags/testTableTags
    
 
Note: For more information please refer to the ConditionsDB MySQL Manual at: http://www.freedevices.org/


For any questions please contact Dinis Klose