From 8a2e109ceb3c6f6053b845d43ce74f284b8766ca Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Mon, 19 May 2008 17:53:33 +0000
Subject: [PATCH] Fix SNMP tests compilation issue on Windows

---
 opends/tests/shared/python/common.py |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/opends/tests/shared/python/common.py b/opends/tests/shared/python/common.py
index 7d97eba..30f4861 100644
--- a/opends/tests/shared/python/common.py
+++ b/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

--
Gitblit v1.10.0