From 62bd02edbff24b487e49bbb47e93fe06a7ffb160 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Tue, 20 May 2008 18:23:45 +0000
Subject: [PATCH] Fix SNMP tests execution issue on Windows
---
opends/tests/shared/functions/snmp.xml | 33 ++++++++++++++++-----------------
opends/tests/shared/functions/topology.xml | 9 ++++++---
opends/tests/shared/functions/utils.xml | 5 +----
3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/opends/tests/shared/functions/snmp.xml b/opends/tests/shared/functions/snmp.xml
index c36aa6d..39f75f5 100755
--- a/opends/tests/shared/functions/snmp.xml
+++ b/opends/tests/shared/functions/snmp.xml
@@ -151,11 +151,11 @@
STAFCmd='SNMPGet'
- snmpPath = '%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
- cp = 'CLASSPATH=%s/%s:%s/jdmkrt.jar:.' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE, snmpPath)
-
- if is_windows_platform(location):
- cp = cp.replace(':', ';')
+ opends_jarfile='%s/%s' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE)
+ snmpPath='%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
+ jdmk_jarfile='%s/jdmkrt.jar' % snmpPath
+ cp = 'CLASSPATH=%s%s%s%s.' \
+ % (opends_jarfile,pathSeparator,jdmk_jarfile,pathSeparator)
env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp]
</script>
@@ -308,11 +308,11 @@
STAFCmd='SNMPSet'
- snmpPath = '%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
- cp = 'CLASSPATH=%s/%s:%s/jdmkrt.jar:.' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE, snmpPath)
-
- if is_windows_platform(location):
- cp = cp.replace(':', ';')
+ opends_jarfile='%s/%s' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE)
+ snmpPath='%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
+ jdmk_jarfile='%s/jdmkrt.jar' % snmpPath
+ cp = 'CLASSPATH=%s%s%s%s.' \
+ % (opends_jarfile,pathSeparator,jdmk_jarfile,pathSeparator)
env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp]
</script>
@@ -417,13 +417,12 @@
STAFCmdParams=' '.join(STAFCmdParamsList)
STAFCmd='SNMPTrapListener'
-
- snmpPath = '%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
- cp = 'CLASSPATH=%s/%s:%s/jdmkrt.jar:%s:.' \
- % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE, snmpPath, jstaf_jarfile)
-
- if is_windows_platform(location):
- cp = cp.replace(':', ';')
+
+ opends_jarfile='%s/%s' % (DIRECTORY_INSTANCE_DIR,SNMP_OPENDS_JARFILE)
+ snmpPath='%s/%s/snmp' % (DIRECTORY_INSTANCE_DIR, relativeJavaDir)
+ jdmk_jarfile='%s/jdmkrt.jar' % snmpPath
+ cp = 'CLASSPATH=%s%s%s%s%s%s.' \
+ % (opends_jarfile,pathSeparator,jdmk_jarfile,pathSeparator,jstaf_jarfile,pathSeparator)
env = ['JAVA_HOME=%s' % JAVA_HOME, '%s' % cp]
</script>
diff --git a/opends/tests/shared/functions/topology.xml b/opends/tests/shared/functions/topology.xml
index a4bfee0..e92311d 100755
--- a/opends/tests/shared/functions/topology.xml
+++ b/opends/tests/shared/functions/topology.xml
@@ -378,19 +378,22 @@
'name' : 'STAF/Config/STAFRoot'
}
</call>
- <script>jstaf_jarfile = '%s/lib/JSTAF.jar' % STAFResult</script>
+ <script>jstaf_jarfile='%s/lib/JSTAF.jar' % STAFResult</script>
<!--- Compile snmp java files on controler host -->
<message>
'Compile Java files under %s on %s' \
% (javaLocalDir, STAXServiceMachine)
</message>
+ <script>
+ opends_jarfile='%s/%s' % (TMPDIR,SNMP_OPENDS_JARFILE)
+ </script>
<call function="'compileJava'" >
{
'location' : STAXServiceMachine,
'foldername' : javaLocalDir,
- 'classpath' : '%s/%s:%s:%s' \
- % (TMPDIR,SNMP_OPENDS_JARFILE, SNMP_OPENDMK_JARFILE, jstaf_jarfile)
+ 'classpath' : '%s%s%s%s%s' \
+ % (opends_jarfile,pathSeparator,SNMP_OPENDMK_JARFILE,pathSeparator,jstaf_jarfile)
}
</call>
diff --git a/opends/tests/shared/functions/utils.xml b/opends/tests/shared/functions/utils.xml
index b0846dd..498b878 100755
--- a/opends/tests/shared/functions/utils.xml
+++ b/opends/tests/shared/functions/utils.xml
@@ -2026,12 +2026,9 @@
<!-- Build the command -->
<script>
if classpath:
- cp = 'CLASSPATH=%s:.' % classpath
+ cp = 'CLASSPATH=%s%s.' % (classpath, pathSeparator)
else:
cp = 'CLASSPATH=.'
-
- if is_windows_platform(location):
- cp = cp.replace(':', ';')
if location == STAXServiceMachine:
cmd = '%s/bin/javac' % local_java_home
--
Gitblit v1.10.0