| | |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2007-2008 Sun Microsystems, Inc. |
| | | ! Copyright 2007-2009 Sun Microsystems, Inc. |
| | | ! --> |
| | | |
| | | <!-- |
| | |
| | | --> |
| | | |
| | | <stax> |
| | | <defaultcall function="main_tasks"/> |
| | | <defaultcall function="main_tasks" /> |
| | | <function name="main_tasks"> |
| | | <function-list-args> |
| | | <function-required-arg name="STAXParentID"/> |
| | | </function-list-args> |
| | | |
| | | <sequence> |
| | | <block name="'tasks'"> |
| | | <sequence> |
| | | <!--- Load the job environment for the test group execution --> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" /> |
| | | <call function="'loadJobEnvironment'"> |
| | | { 'parent' : STAXParentID } |
| | | </call> |
| | | <script> |
| | | CurrentTestPath['group']='tasks' |
| | | </script> |
| | | |
| | | <call function="'testGroup_Preamble'" /> |
| | | <script> |
| | | testList = [] |
| | | testList.append('setup') |
| | | testList.append('restart_db') |
| | | testList.append('export-ldif') |
| | | testList.append('import-ldif') |
| | | testList.append('backup_db') |
| | | testList.append('restore_db') |
| | | testList.append('allowed-tasks') |
| | | testList.append('cleanup') |
| | | </script> |
| | | <iterate var="__test" in="testList" > |
| | | <sequence> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/tasks/%s.xml' % (TESTS_DIR,__test)"/> |
| | | <call function="'%s' % __test" /> |
| | | </sequence> |
| | | </iterate> |
| | | <call function="'testGroup_Postamble'" /> |
| | | </sequence> |
| | | </block> |
| | | <try> |
| | | <block name="'tasks'"> |
| | | <sequence> |
| | | <!--- Load the job environment for the test group execution --> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" /> |
| | | <call function="'loadJobEnvironment'"> |
| | | { 'parent' : STAXParentID } |
| | | </call> |
| | | <script> |
| | | CurrentTestPath['group']='tasks' |
| | | _group=CurrentTestPath['group'] |
| | | </script> |
| | | <call function="'testGroup_Preamble'" /> |
| | | <script> |
| | | suiteList = [] |
| | | suiteList.append('restart_db') |
| | | suiteList.append('export-ldif') |
| | | suiteList.append('import-ldif') |
| | | suiteList.append('backup_db') |
| | | suiteList.append('restore_db') |
| | | suiteList.append('allowed-tasks') |
| | | </script> |
| | | |
| | | <!-- Run the test suites --> |
| | | <iterate var="_suite" in="suiteList"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/%s/%s.xml' % (TESTS_DIR,_group,_suite)"/> |
| | | <call function="'%s' % (_suite)" /> |
| | | </sequence> |
| | | <catch exception="'STAFException.TestSuite.SetupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message> |
| | | </sequence> |
| | | </catch> |
| | | <catch exception="'STAFException.TestSuite.MainException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message> |
| | | </sequence> |
| | | </catch> |
| | | <catch exception="'STAFException.TestSuite.CleanupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message> |
| | | </sequence> |
| | | </catch> |
| | | </try> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | </sequence> |
| | | </block> |
| | | <catch exception="'STAXException.TestGroupException'"> |
| | | <sequence> |
| | | <message log="1" level="'fatal'">'Execution of Test Group Failed'</message> |
| | | </sequence> |
| | | </catch> |
| | | <finally> |
| | | <!-- Test Group postamble --> |
| | | <call function="'testGroup_Postamble'"/> |
| | | </finally> |
| | | </try> |
| | | </sequence> |
| | | </function> |
| | | </stax> |