The real test work is accomplished in test functions. The scripts call these functions with certain parameters and expected values. The functions contain the code that links to external libraries to accomplish an objective. Within the test function is the check for whether the expected result was achieved or not. This allows the script to check for both positive and negative results. Often, an XPOZ test function is a wrapper for a third-party library function, adding to it the ability to check results along with the chance of retrying the function call for a loosely consistent database.
A loosely consistent database is one where synchronization is involved, so it is possible that a check is made prior to completing synchronization. In these cases, the check should be repeated for a predetermined number of times before failing the test.
The script format for an XPOZ test function is:
<test function name>(set of parameter name-parameter value set entities);
You can also include the optional <return code> at the front of the test function. The return code is always an integer and can be checked by the XPOZ script and subsequently used to determine script flow control.
All XPOZ test functions use a common parameter called ExpResult. The ExpResult parameter is a multivalued entity that describes what the result from the test is expected to be. Often a test function can return any one of a set of values and still be considered successful. For example, if a script calls a function to add an object, a successful answer would either be “object added” or “object already exists”. The ExpResult parameter allows you to specify all acceptable results. If any of them is found, the call is considered a success.
Additional values for the ExpResult parameter include:
“OK”
“BAD”
“GREATER_THAN_ZERO”
“Y”
“YES”
“ZERO_OR_GREATER”
“TRUE_OR_FALSE”
“PASS_THROUGH”
The documentation for the XPOZ functions is available for download on the Resource Kit download page.