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

Christophe Sovant
19.53.2008 8a2e109ceb3c6f6053b845d43ce74f284b8766ca
Fix SNMP tests compilation issue on Windows
6 files modified
59 ■■■■■ changed files
opends/tests/shared/functions/dsconfig.xml 4 ●●●● patch | view | raw | blame | history
opends/tests/shared/functions/environment.xml 12 ●●●● patch | view | raw | blame | history
opends/tests/shared/functions/snmp.xml 6 ●●●● patch | view | raw | blame | history
opends/tests/shared/functions/topology.xml 2 ●●● patch | view | raw | blame | history
opends/tests/shared/functions/utils.xml 12 ●●●● patch | view | raw | blame | history
opends/tests/shared/python/common.py 23 ●●●●● patch | view | raw | blame | history
opends/tests/shared/functions/dsconfig.xml
@@ -1019,7 +1019,7 @@
        
        if aciValue:
            aciValue=aciValue.replace('"','\\"')
            if isWindows:
            if is_windows_platform(mylocation):
                aciValue=aciValue.replace(r'||',r'"||"')
        
        STAFCmdParamsList=[]
@@ -2140,5 +2140,5 @@
        STAXResult
      </return>
    </sequence>
  </function>
  </function>
</stax>
opends/tests/shared/functions/environment.xml
@@ -123,20 +123,12 @@
  </function-prolog>
    
    <sequence>
      <!-- Resolve any OS related variables -->
      <call function="'getOSvariables'">
        { 'hostname' : STAF_REMOTE_HOSTNAME }
      </call>
      <!-- fixMe: this needs some cleanup -->
      <script>
        STAXLogMessage = 1 
        OPENDS_BINPATH ='%s/%s/bin' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
        OSName= STAXResult
        winPattern=re.compile('win', re.IGNORECASE)
        isWindows=winPattern.search(OSName)
        if isWindows:
        OPENDS_BINPATH ='%s/%s/bin' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
        if is_windows_platform(STAF_REMOTE_HOSTNAME):
          fileExt='.bat'
          fileFolder='bat'
          pathSeparator=';'
opends/tests/shared/functions/snmp.xml
@@ -154,7 +154,7 @@
        snmpPath = '%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
        cp = 'CLASSPATH=%s/%s:%s/jdmkrt.jar:.' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE, snmpPath)
        
        if isWindows:
        if is_windows_platform(location):
          cp = cp.replace(':', ';')
        
        env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp] 
@@ -311,7 +311,7 @@
        snmpPath = '%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
        cp = 'CLASSPATH=%s/%s:%s/jdmkrt.jar:.' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE, snmpPath)
        
        if isWindows:
        if is_windows_platform(location):
          cp = cp.replace(':', ';')
        
        env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp] 
@@ -422,7 +422,7 @@
        cp = 'CLASSPATH=%s/%s:%s/jdmkrt.jar:%s:.' \
        % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE, snmpPath, jstaf_jarfile)
        
        if isWindows:
        if is_windows_platform(location):
          cp = cp.replace(':', ';')
        
        env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp] 
opends/tests/shared/functions/topology.xml
@@ -638,7 +638,7 @@
      </call>
      
      <!-- fixMe: Windows Services are not enabled -->
      <if expr="isWindows">
      <if expr="is_windows_platform(dsHost)">
        <script>
          enableWindowsService=''
        </script>
opends/tests/shared/functions/utils.xml
@@ -1486,7 +1486,7 @@
        _id = '%s#%d' % (strftime('%Y-%m-%d %H:%M:%S',localtime()),random.randint(0,999))
        
        if not env:
          if isWindows:
          if is_windows_platform(location):
            env=['PATH=C:\Windows;C:\Windows\system32;%s' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
          else:
            env=['PATH=/bin:/usr/bin:%s' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
@@ -1613,7 +1613,7 @@
      </call>
                                
      <script>
        if isWindows:
        if is_windows_platform(location):
          _cmd = 'tskill'
          _args = STAXResult
        else:
@@ -2029,10 +2029,10 @@
          cp = 'CLASSPATH=%s:.' % classpath
        else:
          cp = 'CLASSPATH=.'
        if isWindows:
        if is_windows_platform(location):
          cp = cp.replace(':', ';')
        if location == STAXServiceMachine:
          cmd = '%s/bin/javac' % local_java_home
          env = ['%s' % cp]        
@@ -2040,7 +2040,7 @@
          cmd = '%s/bin/javac' % JAVA_HOME
          env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp]          
      </script>
      <call function="'listFolderByExtension'" >
        { 
        'location'   : location ,
opends/tests/shared/python/common.py
@@ -29,7 +29,13 @@
# $Source$
# public symbols
__all__ = [ "format_testcase", "directory_server_information", "test_time", "report_generation", "compare_file", "exception_thrown" ]
__all__ = [ "format_testcase",
            "directory_server_information",
            "test_time",
            "report_generation",
            "compare_file",
            "is_windows_platform",
            "exception_thrown" ]
class format_testcase:
  'Format the Test name objects'
@@ -171,3 +177,18 @@
      return ret_str
    finally:
      diff_file.close()
def is_windows_platform(host):
    from java.lang import Boolean
    from com.ibm.staf import STAFHandle
    from com.ibm.staf import STAFResult
    import re
    handle = STAFHandle("varHandle")
    res = handle.submit2(host, "VAR", "GET SYSTEM VAR STAF/Config/OS/Name")
    winPattern=re.compile('win', re.IGNORECASE)
    if (winPattern.search(res.result) != None):
      return Boolean.TRUE
    else:
      return Boolean.FALSE