mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gary_williams
23.08.2007 9b244c38a4f11614de7eea6e0e18a73910a131d1
ensure tests can be run remotely
6 files modified
155 ■■■■ changed files
opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/shared/functions/stafcmd.xml 53 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/shared/functions/topology.xml 36 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/testcases/security/client_auth/client_auth_lib.xml 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml 36 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml
@@ -286,9 +286,11 @@
        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>
opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml
@@ -146,7 +146,7 @@
      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>
@@ -623,7 +623,7 @@
      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>
@@ -1436,7 +1436,7 @@
      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>
@@ -1876,7 +1876,7 @@
      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>
@@ -2346,7 +2346,7 @@
      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>
@@ -2748,8 +2748,8 @@
          '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>
@@ -2858,8 +2858,8 @@
          '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>
@@ -2977,8 +2977,8 @@
          '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>
opendj-sdk/opends/tests/functional-tests/shared/functions/stafcmd.xml
@@ -671,7 +671,54 @@
      </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>
opendj-sdk/opends/tests/functional-tests/shared/functions/topology.xml
@@ -161,6 +161,7 @@
      <!-- 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>
@@ -173,6 +174,7 @@
              'extension'  : 'ldif'
            }
          </call>
          <!-- LDIF (.ldif) files for quickinstall -->
          <script>
            quickStartGroupDir='%s/%s/quickstart' % (TESTS_DIR,relativeDataDir)
@@ -212,7 +214,23 @@
              '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
@@ -225,7 +243,7 @@
          
          <!--  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,
@@ -236,7 +254,7 @@
          </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,
@@ -245,6 +263,18 @@
              '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>
opendj-sdk/opends/tests/functional-tests/testcases/security/client_auth/client_auth_lib.xml
@@ -42,7 +42,7 @@
    <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"    
opendj-sdk/opends/tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml
@@ -370,16 +370,28 @@
              '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')
@@ -444,12 +456,22 @@
              '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()