From a3f86f69131204838ca54ab89f7add92044cf1fc Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Fri, 04 Apr 2008 09:53:41 +0000
Subject: [PATCH] update following previous commit,Build Client in unique directory, avoid conflict if same client is run several time at the same time
---
opends/tests/system-tests/clients/searchLoad/searchLoad.xml | 37 +++++-------------
opends/tests/system-tests/clients/searchLoad/build.ksh | 4 +
opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml | 36 +++++-------------
opends/tests/system-tests/clients/modifyLoad/build.ksh | 4 +
4 files changed, 27 insertions(+), 54 deletions(-)
diff --git a/opends/tests/system-tests/clients/modifyLoad/build.ksh b/opends/tests/system-tests/clients/modifyLoad/build.ksh
index 80cef92..eaa101e 100755
--- a/opends/tests/system-tests/clients/modifyLoad/build.ksh
+++ b/opends/tests/system-tests/clients/modifyLoad/build.ksh
@@ -27,10 +27,12 @@
export CLASSPATH=$CLASSPATH:../LDAPjdk/ldapjdk.jar
+mkdir -p $COMPILDIR
echo "Compiling classes..."
-javac src/*.java -d .
+javac src/*.java -d $COMPILDIR
[ $? -ne 0 ] && return 1
echo "Creating jarfile"
+cd $COMPILDIR
jar cvf modify.jar *.class
[ $? -ne 0 ] && return 1
echo "Cleanup"
diff --git a/opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml b/opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml
index 55b2f55..48169bb 100755
--- a/opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml
+++ b/opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml
@@ -62,7 +62,10 @@
<!-- get the ldap instance parameters -->
<script>
- outFile = '%s/client_modifyLoad_%s.txt' % (LOG_DIR,client.getId())
+ compilDir = '%s/%s_%s' % (workingDir,client.getHost(),client.getId())
+
+ outFile = '%s/client_modifyLoad_id%s.txt' % \
+ (client.getLogDir(),client.getId())
cParams = client.getParams()
serverInstanceFromClient = cParams[0][1]
baseDn = cParams[1][1]
@@ -142,7 +145,8 @@
</script>
<call function="'writeEndTagOperation'">{'fileFd' : fileFd}</call>
- <!-- ==== build client : run build.ksh file ==== -->
+
+ <!-- ==== Build client : run build.ksh file ==== -->
<call function="'writeStartTagOperation'">
{ 'tagName' : 'build',
'fileFd' : fileFd }
@@ -152,13 +156,14 @@
'fileFd' : fileFd}
</call>
-
+ <!-- Build Client in unique directory (compilDir), avoid -->
+ <!-- conflict if same client is run several time at the same time -->
<process name="'%s: build %s' % (client.getHost(),client.getName())">
<location>client.getHost()</location>
<command mode="'shell'">'./build.ksh'</command>
<parms/>
<workdir>workingDir</workdir>
- <envs>['PATH=%s:/bin:/usr/bin' % JAVA_HOME]</envs>
+ <envs>['PATH=%s:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir]</envs>
<stderr mode="'stdout'"/>
<stdout/>
<returnstdout/>
@@ -197,8 +202,7 @@
cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' \
% (cParam,LOCAL_TESTS_DIR)
- cParam = '%s:%s/clients/searchLoad/search.jar' \
- % (cParam,LOCAL_TESTS_DIR)
+ cParam = '%s:%s/modify.jar' % (cParam,compilDir)
cParam = '%s Client %s' % (cParam,parms)
titleName = '%s: run %s on %s' % \
@@ -254,26 +258,6 @@
</call>
- <!-- ==== Copy output file in main log directory ==== -->
- <script>
- clientHostFullName = '%s%s' % (client.getHost(),DOMAIN[0])
- </script>
- <if expr="clientHostFullName != STAXServiceMachine">
- <sequence>
- <call function="'copyFile'">
- {
- 'location' : client.getHost(),
- 'remoteHost' : STAXServiceMachine,
- 'srcFile' : outFile,
- 'destFile' : outFile,
- 'fileFd' : fileFd
- }
- </call>
- <script>
- errNum += STAXResult[0]
- </script>
- </sequence>
- </if>
</sequence>
</else>
</if>
diff --git a/opends/tests/system-tests/clients/searchLoad/build.ksh b/opends/tests/system-tests/clients/searchLoad/build.ksh
index 8e53100..6acf64c 100755
--- a/opends/tests/system-tests/clients/searchLoad/build.ksh
+++ b/opends/tests/system-tests/clients/searchLoad/build.ksh
@@ -26,10 +26,12 @@
# Copyright 2008 Sun Microsystems, Inc.
export CLASSPATH=$CLASSPATH:../LDAPjdk/ldapjdk.jar
+mkdir -p $COMPILDIR
echo "Compiling classes..."
-javac src/*.java -d .
+javac src/*.java -d $COMPILDIR
[ $? -ne 0 ] && return 1
echo "Creating jarfile"
+cd $COMPILDIR
jar cvf search.jar *.class
[ $? -ne 0 ] && return 1
echo "Cleanup"
diff --git a/opends/tests/system-tests/clients/searchLoad/searchLoad.xml b/opends/tests/system-tests/clients/searchLoad/searchLoad.xml
index b706e94..0f5f7ed 100755
--- a/opends/tests/system-tests/clients/searchLoad/searchLoad.xml
+++ b/opends/tests/system-tests/clients/searchLoad/searchLoad.xml
@@ -62,7 +62,10 @@
<!-- get the ldap instance parameters -->
<script>
- outFile = '%s/client_searchLoad_%s.txt' % (LOG_DIR,client.getId())
+ compilDir = '%s/%s_%s' % (workingDir,client.getHost(),client.getId())
+
+ outFile = '%s/client_searchLoad_id%s.txt' % \
+ (client.getLogDir(),client.getId())
cParams = client.getParams()
serverInstanceFromClient = cParams[0][1]
baseDn = cParams[1][1]
@@ -79,7 +82,7 @@
else:
# remove sec, try to finish before timer kill -9 the client
- duration = duration - 10
+ duration = duration - 20
parms=[]
parms.append('-h %s -p %s' % \
@@ -142,7 +145,8 @@
</script>
<call function="'writeEndTagOperation'">{'fileFd' : fileFd}</call>
- <!-- ==== build client : run build.ksh file ==== -->
+
+ <!-- ==== Build client : run build.ksh file ==== -->
<call function="'writeStartTagOperation'">
{ 'tagName' : 'build',
'fileFd' : fileFd }
@@ -152,13 +156,14 @@
'fileFd' : fileFd}
</call>
-
+ <!-- Build Client in unique directory (compilDir), avoid -->
+ <!-- conflict if same client is run several time at the same time -->
<process name="'%s: build %s' % (client.getHost(),client.getName())">
<location>client.getHost()</location>
<command mode="'shell'">'./build.ksh'</command>
<parms/>
<workdir>workingDir</workdir>
- <envs>['PATH=%s:/bin:/usr/bin' % JAVA_HOME]</envs>
+ <envs>['PATH=%s:/bin:/usr/bin' % JAVA_HOME,'COMPILDIR=%s' % compilDir ]</envs>
<stderr mode="'stdout'"/>
<stdout/>
<returnstdout/>
@@ -196,7 +201,7 @@
cParam = '-client -Xmx1G -Xms1G'
cParam = '%s -XX:NewRatio=1 -XX:SurvivorRatio=100' % cParam
cParam = '%s -cp %s/clients/LDAPjdk/ldapjdk.jar' % (cParam,LOCAL_TESTS_DIR)
- cParam = '%s:%s/clients/searchLoad/search.jar' % (cParam,LOCAL_TESTS_DIR)
+ cParam = '%s:%s/search.jar' % (cParam,compilDir)
cParam = '%s Client %s' % (cParam,parms)
titleName = '%s: run %s on %s' % \
@@ -249,26 +254,6 @@
'fileFd' : fileFd}
</call>
- <!-- ==== Copy output file in main log directory ==== -->
- <script>
- clientHostFullName = '%s%s' % (client.getHost(),DOMAIN[0])
- </script>
- <if expr="clientHostFullName != STAXServiceMachine">
- <sequence>
- <call function="'copyFile'">
- {
- 'location' : client.getHost(),
- 'remoteHost' : STAXServiceMachine,
- 'srcFile' : outFile,
- 'destFile' : outFile,
- 'fileFd' : fileFd
- }
- </call>
- <script>
- errNum += STAXResult[0]
- </script>
- </sequence>
- </if>
</sequence>
</else>
</if>
--
Gitblit v1.10.0