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

Christophe Sovant
19.53.2008 8a2e109ceb3c6f6053b845d43ce74f284b8766ca
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