OpenDBX/Test application

From Linuxnetworks
< OpenDBX
Revision as of 21:27, 8 May 2010 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are two applications for testing the OpenDBX library and their backends available when building the library from source.

Name

These to applications can be found in the "test" sub-directory of the extracted tarball:

./test/odbxtest
./test/odbxplustest

The first one (odbxtest) uses the C library functions available from libopendbx while the second one (odbxplustest) executes the same statements by using the C++ objects from libopendbxplus.

Sypnosis

./test/odbxtest -b <backend or library>
  -h <host or IP or directory> [-p <port>]
  -d <database or file name> -u <user name>
  -w <password> [-r <runs>] [-e]
./test/odbxplustest -b <backend or library>
  -h <host or IP or directory> [-p <port>]
  -d <database or file name> -u <user name>
  -w <password> [-r <runs>] [-e]

Description

The applications execute a test suite containing a predefined set of SQL statements against your server. This includes creating a table, inserting rows, performing multiple SELECT, UPDATE and DELETE statements (also within transactions if supported). It also removes the created table and tests for certain error conditions.

Options

-b <backend> 
Name of the database backend (see list of supported backends) or path to the backend library (e.g. "./backends/mysql/.libs/libmysqlbackend.so")
-h <host> 
Host name, IP address or directory path to the database file. Look at the database specific configuration for details
-p <port> 
Port the server is listening to. Usually, this is the port number, some databases also support the port name. Most of the time it's optional and the default port is used by the native database client, but sometimes it's required (like for the Oracle backend)
-d <database> 
Name of the database or database file in the file system
-u <user> 
User name for authentication (not required for sqlite or sqlite3 backends)
-w <password> 
Password for authentication (not required for sqlite or sqlite3 backends)
-r <runs> 
Number of times the test suite is executed (optional)
-e 
Enable encryption to the database server if supported (optional)

Examples

MySQL with encrypted connections

./test/odbxtest -b ./backends/mysql/.libs/libmysqlbackend.so
  -h 127.0.0.1 -d odbx -u odbx -w odbx -e

SQLite 3 using file in ./test/odbx.sq3 (will be created if it doesn't exist)

./test/odbxtest -b ./backends/sqlite3/.libs/libsqlite3backend.so
  -h ./test/ -d odbx.sq3

Oracle with required port parameter

./test/odbxtest -b ./backends/oracle/.libs/liboraclebackend.so
  -h localhost -p 1521 -d ODBX -u odbx -w odbx