gLite Data Agents Common Module Testing description

Paolo Badino

$Id: TEST.xml,v 1.3 2007/01/24 12:08:20 badino Exp $


Table of Contents

Unit Tests
UnitTest common flow

Abstract

This document describes the procedures that should be followed to execute the unit tests for the gLite Data Agents Common module

Unit Tests

The gLite Data Agents Common module provides trhe following unit tests:

  • Common Utility

  • ServiceDiscovery

  • Myproxy Cred Service

  • Oracle DAO Connection

  • MySQL DAO Connection

In order to execute these tests, the following preconditions should be met:

  • A MySQL server is neede. Its host name should be provided by property mysql.hostname in the glite.build.properties file in your HOME directory. The name of the Database to use should be specified by the property mysql.dbname and the username and the password of a user able to access the DB should be stored under mysql.username and mysql.password. In case the location of the MySQL server is "localhost", you can specify the mysql socket using the property mysql.socket.

  • A Oracle 9i or 10g server server installed. The username and password of user able to access the DB should be stored under the properties oracle.username and oracle.password in the glite.build.properties file in your HOME directory, as well as the Oracle ConnectString (oracle.connectstring). In case you need to resolve TNS Oracle symbols, you'll need also to set the TNS_ADMIN environment variable into the property oracle.tns_admin.

  • A MyProxy Server should be available at the host specified by the property myproxy.server in the glite.build.properties file in your HOME directory, and a certificate should be uploaded to that server for the user which DN is specified by the property myproxy.user.dn, with the passphrase specified in myproxy.user.passphrase.

In order to perform the test, you can invoke:

    ant test-common
    ant test-sd
    ant test-cred-myproxy
    ant test-dao-mysql
    ant test-dao-ora
    ant test-python

or you can also use

    ant test-all

to execute them all.

Due to the fact that the build server cannot met the preconditions, the target "unittest" has not been used.

All of the tests use CppUnit, so the result will be displaied using the format common to all the xUnit frameworks.

UnitTest common flow

Before executing each unit test, the corresponding ant target will install all the required files into the WORKSPACE/stage/test/glite-data-agents-common folder. Those files are:

Configuration Files

Test application use ServiceConfiguration and the requested files are installed under the etc folder. Since these files need to contain some information depending on the deployment, these are not hardcoded but generated starting from the properties set in ~/glite.build.properties, has explained above. In order to generate the configuration of the test application, the config templates exported by the module in $(GLITE_LOCATION)/share/config/glite-data-agents-common/config-templates are used.

Scripts Files

These files are the scripts to create and populate the table on the Database and sone other script that can be used to return an expected value. They are installed under the bin folder

In order to execute the test, the test application would then set the environment variable GLITE_LOCATION to WORKSPACE/stage/test/glite-data-agents-common, so the program can correctly locate the configuration, as well as the log destination folder.

Once the setup is completed, the test application is executed with the command:

    glite_data_agents_common_test_NAME
      -l WORKSPACE/stage/test/glite-data-agents-common
      -s 
      
    where 
      -l specify the location that will be used as GLITE_LOCATION
    and  
      -s will enbable the CompilerOutputFormatter

Depending of the type of the unit test, additional parameter may be required. In order to get these details, you can run the test application with the -h option