ensure tests can be run remotely
| | |
| | | logsTestDataDir='%s/testdata' % logsDir |
| | | logsTempDir='%s/temp' % logsDir |
| | | |
| | | relativeDataDir='shared/data' |
| | | relativeSharedDir='shared' |
| | | relativeJavaDir='%s/java' % relativeSharedDir |
| | | relativeDataDir='%s/data' % relativeSharedDir |
| | | logsLocalDataDir='%s/%s' % (logsTestDataDir,relativeDataDir) |
| | | logsRemoteDataDir='%s/%s' % (DIRECTORY_INSTANCE_DIR,relativeDataDir) |
| | | logsRemoteDataDir='%s/%s' % (DIRECTORY_INSTANCE_DIR,relativeDataDir) |
| | | </script> |
| | | |
| | | <message> |
| | |
| | | This function performs an ldapmodify using the script |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" type="optional" default="STAXServiceMachine"> |
| | | <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | |
| | | This function performs an ldapsearch using the script |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" type="optional" default="STAXServiceMachine"> |
| | | <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | |
| | | This function performs an ldapdelete using the script |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" type="optional" default="STAXServiceMachine"> |
| | | <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | |
| | | This function performs an ldapcompare using the script |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" type="optional" default="STAXServiceMachine"> |
| | | <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | |
| | | This function performs an ldappasswordmodify using the script |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" type="optional" default="STAXServiceMachine"> |
| | | <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | |
| | | '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] |
| | | 'path' : '%s/../%s' % (dsPath,relativeJavaDir), |
| | | 'env' : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)] |
| | | } |
| | | </call> |
| | | <script> |
| | |
| | | '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 |
| | | 'env' : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)], |
| | | 'path' : '%s/../%s' % (dsPath,relativeJavaDir) |
| | | } |
| | | </call> |
| | | <script> |
| | |
| | | '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 |
| | | 'env' : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)], |
| | | 'path' : '%s/../%s' % (dsPath,relativeJavaDir) |
| | | } |
| | | </call> |
| | | <script> |
| | |
| | | </call> |
| | | |
| | | <return>cmdRC</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | </sequence> |
| | | |
| | | </function> |
| | | |
| | | <function name="getFile"> |
| | | <function-prolog> |
| | | This function get the contents of a file |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" type="optional" default="STAXServiceMachine"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="filename" type="required"> |
| | | <function-arg-description> |
| | | The name of the file |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filename"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="type" type="optional" default="'text'"> |
| | | <function-arg-description> |
| | | The type of the file |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | <function-arg-def name="format" type="optional" default="'native'"> |
| | | <function-arg-description> |
| | | The format of the file |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string"/> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <stafcmd name="'STAF Command: Get File'"> |
| | | <location>'%s' % location</location> |
| | | <service>'fs'</service> |
| | | <request> |
| | | 'GET FILE %s %s FORMAT %s' % (filename,type,format) |
| | | </request> |
| | | </stafcmd> |
| | | <script> |
| | | cmdRC=RC |
| | | cmdResult=STAFResult |
| | | </script> |
| | | <return>[cmdRC,cmdResult]</return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | </stax> |
| | |
| | | <!-- If the test data is already created then don't redo it --> |
| | | <if expr="RC == 48"> |
| | | <sequence> |
| | | |
| | | <!-- Locally copy static data files to temporary staging area --> |
| | | <!-- LDIF (.ldif) test data files --> |
| | | <message> |
| | |
| | | 'extension' : 'ldif' |
| | | } |
| | | </call> |
| | | |
| | | <!-- LDIF (.ldif) files for quickinstall --> |
| | | <script> |
| | | quickStartGroupDir='%s/%s/quickstart' % (TESTS_DIR,relativeDataDir) |
| | |
| | | 'extension' : 'gz' |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <!-- Archive java (.class) files --> |
| | | <script> |
| | | javaSharedDir='%s' % (TESTS_JAVA_DIR) |
| | | javaLocalDir='%s/shared/java' % (logsTestDataDir) |
| | | </script> |
| | | <message> |
| | | 'Copy java class files locally to %s.' % javaLocalDir |
| | | </message> |
| | | <call function="'CopyFolderByExtension'"> |
| | | { 'location' : STAXServiceMachine, |
| | | 'srcfolder' : javaSharedDir, |
| | | 'destfolder' : javaLocalDir, |
| | | 'extension' : 'class' |
| | | } |
| | | </call> |
| | | |
| | | <!-- Delete the any existing testdata archive --> |
| | | <message> |
| | | 'Delete %s/testdata.zip' % logsTempDir |
| | |
| | | |
| | | <!-- Zip up contents of tests directory --> |
| | | <message> |
| | | 'Zip up local data directory %s/testdata.zip' % logsTempDir |
| | | 'Zip up local data directory to %s/testdata.zip' % logsTempDir |
| | | </message> |
| | | <call function="'zipUpFile'"> |
| | | { 'location' : STAXServiceMachine, |
| | |
| | | </call> |
| | | |
| | | <message> |
| | | 'Zip up local quickstart directory %s/testdata.zip' % logsTempDir |
| | | 'Zip up local quickstart directory to %s/testdata.zip' % logsTempDir |
| | | </message> |
| | | <call function="'zipUpFile'"> |
| | | { 'location' : STAXServiceMachine, |
| | |
| | | 'relativeto' : logsTestDataDir |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Zip up local java class files to %s/testdata.zip' % logsTempDir |
| | | </message> |
| | | <call function="'zipUpFile'"> |
| | | { 'location' : STAXServiceMachine, |
| | | 'zipfile' : '%s/testdata.zip' % logsTempDir , |
| | | 'folder' : '%s' % javaLocalDir , |
| | | 'relativeto' : logsTestDataDir |
| | | } |
| | | </call> |
| | | |
| | | </sequence> |
| | | <else> |
| | | <message> |
| | |
| | | <script> |
| | | SERVER_KEYPASS="servercert" |
| | | SERVER_STOREPASS="servercert" |
| | | CERT_TMP="%s/../%s/CERT_%s" % (dsPath,relativeDataDir,DIRECTORY_INSTANCE_PORT) |
| | | CERT_TMP="%s/CERT_%s" % (logsRemoteDataDir,DIRECTORY_INSTANCE_PORT) |
| | | CLIENT_KEYSTORE="%s/keystore" % (CERT_TMP) |
| | | CLIENT_KEYPASS="password" |
| | | CLIENT_STOREPASS="password" |
| | |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'filename' : USER_1_CERT_FILE_RFC |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Certificate contents:\n %s' % cmdResult |
| | | </message> |
| | | |
| | | <!-- Extract BEGIN CERTIFICATE and END CERTIFICATE --> |
| | | <script> |
| | | cert_file = open(USER_1_CERT_FILE_RFC,"r") |
| | | certList=STAXResult[1].split('\n') |
| | | ret_str = "" |
| | | for line in cert_file.readlines(): |
| | | for line in certList: |
| | | index_cert = line.find("CERTIFICATE") |
| | | if index_cert == -1: |
| | | ret_str+=line.strip() |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | listAttr = [] |
| | | listAttr.append('dn: %s' % USER_1_DN) |
| | | listAttr.append('changetype: modify') |
| | |
| | | 'expectedRC' : 0 |
| | | } |
| | | </call> |
| | | |
| | | |
| | | <call function="'getFile'"> |
| | | { 'location' : STAF_REMOTE_HOSTNAME, |
| | | 'filename' : USER_2_CERT_FILE_RFC |
| | | } |
| | | </call> |
| | | |
| | | <message> |
| | | 'Certificate contents:\n %s' % cmdResult |
| | | </message> |
| | | |
| | | <!-- Extract BEGIN CERTIFICATE and END CERTIFICATE --> |
| | | <script> |
| | | cert_file = open(USER_2_CERT_FILE_RFC,"r") |
| | | certList=STAXResult[1].split('\n') |
| | | ret_str = "" |
| | | for line in cert_file.readlines(): |
| | | for line in certList: |
| | | index_cert = line.find("CERTIFICATE") |
| | | if index_cert == -1: |
| | | ret_str+=line.strip() |