this commit includes some code refactoring but mainly code to support emma in the functional tests and the new XSL sheet for dynamic report drill down
| | |
| | | ! Portions Copyright 2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | <function name="GetDirectoryServerVars"> |
| | | <function-prolog> |
| | | This function gets variables associated with the Directory Server |
| | |
| | | </function-map-args> |
| | | |
| | | <sequence> |
| | | |
| | | <script> |
| | | mylocation=location |
| | | mypath=dsPath |
| | | |
| | | DSInfo=directory_server_information() |
| | | </script> |
| | | |
| | |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : mylocation, |
| | | 'dsPath' : mypath, |
| | | 'dsSystemInfo' : 'true' } |
| | | 'dsSystemInfo' : 'true' |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC != 0"> |
| | |
| | | 'Unable to obtain system information variables for %s %s.' % (mylocation,mypath) |
| | | </message> |
| | | <else> |
| | | <sequence> |
| | | <message> |
| | | 'Processing [%s]' % STAXResult |
| | | </message> |
| | | <script> |
| | | DSInfo.SystemList=STAXResult[1].split('\n') |
| | | |
| | | DSInfo.SystemList=STAXResult[0][1].split('\n') |
| | | DSInfo.ServerDict['server version']= \ |
| | | DSInfo.getServerVersion(DSInfo.SystemList[0]) |
| | | |
| | |
| | | |
| | | DSInfoServersDict[mypath]=DSInfo.ServerDict |
| | | </script> |
| | | |
| | | </sequence> |
| | | </else> |
| | | |
| | | </if> |
| | | |
| | | <!-- Obtain the secret variables for the system from start-ds --> |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : mylocation, |
| | | 'dsPath' : mypath, |
| | | 'dsBuildInfo' : 'true' } |
| | | 'dsBuildInfo' : 'true' |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC != 0"> |
| | |
| | | 'Unable to obtain build information variables for %s %s.' % (mylocation,mypath) |
| | | </message> |
| | | <else> |
| | | |
| | | <script> |
| | | DSInfo.SystemList=STAXResult[1].split('\n') |
| | | DSInfo.SystemList=STAXResult[0][1].split('\n') |
| | | |
| | | for DSInfo.line in DSInfo.SystemList: |
| | | DSInfo.key=DSInfo.line[0:DSInfo.line.find(':')].strip() |
| | |
| | | DSInfo.ServerDict['debug build']= \ |
| | | DSInfo.getServerValueFromKey('Debug Build',DSInfo.SystemDict) |
| | | </script> |
| | | |
| | | </else> |
| | | |
| | | </if> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | </stax> |
| | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Setup DS Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Setup DS Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'path' : dsPath |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Setup DS Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Setup DS Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Start DS Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | startRC=RC |
| | | startResult=STAXResult |
| | | </script> |
| | | |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : startRC , |
| | | 'result' : startResult } |
| | | </call> |
| | | |
| | | <return>startResult[0]</return> |
| | | <return>startResult</return> |
| | | |
| | | </sequence> |
| | | |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Stop DS Script'"> |
| | | <location>'%s' % (location)</location> |
| | | <command>'%s' % (STAFCmd)</command> |
| | | <parms>'%s' % (STAFCmdParams)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Stop DS Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | This function generates a server jks certificate |
| | | </function-prolog> |
| | | <sequence> |
| | | <process name="'Generate Server JKS Certificate'"> |
| | | <location>'%s' % (STAF_REMOTE_HOSTNAME) </location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-genkey -alias server-cert -keyalg rsa -dname "cn=client,O=Sun Microsystems,C=US" -keystore "keystore" -storepass "servercert" -keypass "servercert"'</parms> |
| | | <workdir>'%s/../config' % (OPENDS_BINPATH)</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Generate Server JKS Certificate', |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-genkey -alias server-cert -keyalg rsa -dname "cn=client,O=Sun Microsystems,C=US" -keystore "keystore" -storepass "servercert" -keypass "servercert"', |
| | | 'path' : '%s/../config' % (OPENDS_BINPATH), |
| | | 'location' : STAF_REMOTE_HOSTNAME |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | This function generates a server PKCS12 certificate |
| | | </function-prolog> |
| | | <sequence> |
| | | <process name="'Generate Server PKCS12 Certificate'"> |
| | | <location>'%s' % (STAF_REMOTE_HOSTNAME) </location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-genkey -alias server-cert -keyalg rsa -dname "cn=client,O=Sun Microsystems,C=US" -keystore "keystore" -storepass "servercert" -keypass "servercert" -storetype "PKCS12"'</parms> |
| | | <workdir>'%s/../config' % (OPENDS_BINPATH)</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Generate Server PKCS12 Certificate', |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-genkey -alias server-cert -keyalg rsa -dname "cn=client,O=Sun Microsystems,C=US" -keystore "keystore" -storepass "servercert" -keypass "servercert" -storetype "PKCS12"', |
| | | 'path' : '%s/../config' % (OPENDS_BINPATH), |
| | | 'location' : STAF_REMOTE_HOSTNAME |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | This function self-signs a server JKS certificate |
| | | </function-prolog> |
| | | <sequence> |
| | | <process name="'Self-Signs Server JKS Certificate'"> |
| | | <location>'%s' % (STAF_REMOTE_HOSTNAME) </location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-selfcert -alias server-cert -keystore "keystore" -storepass "servercert"'</parms> |
| | | <workdir>'%s/../config' % (OPENDS_BINPATH)</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Self-Signs Server JKS Certificate', |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-selfcert -alias server-cert -keystore "keystore" -storepass "servercert"', |
| | | 'path' : '%s/../config' % (OPENDS_BINPATH), |
| | | 'location' : STAF_REMOTE_HOSTNAME |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | This function self-signs a server PKCS12 certificate |
| | | </function-prolog> |
| | | <sequence> |
| | | <process name="'Self-Signs Server PKCS12 Certificate'"> |
| | | <location>'%s' % (STAF_REMOTE_HOSTNAME) </location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-selfcert -alias server-cert -keystore "keystore" -storepass "servercert" -storetype "PKCS12"'</parms> |
| | | <workdir>'%s/../config' % (OPENDS_BINPATH)</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % (OPENDS_BINPATH), 'JAVA_HOME=%s' % (JAVA_HOME)] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Self-Signs Server PKCS12 Certificate', |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-selfcert -alias server-cert -keystore "keystore" -storepass "servercert" -storetype "PKCS12"', |
| | | 'path' : '%s/../config' % (OPENDS_BINPATH), |
| | | 'location' : STAF_REMOTE_HOSTNAME |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | <message> |
| | | '%s/import-ldif%s -l %s -n %s %s' % (dsBinPath,fileExt,ldifFile,backEnd,extraParams) |
| | | </message> |
| | | <process name="'Offline Import'"> |
| | | <location>'%s' % location </location> |
| | | <command>'%s/import-ldif%s' % (dsBinPath,fileExt)</command> |
| | | <parms>'-l %s -n %s %s' % (ldifFile,backEnd,extraParams)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Offline Import', |
| | | 'command' : '%s/import-ldif%s' % (dsBinPath,fileExt), |
| | | 'arguments' : '-l %s -n %s %s' % (ldifFile,backEnd,extraParams) |
| | | } |
| | | </call> |
| | | <script> |
| | | importRC=RC |
| | | importResult=STAXResult |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Offline Import Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Offline Import Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams |
| | | } |
| | | </call> |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | <message> |
| | | '%s/export-ldif%s -l %s -n %s %s' % (dsBinPath,fileExt,ldifFile,backEnd,extraParams) |
| | | </message> |
| | | <process name="'Ldif Export'"> |
| | | <location>'%s' % location </location> |
| | | <command>'%s/export-ldif%s' % (dsBinPath,fileExt)</command> |
| | | <parms>'-l %s -n %s %s' % (ldifFile,backEnd,extraParams)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Ldif Export', |
| | | 'command' : '%s/export-ldif%s' % (dsBinPath,fileExt), |
| | | 'arguments' : '-l %s -n %s %s' % (ldifFile,backEnd,extraParams) |
| | | } |
| | | </call> |
| | | <script> |
| | | exportRC=RC |
| | | exportResult=STAXResult |
| | |
| | | <message> |
| | | 'backup%s -n %s -d %s %s' % (fileExt,backEnd,backupDir,extraParams) |
| | | </message> |
| | | <process name="'Offline Backup'"> |
| | | <location>'%s' % myLocation </location> |
| | | <command>'%s/backup%s' % (dsBinPath,fileExt)</command> |
| | | <parms>'-d %s -n %s %s' % (backupDir,backEnd,extraParams)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Offline Backup', |
| | | 'location' : myLocation, |
| | | 'command' : '%s/backup%s' % (dsBinPath,fileExt), |
| | | 'arguments' : '-d %s -n %s %s' % (backupDir,backEnd,extraParams) |
| | | } |
| | | </call> |
| | | <script> |
| | | backupRC=RC |
| | | backupResult=STAXResult |
| | |
| | | <message> |
| | | 'restore%s -d %s %s' % (fileExt,backupDir,extraParams) |
| | | </message> |
| | | <process name="'Offline restore'"> |
| | | <location>'%s' % myLocation </location> |
| | | <command>'%s/restore%s' % (dsBinPath,fileExt)</command> |
| | | <parms>'-d %s %s' % (backupDir,extraParams)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Offline Restore', |
| | | 'location' : myLocation, |
| | | 'command' : '%s/restore%s' % (dsBinPath,fileExt), |
| | | 'arguments' : '-d %s %s' % (backupDir,extraParams) |
| | | } |
| | | </call> |
| | | <script> |
| | | restoreRC=RC |
| | | restoreResult=STAXResult |
| | |
| | | </message> |
| | | |
| | | <!-- Search for task status --> |
| | | <process name="'Search On line Import Task'"> |
| | | <location>'%s' % myLocation</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Search On line Import Task', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : myLocation |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | STAFCmdRC=RC |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Add Entry from ldif file'"> |
| | | <location>'%s' % mylocation</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : mylocation, |
| | | 'name' : 'Add Entry From LDIF' |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode , |
| | | 'result' : STAXReason, |
| | | 'expected' : expectedRC } |
| | | 'expected' : expectedRC |
| | | } |
| | | </call> |
| | | <return> |
| | | STAXReason |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- ldapmodify Function With Script--> |
| | | <function name="ldapModifyWithScript"> |
| | | <function-prolog> |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'LDAP Modify Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'LDAP Modify Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | STAXCode=RC |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <function name="modifyEntry"> |
| | | <function-prolog> |
| | | This function modifies an entry in the Directory Server |
| | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Modify Entry from ldif file'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'location' : location, |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'name' : 'Modify Entry from ldif file' |
| | | } |
| | | </call> |
| | | |
| | | <script> |
| | | STAXCode=RC |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- ldapsearch Function With Script--> |
| | | <function name="ldapSearchWithScript"> |
| | | <function-prolog> |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'LDAP Search Script'"> |
| | | <process name="'LDAP Search Script to file'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <function name="SearchObject"> |
| | | <function-prolog> |
| | | This function searches the Directory Server with optional arguments possible |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Search Base Object'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location, |
| | | 'name' : 'ldapsearch' |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | |
| | | </function> |
| | | |
| | | |
| | | <function name="SearchObjectNoPwd"> |
| | | <function-prolog> |
| | | This function searches the Directory Server with optional arguments possible |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <message> |
| | | 'ldapsearch%s -h %s -p %s -D "%s" %s -b "%s" "%s"' % (fileExt,dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter) |
| | | </message> |
| | | <process name="'Search Base Object No Password'"> |
| | | <location>'%s' % location </location> |
| | | <command>'%s/ldapsearch%s' % (dsBinPath,fileExt)</command> |
| | | <parms>'-h %s -p %s -D "%s" %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Search Base Object No Password', |
| | | 'command' : '%s/ldapsearch%s' % (dsBinPath,fileExt), |
| | | 'arguments' : '-h %s -p %s -D "%s" %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter), |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <function name="AnonSearchObject"> |
| | | <function-prolog> |
| | | This function searches the Directory Server anonymously with optional arguments possible |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <message> |
| | | 'ldapsearch%s -h %s -p %s %s -b "%s" "%s"' % (fileExt,dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter) |
| | | </message> |
| | | <process name="'Anonymous Search Base Object'"> |
| | | <location>'%s' % location </location> |
| | | <command>'%s/ldapsearch%s' % (dsBinPath,fileExt)</command> |
| | | <parms>'-h %s -p %s %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter)</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Anonymous Search Base Object', |
| | | 'location' : location, |
| | | 'command' : '%s/ldapsearch%s' % (dsBinPath,fileExt), |
| | | 'arguments' : '-h %s -p %s %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter) |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- ldapdelete Function With Script--> |
| | | <function name="ldapDeleteWithScript"> |
| | | <function-prolog> |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'LDAP Delete Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'LDAP Delete Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <function name="DeleteEntry"> |
| | | <function-prolog> |
| | | This function an entry in the Directory Server |
| | |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Delete Object'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Delete Object', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | |
| | | </function> |
| | | |
| | | |
| | | <!-- ldapcompare Function With Script--> |
| | | <function name="ldapCompareWithScript"> |
| | | <function-prolog> |
| | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'LDAP Compare Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'LDAP Compare Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <function name="compareEntry"> |
| | | <function-prolog> |
| | | This function compares the attribute and value an entry to the Directory Server |
| | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'Compare Object'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Compare Object', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | |
| | | </function> |
| | | |
| | | |
| | | <!-- ldappasswordmodify Function With Script--> |
| | | <function name="ldapPasswordModifyWithScript"> |
| | | <function-prolog> |
| | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | |
| | | <message> |
| | | '%s %s' % (STAFCmd, STAFCmdParams) |
| | | </message> |
| | | |
| | | <process name="'LDAP Password Modify Script'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % STAFCmd</command> |
| | | <parms>'%s' % STAFCmdParams</parms> |
| | | <workdir>'%s' % dsBinPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'LDAP Password Modify Script', |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'location' : location |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- Modify an attribute --> |
| | | <function name="modifyAnAttribute"> |
| | | <function-prolog> |
| | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | |
| | | STAFCmd='modifyAnAttribute' |
| | | |
| | | </script> |
| | | <process name="'Modify An Attribut value'"> |
| | | <location>'%s' % location</location> |
| | | <command>'java'</command> |
| | | <workdir>'%s' % TESTS_JAVA_DIR</workdir> |
| | | <parms>'%s %s' % (STAFCmd,STAFCmdParams)</parms> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s' % TESTS_JAVA_DIR] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Modify An Attribute value', |
| | | 'command' : 'java', |
| | | 'arguments' : '%s %s' % (STAFCmd,STAFCmdParams), |
| | | 'location' : location, |
| | | 'path' : TESTS_JAVA_DIR, |
| | | 'env' : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s' % TESTS_JAVA_DIR] |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | This function modifies an entry in the Directory Server |
| | | </function-prolog> |
| | | <function-map-args> |
| | | |
| | | <function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceHost" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstancePort" type="required"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceDn" type="required"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstancePswd" type="required"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="DNToAdd" type="required"> |
| | | <function-arg-description> |
| | | DN to add |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="listAttributes" type="required"> |
| | | <function-arg-description> |
| | | Attributes to add |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | expected value. Default is 0 |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | |
| | | |
| | | <!-- Build the Command --> |
| | | |
| | | # build the command |
| | | STAFCmdParamsList=[] |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | </script> |
| | | |
| | | <!-- Set common ldap arguments --> |
| | | <call function="'_ldapCommonArgs'"/> |
| | | |
| | |
| | | STAFCmdParamsList.append('-v "%s"' % anAttributeToAdd) |
| | | </script> |
| | | </iterate> |
| | | |
| | | <script> |
| | | |
| | | if DNToAdd: |
| | | STAFCmdParamsList.append('-d "%s"' % DNToAdd) |
| | | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | |
| | | STAFCmd='addAnEntry' |
| | | </script> |
| | | |
| | | |
| | | <process name="'Add a new entry'"> |
| | | <location>'%s' % location</location> |
| | | <command>'java'</command> |
| | | <workdir>'%s' % TESTS_JAVA_DIR</workdir> |
| | | <parms>'%s %s' % (STAFCmd,STAFCmdParams)</parms> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s' % TESTS_JAVA_DIR] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Add New Entry', |
| | | 'command' : 'java', |
| | | 'arguments' : '%s %s' % (STAFCmd,STAFCmdParams), |
| | | 'location' : location, |
| | | 'env' : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s' % TESTS_JAVA_DIR], |
| | | 'path' : TESTS_JAVA_DIR |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | 'result' : STAXReason, |
| | | 'expected' : expectedRC } |
| | | </call> |
| | | |
| | | <return> |
| | | STAXReason |
| | | </return> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | |
| | |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceHost" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstancePort" type="required"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstanceDn" type="required"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsInstancePswd" type="required"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="DNToModify" type="required"> |
| | | <function-arg-description> |
| | | DN to modify |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="newRDN" type="optional"> |
| | | <function-arg-description> |
| | | new rdn name : ie uid=jdoe_bis |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="deleteOldRDN" type="optional"> |
| | | <function-arg-description> |
| | | 1 : delete old rdn, 0 do not delete old rdn, default value is 1 |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0 |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="integer"/> |
| | | </function-arg-def> |
| | | |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | |
| | | |
| | | <!-- Build the Command --> |
| | | |
| | | #Build the Command |
| | | STAFCmdParamsList=[] |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | |
| | | |
| | | <!-- Set common ldap arguments --> |
| | | <call function="'_ldapCommonArgs'"/> |
| | | |
| | | <script> |
| | | |
| | | if DNToModify: |
| | | STAFCmdParamsList.append('-d "%s"' % DNToModify) |
| | | |
| | |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | |
| | | STAFCmd='modifyDn' |
| | | |
| | | </script> |
| | | <process name="'Modify DN'"> |
| | | <location>'%s' % location</location> |
| | | <command>'java'</command> |
| | | <workdir>'%s' % TESTS_JAVA_DIR</workdir> |
| | | <parms>'%s %s' % (STAFCmd,STAFCmdParams)</parms> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s' % TESTS_JAVA_DIR] |
| | | </envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Modify DN', |
| | | 'command' : 'java', |
| | | 'arguments' : '%s %s' % (STAFCmd,STAFCmdParams), |
| | | 'location' : location, |
| | | 'env' : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s' % TESTS_JAVA_DIR], |
| | | 'path' : TESTS_JAVA_DIR |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </stax> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE stax SYSTEM "../../stax.dtd"> |
| | | <!DOCTYPE stax SYSTEM "../../shared/stax.dtd"> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | |
| | | <!-- **************************************************** --> |
| | | <!-- generate a certificate --> |
| | | <!-- **************************************************** --> |
| | | |
| | | <function name="genCertificate"> |
| | | <function-prolog> |
| | | This function generates a server certificate |
| | |
| | | dsConfigPath='%s/config' % (dsPath) |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | </script> |
| | | <message>'keytool -genkey -alias %s -keyalg rsa -dname "%s" -keystore %s -storepass %s -keypass %s -storetype %s ' % (certAlias,dname,keystore,storepass,keypass,storetype)</message> |
| | | <process name="'Generate a Certificate'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-genkey -alias %s -keyalg rsa -dname "%s" -keystore %s -storepass %s -keypass %s -storetype %s ' % (certAlias,dname,keystore,storepass,keypass,storetype)</parms> |
| | | <workdir>'%s' % dsConfigPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Generate a Certificate', |
| | | 'location' : location, |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-genkey -alias %s -keyalg rsa -dname "%s" -keystore %s -storepass %s -keypass %s -storetype %s ' % (certAlias,dname,keystore,storepass,keypass,storetype), |
| | | 'path' : dsConfigPath |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode , |
| | | 'result' : STAXReason } |
| | | 'result' : STAXReason |
| | | } |
| | | </call> |
| | | <return>STAXReason</return> |
| | | </sequence> |
| | |
| | | <!-- **************************************************** --> |
| | | <!-- Self signed a certificate --> |
| | | <!-- **************************************************** --> |
| | | |
| | | <function name="SelfSignCertificate"> |
| | | <function-prolog> |
| | | This function self-signs a certificate |
| | |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | </script> |
| | | |
| | | <message>'keytool -selfcert -alias %s -keystore "%s" -keypass "%s" -storepass "%s" -storetype "%s" ' % (certAlias,keystore,keypass,storepass,storetype)</message> |
| | | <process name="'Generate a Self-Signs Server Certificate'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-selfcert -alias %s -keystore "%s" -keypass "%s" -storepass "%s" -storetype "%s" ' % (certAlias,keystore,keypass,storepass,storetype)</parms> |
| | | <workdir>'%s' % dsConfigPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'" > |
| | | { 'name' : 'Generate a Self-Signs Server Certificate', |
| | | 'location' : location, |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-selfcert -alias %s -keystore "%s" -keypass "%s" -storepass "%s" -storetype "%s" ' % (certAlias,keystore,keypass,storepass,storetype), |
| | | 'path' : dsConfigPath |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode , |
| | | 'result' : STAXReason } |
| | | 'result' : STAXReason |
| | | } |
| | | </call> |
| | | <return>STAXReason</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- **************************************************** --> |
| | | <!-- Export a certificate --> |
| | | <!-- **************************************************** --> |
| | | |
| | | <function name="ExportCertificate"> |
| | | <function-prolog> |
| | | This function exports a certificate |
| | | </function-prolog> |
| | | <function-map-args> |
| | | |
| | | <function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | |
| | | </function-map-args> |
| | | |
| | | <sequence> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | if dsPath: |
| | |
| | | STAFCmdParams='-%s' % (format) |
| | | </script> |
| | | |
| | | <message>'keytool -export -alias %s -file %s -keystore "%s" -storepass "%s" -storetype %s %s' % (certAlias,outputfile,keystore,storepass,storetype,STAFCmdParams)</message> |
| | | <process name="'Export a Certificate'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-export -alias %s -file %s -keystore "%s" -storepass "%s" -storetype %s %s' % (certAlias,outputfile,keystore,storepass,storetype,STAFCmdParams)</parms> |
| | | <workdir>'%s' % dsConfigPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Export a Certificate', |
| | | 'location' : location, |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-export -alias %s -file %s -keystore "%s" -storepass "%s" -storetype %s %s' % (certAlias,outputfile,keystore,storepass,storetype,STAFCmdParams), |
| | | 'path' : dsConfigPath |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- **************************************************** --> |
| | | <!-- Import a certificate --> |
| | | <!-- **************************************************** --> |
| | | |
| | | <function name="ImportCertificate"> |
| | | <function-prolog> |
| | | This function imports a certificate |
| | | </function-prolog> |
| | | <function-map-args> |
| | | |
| | | <function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | |
| | | if dsPath: |
| | | dsConfigPath='%s/config' % (dsPath) |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | |
| | | </script> |
| | | |
| | | <message>'keytool -import -alias %s -file %s -keystore "%s" -storepass "%s" -storetype %s -noprompt' % (certAlias,inputfile,keystore,storepass,storetype)</message> |
| | | <process name="'Import a Certificate'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>'-import -alias %s -file %s -keystore "%s" -storepass "%s" -storetype %s -noprompt' % (certAlias,inputfile,keystore,storepass,storetype)</parms> |
| | | <workdir>'%s' % dsConfigPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Import a Certificate', |
| | | 'location' : location, |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : '-import -alias %s -file %s -keystore "%s" -storepass "%s" -storetype %s -noprompt' % (certAlias,inputfile,keystore,storepass,storetype), |
| | | 'path' : dsConfigPath |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode , |
| | | 'result' : STAXReason } |
| | | 'result' : STAXReason |
| | | } |
| | | </call> |
| | | <return>STAXReason</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- **************************************************** --> |
| | | <!-- get MD5 and SHA1 values --> |
| | | <!-- **************************************************** --> |
| | | |
| | | <function name="getFingerprint"> |
| | | <function-prolog> |
| | | This function returns the fingerprint MD5 or SHA1 |
| | | </function-prolog> |
| | | <function-map-args> |
| | | |
| | | <function-arg-def name="location" type="optional" default="'%s' % STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | <!-- Local variables --> |
| | | <script> |
| | | if dsPath: |
| | | dsConfigPath='%s/config' % (dsPath) |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | |
| | | </script> |
| | | <message>' -keystore "%s" -storepass "%s" -alias "%s" -list -v' % (keystore,storepass,certAlias)</message> |
| | | <process name="'getFingerprint'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s/bin/keytool' % JAVA_HOME</command> |
| | | <parms>' -list -v -keystore "%s" -storepass "%s" -alias "%s"' % (keystore,storepass,certAlias)</parms> |
| | | <workdir>'%s' % dsConfigPath</workdir> |
| | | <envs> |
| | | ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME] |
| | | </envs> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'getFingerprint', |
| | | 'location' : location, |
| | | 'command' : '%s/bin/keytool' % JAVA_HOME, |
| | | 'arguments' : ' -list -v -keystore "%s" -storepass "%s" -alias "%s"' % (keystore,storepass,certAlias), |
| | | 'path' : dsConfigPath |
| | | } |
| | | </call> |
| | | <script> |
| | | STAXCode=RC |
| | | STAXReason=STAXResult |
| | | </script> |
| | | <call function="'checktestRC'"> |
| | | { 'returncode' : STAXCode , |
| | | 'result' : STAXReason } |
| | | 'result' : STAXReason |
| | | } |
| | | </call> |
| | | <return>STAXReason</return> |
| | | </sequence> |
| | |
| | | <!-- ################################################## --> |
| | | <!-- configure SSL --> |
| | | <!-- ################################################## --> |
| | | |
| | | |
| | | <function name="configureSSL"> |
| | | <function-prolog> |
| | | This function makes the configuration changes for SSL |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | <!--- configure Key Manager Provider --> |
| | | <message> |
| | | 'Configure Key Manager Provider' |
| | | </message> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : keystoreType, |
| | | 'optionsString' : '--set key-store-file:config/keystore --reset key-store-pin-file --set key-store-pin:%s --set enabled:true' % keystorePin, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- configure Trust Manager Provider --> |
| | |
| | | 'Configure Trust Manager Provider' |
| | | </message> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : 'Blind Trust', |
| | | 'optionsString' : '--set enabled:true' , |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!--- Enable LDAPS Connection Handler --> |
| | | <message> |
| | | 'Enabling LDAPS Connection Handler - Keystore type' |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAPS Connection Handler', |
| | | 'optionsString' : optionsString, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- ################################################## --> |
| | | <!-- configureTLS --> |
| | | <!-- ################################################## --> |
| | | |
| | | <function name="configureTLS"> |
| | | <function-prolog> |
| | | This function makes the configuration changes for startTLS |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | |
| | | <!--- configure Key Manager Provider --> |
| | | <message> |
| | | 'Configure Key Manager Provider' |
| | | </message> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : keystoreType, |
| | | 'optionsString' : '--set key-store-file:config/keystore --reset key-store-pin-file --set key-store-pin:%s --set enabled:true' % keystorePin, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- configure Trust Manager Provider --> |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : 'Blind Trust', |
| | | 'optionsString' : '--set enabled:true' , |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- Enable StartTLS --> |
| | |
| | | optionsString='%s %s %s %s' % (option1,option2,option3,option4) |
| | | </script> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAP Connection Handler', |
| | | 'optionsString' : optionsString, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | <!-- ################################################## --> |
| | | <!-- configure SSL and TLS --> |
| | | <!-- ################################################## --> |
| | | |
| | | |
| | | <function name="configureSSL_TLS"> |
| | | <function-prolog> |
| | | This function makes the configuration changes for SSL and TLS |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | |
| | | <!--- configure Key Manager Provider --> |
| | | <message> |
| | | 'Configure Key Manager Provider' |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : keystoreType, |
| | | 'optionsString' : '--set key-store-file:config/keystore --reset key-store-pin-file --set key-store-pin:%s --set enabled:true' % keystorePin, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- configure Trust Manager Provider --> |
| | |
| | | 'Configure Trust Manager Provider' |
| | | </message> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : 'Blind Trust', |
| | | 'optionsString' : '--set enabled:true' , |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAPS Connection Handler', |
| | | 'optionsString' : optionsString, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- Enable StartTLS --> |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAP Connection Handler', |
| | | 'optionsString' : optionsString, |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | |
| | | <!-- ################################################## --> |
| | | <!-- Unconfigure SSL --> |
| | | <!-- ################################################## --> |
| | | |
| | | <function name="unconfigureSSL"> |
| | | <function-prolog> |
| | | This function reverses the configuration changes for SSL |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | |
| | | |
| | | <!--- Disable LDAPS Connection Handler --> |
| | | <message> |
| | | 'Disabling LDAPS Connection Handler' |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAPS Connection Handler', |
| | | 'optionsString' : '--set enabled:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- Disable SSL Trust Manager Provider --> |
| | | <message> |
| | | 'Disabling SSL Trust Manager Provider' |
| | | </message> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : 'Blind Trust', |
| | | 'optionsString' : '--set enabled:false' , |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!--- Disable Key Manager Provider --> |
| | | <message> |
| | | 'Disabling Key Manager Provider' |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : keystoreType, |
| | | 'optionsString' : '--set enabled:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- ################################################## --> |
| | | <!-- unconfigureTLS --> |
| | | <!-- ################################################## --> |
| | | |
| | | <function name="unconfigureTLS"> |
| | | <function-prolog> |
| | | This function reverses the configuration changes for startTLS |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | |
| | | <!--- Disable StartTLS --> |
| | | <message> |
| | | 'Disabling StartTLS' |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAP Connection Handler', |
| | | 'optionsString' : ' --set allow-start-tls:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- Disable SSL Trust Manager Provider --> |
| | | <message> |
| | | 'Disabling SSL Trust Manager Provider' |
| | | </message> |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : 'Blind Trust', |
| | | 'optionsString' : '--set enabled:false' , |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!--- Disable Key Manager Provider --> |
| | | <message> |
| | | 'Disabling Key Manager Provider' |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : keystoreType, |
| | | 'optionsString' : '--set enabled:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- ################################################## --> |
| | | <!-- Unconfigure SSL and TLS --> |
| | | <!-- ################################################## --> |
| | | |
| | | <function name="unconfigureSSL_TLS"> |
| | | <function-prolog> |
| | | This function reverses the configuration changes for SSL and TLS |
| | |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | |
| | | |
| | | |
| | | <!--- Disable LDAPS Connection Handler --> |
| | | <message> |
| | | 'Disabling LDAPS Connection Handler' |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAPS Connection Handler', |
| | | 'optionsString' : '--set enabled:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!--- Disable StartTLS --> |
| | | <message> |
| | | 'Disabling StartTLS' |
| | | </message> |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'handler-name' , |
| | | 'objectName' : 'LDAP Connection Handler', |
| | | 'optionsString' : ' --set allow-start-tls:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | <!--- Disable SSL Trust Manager Provider --> |
| | |
| | | 'Disabling SSL Trust Manager Provider' |
| | | </message> |
| | | |
| | | |
| | | <call function="'dsconfig'"> |
| | | { 'location' : location , |
| | | 'dsPath' : dsPath , |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : 'Blind Trust', |
| | | 'optionsString' : '--set enabled:false' , |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!--- Disable Key Manager Provider --> |
| | | <message> |
| | | 'Disabling Key Manager Provider' |
| | |
| | | 'objectType' : 'manager-name' , |
| | | 'objectName' : keystoreType, |
| | | 'optionsString' : '--set enabled:false', |
| | | 'expectedRC' : 0 } |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | </stax> |
| | |
| | | |
| | | <!-- configure the coverage dump file --> |
| | | <script> |
| | | mylog='::coverage: begin\n' |
| | | emmaprops = '%s/%s/classes/emma.properties' % (dsDir,OPENDSNAME) |
| | | group='emma' |
| | | if CurrentTestPath['group']: |
| | | group=CurrentTestPath['group'].strip() |
| | | |
| | | if os.path.exists('%s' % emmaprops): |
| | | mylog+='::coverage: setting %s/%s.coverage to file %s\n' % (TMPDIR,group,emmaprops) |
| | | coveragefh = open(emmaprops,'w') |
| | | coveragefh.write('coverage.out.file=%s/%s.coverage\n' % (TMPDIR,group) ) |
| | | mylog="::coverage - checking for %s/lib/emma.jar\n" % dsPath |
| | | if os.path.exists('%s/lib/emma.jar' % dsPath): |
| | | mylog+=" ::coverage on\n" |
| | | if not os.path.exists('%s/coverage' % TMPDIR): |
| | | os.mkdir('%s/coverage' % TMPDIR) |
| | | mylog+=" ::mkdir %s/coverage on\n" % TMPDIR |
| | | if not os.path.exists('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group'])): |
| | | os.mkdir('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group'])) |
| | | mylog+=" ::mkdir %s/coverage/%s on\n" % (TMPDIR,CurrentTestPath['group']) |
| | | mylog+=" ::writing to %s/classes/emma.properties" % dsPath |
| | | coveragefh = open( '%s/classes/emma.properties' % dsPath, 'w' ) |
| | | coveragefh.write( 'coverage.out.file=%s/coverage/%s/coverage.ec\n' % (TMPDIR,CurrentTestPath['group']) ) |
| | | coveragefh.close() |
| | | |
| | | </script> |
| | | <message> |
| | | '%s' % mylog |
| | | </message> |
| | | |
| | | <message>mylog</message> |
| | | <!--- Set up DS --> |
| | | <message> |
| | | 'Set up DS on %s : %s/%s' % (dsHost,dsDir,OPENDSNAME) |
| | |
| | | </function-prolog> |
| | | <function-no-args /> |
| | | <sequence> |
| | | <script> |
| | | testcaseStartTime=strftime("%Y%m%d@%H:%M:%S",localtime()) |
| | | myLog = open('%s/my.log' % TMPDIR, 'a') |
| | | myLog.seek(0,2) |
| | | myLog.write('%s - starting testcase: %s\n' % (testcaseStartTime, STAXCurrentTestcase ) ) |
| | | myLog.close() |
| | | </script> |
| | | <message level="'start'">'testcase: %s' % STAXCurrentTestcase</message> |
| | | <message>'****************************************************'</message> |
| | | <message>'*** STARTING TEST CASE %s.' % STAXCurrentTestcase</message> |
| | |
| | | </function-prolog> |
| | | <function-no-args /> |
| | | <sequence> |
| | | <script> |
| | | testcaseStartTime=strftime("%Y%m%d@%H:%M:%S",localtime()) |
| | | </script> |
| | | <call function="'testCase_StartBanner'" /> |
| | | </sequence> |
| | | </function> |
| | |
| | | </call> |
| | | <script> |
| | | class Test: |
| | | def __init__(self, group, suite, fullname, start, stop, failures): |
| | | def __init__(self, group, suite, fullname, start, stop, failures, successes): |
| | | self.log='' |
| | | self.group=group |
| | | self.suite=suite |
| | |
| | | self.name=''.join(tmp) |
| | | self.duration = 0 |
| | | if failures == 0: |
| | | if successes == 0: |
| | | self.result='inconclusive' |
| | | else: |
| | | self.result='pass' |
| | | else: |
| | | self.result='fail' |
| | |
| | | return xml |
| | | |
| | | def appendLog(self, log): |
| | | self.log +=' %s<br />\n' % log |
| | | log=log.replace('<','') |
| | | log=log.replace('>','') |
| | | self.log +=' %s\n' % log |
| | | |
| | | def getName(self): |
| | | return self.name |
| | | |
| | | thisTest = Test(CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentTestcase, testcaseStartTime,testcaseEndTime,numFail) |
| | | thisTest = Test(CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentTestcase, testcaseStartTime,testcaseEndTime,numFail,numPass) |
| | | |
| | | doLog = False |
| | | testlog=open('%s/test.log' % TMPDIR,'a') |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'a') |
| | | testlog.seek(0,2) |
| | | |
| | | # loop through the log lines |
| | |
| | | |
| | | ThisGroupName=CurrentTestPath['group'] |
| | | ThisSuiteName=CurrentTestPath['suite'] |
| | | |
| | | mylog='::coverage: begin\n' |
| | | if os.path.exists('%s/classes' % dsPath): |
| | | mylog+='::coverage: setting %s/%s.coverage to file %s/classes/emma.properties\n' % (TMPDIR,CurrentTestPath['group'],dsPath) |
| | | coveragefh = open( '%s/classes/emma.properties' % dsPath, 'w' ) |
| | | coveragefh.write( 'coverage.out.file=%s/%s.coverage\n' % (TMPDIR,CurrentTestPath['group']) ) |
| | | coveragefh.close() |
| | | coveragefh = open( '%s/classes/emma.properties' % dsPath, 'r' ) |
| | | mylog+='::coverage:contents: %s' % coveragefh.read() |
| | | coveragefh.close() |
| | | |
| | | |
| | | </script> |
| | | |
| | | <!-- Start time of test suite --> |
| | |
| | | </function-prolog> |
| | | <function-no-args /> |
| | | <sequence> |
| | | |
| | | <!-- Take the values from the current test path --> |
| | | <script> |
| | | if not CurrentTestPath.has_key('group'): |
| | | CurrentTestPath['group']='unknown-group' |
| | | |
| | | ThisGroupName=CurrentTestPath['group'] |
| | | |
| | | # NOTE: the same code lives in topology.xml |
| | | # the reason for that is that the topology is created AFTER the |
| | | # first test group has started (as part of the first setup) |
| | | # the following groups are going to use the same topology |
| | | mylog="::coverage - checking for %s/lib/emma.jar\n" % dsPath |
| | | if os.path.exists('%s/lib/emma.jar' % dsPath): |
| | | mylog+=" ::coverage on\n" |
| | | if not os.path.exists('%s/coverage' % TMPDIR): |
| | | os.mkdir('%s/coverage' % TMPDIR) |
| | | mylog+=" ::mkdir %s/coverage on\n" % TMPDIR |
| | | if not os.path.exists('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group'])): |
| | | os.mkdir('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group'])) |
| | | mylog+=" ::mkdir %s/coverage/%s on\n" % (TMPDIR,CurrentTestPath['group']) |
| | | mylog+=" ::writing to %s/classes/emma.properties" % dsPath |
| | | coveragefh = open( '%s/classes/emma.properties' % dsPath, 'w' ) |
| | | coveragefh.write( 'coverage.out.file=%s/coverage/%s/coverage.ec\n' % (TMPDIR,CurrentTestPath['group']) ) |
| | | coveragefh.close() |
| | | </script> |
| | | |
| | | <message> |
| | | mylog |
| | | </message> |
| | | <message>'##### %s group preamble #####' % ThisGroupName</message> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | |
| | | ThisGroupName=CurrentTestPath['group'] |
| | | else: |
| | | ThisGroupName='unknown-group' |
| | | |
| | | coverage='N/A' |
| | | </script> |
| | | |
| | | <message>'##### %s group postamble #####' % ThisGroupName</message> |
| | | |
| | | <if expr="os.path.exists('%s/lib/emma.jar' % dsPath)"> |
| | | <sequence> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Generate coverage xml report for test group %s' % CurrentTestPath['group'], |
| | | 'command' : 'java', |
| | | 'arguments' : ' -Xms64M -Xmx512M -cp %s/lib/emma.jar emma report -r xml,html -in %s/coverage.em,%s/coverage/%s/coverage.ec -Dreport.xml.out.file=%s/coverage/%s/coverage.xml -Dreport.html.out.file=%s/coverage/%s/coverage.html -sp %s/../../../src' % (dsPath,dsPath,TMPDIR,CurrentTestPath['group'],TMPDIR,CurrentTestPath['group'],TMPDIR,CurrentTestPath['group'],TMPDIR), |
| | | 'path' : TMPDIR |
| | | } |
| | | </call> |
| | | <script> |
| | | from java.io import FileInputStream |
| | | from javax.xml.transform.stream import StreamSource |
| | | from javax.xml.transform.stream import StreamResult |
| | | from javax.xml.parsers import DocumentBuilderFactory |
| | | from org.w3c.dom import * |
| | | |
| | | factory = DocumentBuilderFactory.newInstance() |
| | | builder = factory.newDocumentBuilder() |
| | | |
| | | input = FileInputStream("%s/coverage/%s/coverage.xml" % (TMPDIR,CurrentTestPath['group'])) |
| | | document = builder.parse(input) |
| | | dom = document.getDocumentElement() |
| | | coverageNodes = dom.getElementsByTagName("all").item(0).getChildNodes() |
| | | for coverageNodeIndex in range(coverageNodes.getLength()): |
| | | thisNode = coverageNodes.item(coverageNodeIndex) |
| | | if thisNode.getNodeName() == 'coverage': |
| | | thisNodeAttributes = thisNode.getAttributes() |
| | | if thisNodeAttributes.getNamedItem("type").getNodeValue() == 'block, %': |
| | | rawCoverage = thisNodeAttributes.getNamedItem("value").getNodeValue() |
| | | coverage = rawCoverage.split('%')[0] |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'a') |
| | | testlog.seek(0,2) |
| | | testlog.write(" <group>\n") |
| | | testlog.write(" <name>\n") |
| | | testlog.write(" %s\n" % CurrentTestPath['group']) |
| | | testlog.write(" </name>\n") |
| | | testlog.write(" <coverage>\n") |
| | | testlog.write(" %s\n" % coverage) |
| | | testlog.write(" </coverage>\n") |
| | | testlog.write(" </group>\n") |
| | | testlog.close() |
| | | </script> |
| | | </sequence> |
| | | <else> |
| | | <script> |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'a') |
| | | testlog.seek(0,2) |
| | | testlog.write(" <group>\n") |
| | | testlog.write(" <name>\n") |
| | | testlog.write(" %s\n" % CurrentTestPath['group']) |
| | | testlog.write(" </name>\n") |
| | | testlog.write(" <coverage>\n") |
| | | testlog.write(" N/A\n") |
| | | testlog.write(" </coverage>\n") |
| | | testlog.write(" </group>\n") |
| | | testlog.close() |
| | | </script> |
| | | </else> |
| | | </if> |
| | | |
| | | <script> |
| | | if CurrentTestPath.has_key('group'): |
| | | del CurrentTestPath['group'] |
| | | </script> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | |
| | | the command to run |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="path" type="optional" default="'%s' % dsPath"> |
| | | <function-arg-def name="path" type="optional" default="'%s' % dsBinPath"> |
| | | <function-arg-description> |
| | | the path where the command is to be run from |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="argmunents" type="optional" default="''"> |
| | | <function-arg-def name="arguments" type="optional" default="''"> |
| | | <function-arg-description> |
| | | the path where the command is to be found |
| | | </function-arg-description> |
| | |
| | | Which machine should the command be executed on |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="name" |
| | | default="'Run a system command'" |
| | | type="optional"> |
| | | <function-arg-description> |
| | | The name to give the process (only matters in the STAX Monitor really) |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | <function-arg-def name="stripOutput" default="True" type="optional"> |
| | | <function-arg-description> |
| | | A boolean (use True or False here, case matters) to enable disable |
| | | stripping the output of a command |
| | | TODO: consider allowing passing a function name to enable custom |
| | | output manipulation (overkill?) |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="enum"> |
| | | <function-arg-property-description> |
| | | This argument can only have boolean values |
| | | </function-arg-property-description> |
| | | <function-arg-property-data type="choice" value="True"/> |
| | | <function-arg-property-data type="choice" value="False"/> |
| | | </function-arg-property> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <message> |
| | | '%s' % command |
| | | 'Running command:\n %s %s\nenv: %s\nworkdir: %s' % (command,arguments,env,path) |
| | | </message> |
| | | |
| | | <process name="'run a system command'"> |
| | | <location>'%s' % location</location> |
| | | <command>'%s' % command</command> |
| | | <parms>'%s' % arguments</parms> |
| | | <workdir>'%s' % path</workdir> |
| | | <envs> |
| | | '%s' % env |
| | | </envs> |
| | | <process name="name"> |
| | | <location>location</location> |
| | | <command>command</command> |
| | | <parms>arguments</parms> |
| | | <workdir>path</workdir> |
| | | <envs>env</envs> |
| | | <console use="'same'"/> |
| | | <stderr mode="'stdout'"/> |
| | | <returnstdout/> |
| | | </process> |
| | | <message level="'info'"> |
| | | 'Command returned:\n%s' % STAXResult[0][1] |
| | | </message> |
| | | <script> |
| | | STAXResult.replace('EMMA: collecting runtime coverage data ...\n','') |
| | | def dig(var): |
| | | try: |
| | | if var.__class__==[].__class__: |
| | | for i in range(len(var)): |
| | | var[i]=dig(var[i]) |
| | | return var |
| | | else: |
| | | if var.__class__==''.__class__: |
| | | return re.compile(r'EMMA:.*\n').sub('',var) |
| | | else: |
| | | return var |
| | | except TypeError: |
| | | return 'could not evaluate the following component: %s' % var |
| | | |
| | | if stripOutput == True: |
| | | STAXResult=dig(STAXResult) |
| | | </script> |
| | | <return> |
| | | [ RC , STAXResult ] |
| | | STAXResult |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | |
| | | </then> |
| | | </if> |
| | | </target> |
| | | <target name="run-my-tests-default-plan" depends="run-my-tests-define"> |
| | | <target name="run-my-tests-default-plan" depends="run-my-tests-define" unless="custom-suites.on"> |
| | | <delete file="${test.plan.default}"/> |
| | | <foreach list="${test.plan.list}" param="test" target="run-my-tests-default-plan-add"/> |
| | | </target> |
| | |
| | | </target> |
| | | |
| | | <target name="coverage-report" if="coverage.on"> |
| | | <delete dir="${staf.tmp.dir}/coverage" /> |
| | | <mkdir dir="${staf.tmp.dir}/coverage" /> |
| | | <delete dir="${staf.tmp.dir}/coverage/all" /> |
| | | <mkdir dir="${staf.tmp.dir}/coverage/all" /> |
| | | <emma enabled="${coverage.on}" > |
| | | <report > |
| | | <infileset dir="${staf.tmp.dir}" includes="**/*.em,**/*.coverage" /> |
| | | <infileset dir="${staf.tmp.dir}" includes="**/*.em,**/*.ec" /> |
| | | |
| | | <sourcepath> |
| | | <dirset dir="${project.home}" > |
| | |
| | | </dirset> |
| | | </sourcepath> |
| | | |
| | | <html outfile="${staf.tmp.dir}/coverage/index.html" |
| | | <html outfile="${staf.tmp.dir}/coverage/all/index.html" |
| | | columns="name, method, line" |
| | | sort="+line, +name" |
| | | metrics="line:80" |
| | |
| | | </and> |
| | | </condition> |
| | | <available file="${daily.package}" property="daily.package.downloaded"/> |
| | | |
| | | <available file="testcases/run-custom-suites.dat" property="custom-suites.on" /> |
| | | <available file="${staf.install.dir}" |
| | | type="dir" |
| | | property="staf.installed" /> |
| | |
| | | </target> |
| | | |
| | | <target name="generate-report"> |
| | | <tstamp> |
| | | <format property="tstamp.today" pattern="yyyyMMdd"/> |
| | | </tstamp> |
| | | <fileset id="resultxml" file="${tstamp.today}-*/**/reports/results.xml" /> |
| | | <delete file="${staf.tmp.dir}/my-report.html"/> |
| | | <xslt processor="trax" |
| | | in="C:\Users\arnaud\.hudson\jobs\opends-vista-functional-tests\workspace\opends\tests\functional-run\tmp\20070726-234928\Windows-x86-jvm1.5\reports\results.xml" |
| | | out="${staf.tmp.dir}/results.html" |
| | | style="shared/xsl/gen-alltests-report.xsl"> |
| | | in="${staf.tmp.dir}/tests-log.xml" |
| | | out="${staf.tmp.dir}/my-report.html" |
| | | style="shared/xsl/my-report.xsl"> |
| | | </xslt> |
| | | </target> |
| | | </project> |
| | |
| | | <call function="'testGroup_Preamble'"/> |
| | | |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | <!-- <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/aci/global_acis.xml' % (TESTS_DIR)"/> |
| | | <call function="'global_acis'" /> |
| | | |
| | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/aci/aci_effective_rights.xml' % (TESTS_DIR)"/> |
| | | <call function="'aci_effective_rights'" /> |
| | | |
| | | --> |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/aci/aci_import.xml' % (TESTS_DIR)"/> |
| | | <call function="'aci_import'" /> |
| | |
| | | CurrentTestPath={'group':'indexes','suite':'indexes'} |
| | | envAlreadyLoaded='true' |
| | | _setupSteps=['testGroup_Preamble','testSuite_Preamble','indexes_setup'] |
| | | _testSteps=['indexes_search','indexes_modify','indexes_add','indexes_remove'] |
| | | _testSteps=['indexes_search','indexes_add','indexes_remove'] |
| | | _cleanupSteps=['indexes_cleanup','testSuite_Postamble','testGroup_Postamble'] |
| | | </script> |
| | | <!--- |
| | |
| | | </block> |
| | | </function> |
| | | |
| | | <function name="indexes_vlv_add"> |
| | | <!-- |
| | | This test does a bunch of searches on the |
| | | and then verifies that it worked |
| | | #@TestMarker indexes |
| | | #@TestName indexes_remove |
| | | #@TestIssue TODO: look up the issue in issue tracker |
| | | #@TestPurpose Check if the user can remove indexes |
| | | #@TestPreamble none |
| | | #@TestStep iterate through filters prior to removing index |
| | | #@TestStep remove index |
| | | #@TestStep iterate through filters after to removing index |
| | | #@TestPostamble none |
| | | #@TestResult Success if entry are indexed as expected |
| | | --> |
| | | <block name="'Entry_Limit'"> |
| | | <sequence> |
| | | <try> |
| | | <sequence> |
| | | <call function="'loopThroughFilters'"> |
| | | { 'filters' : 'before-entry-limit' } |
| | | </call> |
| | | <call function="'runFunction'"> |
| | | { 'functionName' : 'modifyIndex' , |
| | | 'functionException' : 'LDAP.ModifyIndexException' , |
| | | 'functionFailureTC' : '%s: %s: %s' % (CurrentTestPath['group'], CurrentTestPath['suite'], STAXCurrentBlock), |
| | | 'functionMessage' : 'Modify index entry limit on attribute uid' , |
| | | 'functionArguments' : { 'operation' : 'set' , |
| | | 'indexAttribute' : 'uid' , |
| | | 'indexProperty' : 'index-entry-limit' , |
| | | 'indexPropertyValue' : '3' |
| | | } |
| | | } |
| | | </call> |
| | | <call function="'loopThroughFilters'"> |
| | | { 'filters' : 'after-entry-limit' } |
| | | </call> |
| | | </sequence> |
| | | <catch exception="'STAXException.LDAP.RemoveIndexException'"> |
| | | <message log="1" level="'fatal'">'Fatal Error: Failed to remove index for attribute l'</message> |
| | | </catch> |
| | | </try> |
| | | </sequence> |
| | | </block> |
| | | </function> |
| | | |
| | | |
| | | <function name="loopThroughFilters" scope="local"> |
| | | <function-map-args> |
| | |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | <defaultcall function="main_quickstart"/> |
| | | |
| | | <function name="main_quickstart"> |
| | | |
| | | <sequence> |
| | | |
| | | <block name="'quickstart'"> |
| | | |
| | | <sequence> |
| | | |
| | | <!--- Start DS --> |
| | | <message> |
| | | 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT) |
| | | </message> |
| | | |
| | | <call function="'StartDsWithScript'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME } |
| | | </call> |
| | | |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | |
| | | <message> |
| | | 'Quickstart: Adding quickstart entries' |
| | | </message> |
| | | |
| | | <call function="'addEntry'"> |
| | | { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST , |
| | | 'dsInstancePort' : DIRECTORY_INSTANCE_PORT , |
| | | 'dsInstanceDn' : DIRECTORY_INSTANCE_DN , |
| | | 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD , |
| | | 'entryToBeAdded' : '%s/quickstart/quickstart.ldif' % logsRemoteDataDir } |
| | | 'entryToBeAdded' : '%s/quickstart/quickstart.ldif' % logsRemoteDataDir |
| | | } |
| | | </call> |
| | | |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | | </call> |
| | | |
| | | <!--- Stop DS --> |
| | | <message> |
| | | 'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT) |
| | | </message> |
| | | |
| | | <call function="'StopDsWithScript'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'dsHost' : DIRECTORY_INSTANCE_HOST, |
| | | 'dsPort' : DIRECTORY_INSTANCE_PORT, |
| | | 'dsBindDN' : DIRECTORY_INSTANCE_DN, |
| | | 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD } |
| | | 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD |
| | | } |
| | | </call> |
| | | |
| | | <call function="'checkRC'"> |
| | | { 'returncode' : RC , |
| | | 'result' : STAXResult } |
| | | 'result' : STAXResult |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | |
| | | </block> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | </stax> |
| | |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | <defaultcall function="main" /> |
| | | |
| | | <function name="main"> |
| | | |
| | | <sequence> |
| | | |
| | | <!--- Load the environment for the test suite execution --> |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/environment.xml' % (TESTS_FUNCTIONS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" /> |
| | | <call function="'loadEnvironment'" /> |
| | | |
| | | <!-- The Functional Tests --> |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/security/security.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/security/security.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_security'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/aci/aci.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/aci/aci.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_aci'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/privileges/privileges.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/privileges/privileges.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_privileges'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/backends/backends.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/backends/backends.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_backends'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/clu/commands.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/clu/commands.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_commands'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/core/core.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/core/core.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_core'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/schema/schema.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/schema/schema.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_schema'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/replication/replication.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/replication/replication.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_replication'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/indexes/indexes.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/indexes/indexes.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'indexes'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/groups/groups.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/groups/groups.xml' % TESTS_DIR" /> |
| | | <!-- |
| | | <call function="'main_groups'" /> |
| | | --> |
| | | |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/testcases/sample/sample.xml' % (TESTS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/testcases/sample/sample.xml' % TESTS_DIR" /> |
| | | <script> |
| | | class functionToRun: |
| | | def __init__(self, name): |
| | |
| | | def getName(self): |
| | | return self.name |
| | | |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'w') |
| | | testlog.write('<qa>\n') |
| | | testlog.write(' <functional-tests>\n') |
| | | testlog.write(' <results>\n') |
| | | testlog.close() |
| | | |
| | | suitesFileName='%s/testcases/run-custom-suites.dat' % TESTS_DIR |
| | | |
| | |
| | | <iterate var="function" in="functionsToRun"> |
| | | <sequence> |
| | | <message>'calling function [%s]' % function.getName()</message> |
| | | <call function="'%s' % function.getName()" /> |
| | | <call function="function.getName()" /> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | <!-- in this section we'll compute the coverage for all the tests |
| | | if coverage is turned on |
| | | so far I could only get through this on either machines with a lot |
| | | of memory or small sets of tests |
| | | --> |
| | | <if expr="os.path.exists('%s/lib/emma.jar' % dsPath)"> |
| | | <sequence> |
| | | <script> |
| | | coverageFiles='' |
| | | for group in os.listdir('%s/coverage/' % TMPDIR): |
| | | coverageFiles+='%s/coverage/%s/coverage.ec' % (TMPDIR,group) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Generate global coverage xml report', |
| | | 'command' : 'java', |
| | | 'arguments' : ' -Xms64M -Xmx1024M -cp %s/lib/emma.jar emma report -r xml,html -in %s/coverage.em,%s -Dreport.xml.out.file=%s/coverage/coverage.xml -Dreport.html.out.file=%s/coverage/coverage.html -sp %s/../../../src' % (dsPath,dsPath,coverageFiles,TMPDIR,TMPDIR,TMPDIR), |
| | | 'path' : TMPDIR |
| | | } |
| | | </call> |
| | | <script> |
| | | from java.io import FileInputStream |
| | | from javax.xml.transform.stream import StreamSource |
| | | from javax.xml.transform.stream import StreamResult |
| | | from javax.xml.parsers import DocumentBuilderFactory |
| | | from org.w3c.dom import * |
| | | |
| | | factory = DocumentBuilderFactory.newInstance() |
| | | builder = factory.newDocumentBuilder() |
| | | |
| | | input = FileInputStream("%s/coverage/coverage.xml" % TMPDIR) |
| | | document = builder.parse(input) |
| | | dom = document.getDocumentElement() |
| | | coverageNodes = dom.getElementsByTagName("all").item(0).getChildNodes() |
| | | for coverageNodeIndex in range(coverageNodes.getLength()): |
| | | thisNode = coverageNodes.item(coverageNodeIndex) |
| | | if thisNode.getNodeName() == 'coverage': |
| | | thisNodeAttributes = thisNode.getAttributes() |
| | | if thisNodeAttributes.getNamedItem("type").getNodeValue() == 'block, %': |
| | | rawCoverage = thisNodeAttributes.getNamedItem("value").getNodeValue() |
| | | coverage = rawCoverage.split('%')[0] |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'a') |
| | | testlog.seek(0,2) |
| | | testlog.write(" <all>\n") |
| | | testlog.write(" <coverage>\n") |
| | | testlog.write(" %s\n" % coverage) |
| | | testlog.write(" </coverage>\n") |
| | | testlog.write(" </all>\n") |
| | | testlog.close() |
| | | </script> |
| | | </sequence> |
| | | <else> |
| | | <script> |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'a') |
| | | testlog.seek(0,2) |
| | | testlog.write(" <all>\n") |
| | | testlog.write(" <coverage>\n") |
| | | testlog.write(" N/A\n") |
| | | testlog.write(" </coverage>\n") |
| | | testlog.write(" </all>\n") |
| | | testlog.close() |
| | | </script> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- here goes the section where we get the product's info --> |
| | | <call function="'GetVar'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'type' : 'shared', |
| | | 'variable' : 'Job%s_ServerInfo' % STAXJobID |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC != 0"> |
| | | <script> |
| | | STAFResult='{}' |
| | | </script> |
| | | </if> |
| | | |
| | | <!-- Build the Servers Information Dictionary --> |
| | | <script> |
| | | ServersInfoDict=eval(STAFResult) |
| | | |
| | | ServerVersion='unknown' |
| | | ServerBuildId='unknown' |
| | | ServerJavaVersion='unknown' |
| | | ServerJavaVendor='unknown' |
| | | ServerJVMVersion='unknown' |
| | | ServerJVMVendor='unknown' |
| | | ServerSystemOS='unknown' |
| | | ServerSystemName='unknown' |
| | | ServerSvnRevision='unknown' |
| | | |
| | | if ServersInfoDict.has_key('%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)): |
| | | ServerInfoDict=ServersInfoDict['%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)] |
| | | |
| | | ServerInfoKey='server version' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerVersion=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='server buildid' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerBuildId=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='java version' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerJavaVersion=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='java vendor' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerJavaVendor=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='jvm version' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerJVMVersion=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='jvm vendor' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerJVMVendor=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='system os' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerSystemOS=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='system name' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerSystemName=ServerInfoDict[ServerInfoKey] |
| | | |
| | | ServerInfoKey='svn revision' |
| | | if ServerInfoDict.has_key(ServerInfoKey): |
| | | ServerSvnRevision=ServerInfoDict[ServerInfoKey] |
| | | |
| | | else: |
| | | ServerInfoDict='No key found (%s/%s)' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) |
| | | |
| | | testlog=open('%s/tests-log.xml' % TMPDIR,'a') |
| | | testlog.seek(0,2) |
| | | testlog.write(' </results>\n') |
| | | testlog.write(' <identification>\n') |
| | | testlog.write(' <version>\n') |
| | | testlog.write(' %s\n' % ServerVersion) |
| | | testlog.write(' </version>\n') |
| | | testlog.write(' <buildid>\n') |
| | | testlog.write(' %s\n' % ServerBuildId) |
| | | testlog.write(' </buildid>\n') |
| | | testlog.write(' <revision>\n') |
| | | testlog.write(' %s\n' % ServerSvnRevision) |
| | | testlog.write(' </revision>\n') |
| | | testlog.write(' <platform>\n') |
| | | testlog.write(' %s\n' % ServerSystemOS) |
| | | testlog.write(' </platform>\n') |
| | | testlog.write(' <jvm-version>\n') |
| | | testlog.write(' %s\n' % ServerJVMVersion) |
| | | testlog.write(' </jvm-version>\n') |
| | | testlog.write(' <jvm-vendor>\n') |
| | | testlog.write(' %s\n' % ServerJVMVendor) |
| | | testlog.write(' </jvm-vendor>\n') |
| | | testlog.write(' </identification>\n') |
| | | testlog.write(' </functional-tests>\n') |
| | | testlog.write('</qa>\n') |
| | | testlog.close() |
| | | </script> |
| | | </sequence> |
| | | </function> |
| | | </stax> |
| | | |
| | |
| | | ! --> |
| | | |
| | | <stax> |
| | | |
| | | <defaultcall function="start_job"/> |
| | | |
| | | <function name="start_job"> |
| | | |
| | | <sequence> |
| | | |
| | | <script> |
| | | STAXLogMessage = 1 |
| | | </script> |
| | |
| | | </if> |
| | | |
| | | <!--- Import required shared xml libraries --> |
| | | <import machine="'%s' % (STAF_LOCAL_HOSTNAME)" |
| | | file="'%s/stafcmd.xml' % (TESTS_FUNCTIONS_DIR)" /> |
| | | <import machine="STAF_LOCAL_HOSTNAME" |
| | | file="'%s/stafcmd.xml' % TESTS_FUNCTIONS_DIR" /> |
| | | |
| | | <!-- |
| | | dirty workaround because utils.xml now depends on environment.xml |
| | |
| | | <call function="'GetVar'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'type' : 'shared', |
| | | 'variable' : 'Job%s_ServerInfo' % STAXSubJobID } |
| | | 'variable' : 'Job%s_ServerInfo' % STAXSubJobID |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC != 0"> |
| | |
| | | <call function="'GetVar'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'type' : 'shared', |
| | | 'variable' : 'Job%s_LogsDir' % STAXSubJobID } |
| | | 'variable' : 'Job%s_LogsDir' % STAXSubJobID |
| | | } |
| | | </call> |
| | | |
| | | <if expr="RC == 0"> |
| | |
| | | statusValueDict={} |
| | | |
| | | if level == 'Start': |
| | | |
| | | tcpattern=re.compile("(Testcase): (.*)") |
| | | tcmatch = tcpattern.search(message) |
| | | |
| | | if tcmatch: |
| | | tctype=tcmatch.group(1) |
| | | tcname=tcmatch.group(2) |
| | | |
| | | if testDict.has_key(tcname): |
| | | |
| | | for key in testDict[tcname].keys(): |
| | | value=testDict[tcname][key] |
| | | startValueDict[key]=value |
| | |
| | | tctype=tcmatch.group(1) |
| | | tcname=tcmatch.group(2) |
| | | tctime=tcmatch.group(3) |
| | | |
| | | if testDict.has_key(tcname): |
| | | |
| | | for key in testDict[tcname].keys(): |
| | | value=testDict[tcname][key] |
| | | stopValueDict[key]=value |
| | |
| | | |
| | | source = StreamSource(FileInputStream("%s" % xmlfile)) |
| | | result = StreamResult(FileOutputStream("%s" % htmlfile)) |
| | | |
| | | # the original report |
| | | transformer.transform(source, result) |
| | | |
| | | #the new report transformation |
| | | TransformerFactory.newInstance().newTemplates(StreamSource(FileInputStream("%s/xsl/my-report.xsl" % TESTS_SHARED_DIR))).newTransformer().transform(StreamSource(FileInputStream("%s/tests-log.xml" % TMPDIR)), StreamResult(FileOutputStream("%s/my-report.html" % TMPDIR))) |
| | | </script> |
| | | |
| | | <if expr="SEND_MAIL_AFTER_TEST_RUN == 'TRUE'"> |
| | | |
| | | <sequence> |
| | | |
| | | <message> |
| | | 'Sending Email Test Report to %s.' % SEND_MAIL_TO |
| | | </message> |
| | |
| | | </message> |
| | | </else> |
| | | </if> |
| | | |
| | | </sequence> |
| | | |
| | | </if> |
| | | |
| | | <!-- fixMe: Copy the html results file to TMPDIR for Hudson --> |
| | | <call function="'copyFile'"> |
| | | { 'srcfile' : htmlfile, |
| | | 'destfile' : '%s/results.html' % (TMPDIR) } |
| | | 'destfile' : '%s/results.html' % TMPDIR |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | </stax> |
| | |
| | | <function name="sample"> |
| | | <sequence> |
| | | <script> |
| | | CurrentTestPath={ 'group' : 'sample', 'suite' : 'sample' } |
| | | CurrentTestPath['group']= 'sample' |
| | | envAlreadyLoaded='true' |
| | | </script> |
| | | |
| | |
| | | <!-- this is an example of how to loop through a list of functions to |
| | | run instead of duplicating calls |
| | | --> |
| | | <iterate in="['testGroup_Preamble','testSuite_Preamble','sample_setup','sample_test']" var="testStep"> |
| | | <sequence> |
| | | <iterate in="['testGroup_Preamble','testSuite_Preamble','sample_setup']" var="setupStep"> |
| | | <!-- the sequence tag is superfluous here since there is only a |
| | | single instruction to execute within the iterate block |
| | | --> |
| | | <call function="'%s' % setupStep" /> |
| | | </iterate> |
| | | <iterate in="['passing_test']" var="testStep"> |
| | | <!-- the sequence tag is superfluous here since there is only a |
| | | single instruction to execute within the iterate block |
| | | --> |
| | | <call function="'%s' % testStep" /> |
| | | </iterate> |
| | | </sequence> |
| | | <catch exception="'STAFException.Topology.CreationException'"> |
| | | <!-- it is a good idea to make sure that the messages getting |
| | | sent to the gui also make their way in the logs for easier |
| | |
| | | #@TestPostamble none |
| | | #@TestResult Success if OpenDS returns 0 |
| | | --> |
| | | <testcase name="'%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentFunction)"> |
| | | <block name="'sample_test'"> |
| | | <sequence> |
| | | <script> |
| | | CurrentTestPath['suite']= 'search' |
| | | </script> |
| | | <testcase name="'%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentBlock)"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'" /> |
| | | <call function="'SearchObject'"> |
| | |
| | | <call function="'testCase_Postamble'" /> |
| | | </sequence> |
| | | </testcase> |
| | | </sequence> |
| | | </block> |
| | | </function> |
| | | |
| | | <!-- the dummy failing test --> |
| | | <function name="failing_test"> |
| | | <!--- |
| | | Place test-specific test information here. |
| | | The tag, TestMarker, must be the same as the tag, TestSuiteName. |
| | | #@TestMarker Sample |
| | | #@TestName failing_test |
| | | #@TestIssue xyz |
| | | #@TestPurpose Illustrate how to issue a query on OpenDS |
| | | #@TestPreamble none |
| | | #@TestStep Fetch all the entries in the server |
| | | #@TestPostamble none |
| | | #@TestResult Success if OpenDS returns 0 |
| | | --> |
| | | <block name="'failing_test'"> |
| | | <sequence> |
| | | <script> |
| | | CurrentTestPath['suite']= 'dummy' |
| | | </script> |
| | | <testcase name="'%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentBlock)"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'" /> |
| | | <tcstatus result="'fail'" /> |
| | | <call function="'testCase_Postamble'" /> |
| | | </sequence> |
| | | </testcase> |
| | | </sequence> |
| | | </block> |
| | | </function> |
| | | |
| | | <!-- the dummy passing test --> |
| | | <function name="passing_test"> |
| | | <!--- |
| | | Place test-specific test information here. |
| | | The tag, TestMarker, must be the same as the tag, TestSuiteName. |
| | | #@TestMarker Sample |
| | | #@TestName passing_test |
| | | #@TestIssue xyz |
| | | #@TestPurpose Illustrate how to issue a query on OpenDS |
| | | #@TestPreamble none |
| | | #@TestStep Fetch all the entries in the server |
| | | #@TestPostamble none |
| | | #@TestResult Success if OpenDS returns 0 |
| | | --> |
| | | <block name="'passing_test'"> |
| | | <sequence> |
| | | <script> |
| | | CurrentTestPath['suite']= 'dummy' |
| | | </script> |
| | | <testcase name="'%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],STAXCurrentBlock)"> |
| | | <sequence> |
| | | <call function="'testCase_Preamble'" /> |
| | | <tcstatus result="'pass'" /> |
| | | <call function="'testCase_Postamble'" /> |
| | | </sequence> |
| | | </testcase> |
| | | </sequence> |
| | | </block> |
| | | </function> |
| | | |
| | | <!-- Setup the instance for sample test --> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!DOCTYPE stax SYSTEM "../../shared/stax.dtd"> |
| | | <!DOCTYPE stax SYSTEM "../../../shared/stax.dtd"> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | |
| | | ! Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | ! --> |
| | | <stax> |
| | | |
| | | <defaultcall function="main_security"/> |
| | | |
| | | <function name="main_security"> |
| | | |
| | | <sequence> |
| | | |
| | | <block name="'security'"> |
| | | |
| | | <sequence> |
| | | |
| | | <script> |
| | | CurrentTestPath['group']='security' |
| | | </script> |
| | |
| | | <call function="'testGroup_Postamble'"/> |
| | | |
| | | </sequence> |
| | | |
| | | </block> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | </stax> |