From bf5a9c2381cff5c9e1a4f6d260455e9bb07ae7c5 Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Thu, 26 Apr 2007 12:24:37 +0000
Subject: [PATCH] Fix Issue 1399 align tests to use bat folder on windows

---
 opendj-sdk/opends/tests/functional-tests/testcases/runFuncTests.xml |    8 +-
 opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml  |   47 ++++++++-------
 opendj-sdk/opends/tests/functional-tests/shared/functions/dsadm.xml |   66 ++++++++++++----------
 3 files changed, 66 insertions(+), 55 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/dsadm.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/dsadm.xml
index 956a6c0..fee9f68 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/dsadm.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/dsadm.xml
@@ -91,7 +91,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/configure-ds%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/configure-ds%s' % (dsBinPath,fileExt)
                   
         if dsPort:
           STAFCmdParamsList.append('-p %s' % dsPort)
@@ -122,9 +123,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
@@ -189,7 +190,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/start-ds%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/start-ds%s' % (dsBinPath,fileExt)
                   
         if dsVersion:
           STAFCmdParamsList.append('-v')
@@ -214,9 +216,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
@@ -380,7 +382,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/stop-ds%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/stop-ds%s' % (dsBinPath,fileExt)
                   
         if dsHost:
           STAFCmdParamsList.append('-h %s' % dsHost)
@@ -453,9 +456,9 @@
         <location>'%s' % (location)</location>
         <command>'%s' % (STAFCmd)</command>
         <parms>'%s' % (STAFCmdParams)</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -600,15 +603,15 @@
     
     <sequence>
       <message>
-        'import-ldif%s -l %s -n %s %s' % (fileExt,ldifFile,backEnd,extraParams)
+        '%s/import-ldif%s -l %s -n %s %s' % (dsBinPath,fileExt,ldifFile,backEnd,extraParams)
       </message>
       <process name="'Offline Import'">
         <location>'%s' % location </location>
-        <command>'%s/bin/import-ldif%s' % (dsPath,fileExt)</command>
+        <command>'%s/import-ldif%s' % (dsBinPath,fileExt)</command>
         <parms>'-l %s -n %s %s' % (ldifFile,backEnd,extraParams)</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -773,7 +776,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/import-ldif%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/import-ldif%s' % (dsBinPath,fileExt)
 
         if dsLdifFile:
           STAFCmdParamsList.append('-l %s' % dsLdifFile)
@@ -843,9 +847,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>         
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -1315,11 +1319,11 @@
       </message>
       <process name="'Ldif Export'">
         <location>'%s' % location </location>
-        <command>'%s/bin/export-ldif%s' % (dsPath,fileExt)</command>
+        <command>'%s/export-ldif%s' % (dsBinPath,fileExt)</command>
         <parms>'-l %s -n %s %s' % (ldifFile,backEnd,extraParams)</parms>
         <workdir>'%s/bin' % dsPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -1597,11 +1601,11 @@
       </message>
       <process name="'Offline Backup'">
         <location>'%s' % mylocation </location>
-        <command>'%s/bin/backup%s' % (dsPath,fileExt)</command>
+        <command>'%s/backup%s' % (dsBinPath,fileExt)</command>
         <parms>'-d %s -n %s %s' % (backupDir,backEnd,extraParams)</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-              ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+              ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -1842,11 +1846,11 @@
       </message>
       <process name="'Offline restore'">
         <location>'%s' % mylocation </location>
-        <command>'%s/bin/restore%s' % (dsPath,fileExt)</command>
+        <command>'%s/restore%s' % (dsBinPath,fileExt)</command>
         <parms>'-d %s %s' % (backupDir,extraParams)</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -2201,7 +2205,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapmodify%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapmodify%s' % (dsBinPath,fileExt)
 
         STAFCmdParamsList.append('-a')
 
@@ -2229,9 +2234,9 @@
         <location>'%s' % mylocation</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stdin>'%s' % dsTaskLdif</stdin>
         <stderr mode="'stdout'"/>
@@ -2308,7 +2313,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapsearch%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapsearch%s' % (dsBinPath,fileExt)
 
         if dsHost:
           STAFCmdParamsList.append('-h %s' % dsHost)
@@ -2355,9 +2361,9 @@
             <location>'%s' % mylocation</location>
             <command>'%s' % STAFCmd</command>
             <parms>'%s' % STAFCmdParams</parms>
-            <workdir>'%s/bin' % dsPath</workdir>
+            <workdir>'%s' % dsBinPath</workdir>
             <envs>
-              ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+              ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
             </envs>
             <stderr mode="'stdout'"/>
             <returnstdout/>
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml
index 050f19b..9218d15 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/ldap.xml
@@ -93,7 +93,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapmodify%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapmodify%s' % (dsBinPath,fileExt)
           
         STAFCmdParamsList.append('-a')
       </script>
@@ -119,9 +120,9 @@
         <location>'%s' % mylocation</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
@@ -204,7 +205,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapmodify%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapmodify%s' % (dsBinPath,fileExt)
 
       </script>
 
@@ -229,9 +231,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
@@ -332,7 +334,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapsearch%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapsearch%s' % (dsBinPath,fileExt)
 
       </script>
 
@@ -366,9 +369,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
@@ -451,11 +454,11 @@
       </message>
       <process name="'Search Base Object No Password'">
         <location>'%s' % location </location>
-        <command>'%s/bin/ldapsearch%s' % (dsPath,fileExt)</command>
+        <command>'%s/ldapsearch%s' % (dsBinPath,fileExt)</command>
         <parms>'-h %s -p %s -D "%s" %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter)</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -517,11 +520,11 @@
       </message>
       <process name="'Anonymous Search Base Object'">
         <location>'%s' % location </location>
-        <command>'%s/bin/ldapsearch%s' % (dsPath,fileExt)</command>
+        <command>'%s/ldapsearch%s' % (dsBinPath,fileExt)</command>
         <parms>'-h %s -p %s %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter)</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <stderr mode="'stdout'"/>
         <returnstdout/>
@@ -597,7 +600,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapdelete%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapdelete%s' % (dsBinPath,fileExt)
           
       </script>
 
@@ -622,9 +626,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
@@ -713,7 +717,8 @@
         STAFCmdParams=''
 
         if dsPath:
-          STAFCmd='%s/bin/ldapcompare%s' % (dsPath,fileExt)
+          dsBinPath='%s/%s' % (dsPath,fileFolder) 
+          STAFCmd='%s/ldapcompare%s' % (dsBinPath,fileExt)
           
       </script>
 
@@ -740,9 +745,9 @@
         <location>'%s' % location</location>
         <command>'%s' % STAFCmd</command>
         <parms>'%s' % STAFCmdParams</parms>
-        <workdir>'%s/bin' % dsPath</workdir>
+        <workdir>'%s' % dsBinPath</workdir>
         <envs>
-          ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME]
+          ['PATH=/bin:/usr/bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
         </envs>
         <console use="'same'"/>
         <stderr mode="'stdout'"/>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/runFuncTests.xml b/opendj-sdk/opends/tests/functional-tests/testcases/runFuncTests.xml
index 03a9b5a..4723887 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/runFuncTests.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/runFuncTests.xml
@@ -80,15 +80,17 @@
         STAXLogMessage = 1 
         LogDir='%s' % TMPDIR
         SRCFILE = '%s/%s' % (ZIPPATH,ZIPNAME) 
-        DSTFILE = '%s/%s' % (TMPDIR,ZIPNAME) 
-        OPENDS_BINPATH = '%s/%s/bin' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) 
+        DSTFILE = '%s/%s' % (TMPDIR,ZIPNAME)
+        OPENDS_BINPATH ='%s/%s/bin' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) 
         OSName= STAXResult
         winPattern=re.compile('win', re.IGNORECASE)
         isWindows=winPattern.search(OSName)
         if isWindows:
           fileExt='.bat'
+          fileFolder='bat'
         else:
           fileExt=''
+          fileFolder='bin'
       </script>
       
       <!-- Load in the local shared python objects from libraries -->
@@ -135,8 +137,6 @@
       <call function="'main_schema'" />
 		
       <if expr="not isWindows">
-	  <!-- Do not execute Synchronization Test Suite as long as dynamic configuration 
-		  is not supported. ('dd' not supported in Windows.  see 'configureSynchronization' -->
 	  <sequence>		
 	  <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
         file="'%s/testcases/synchronization/synchronization.xml' % (TESTS_DIR)" />

--
Gitblit v1.10.0