From dd79922fa9ae87d347fec2a6abc48835e52cdc8d Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Thu, 24 May 2007 08:21:45 +0000
Subject: [PATCH] Fix Issue 1498 test report should show build number and date (2)

---
 opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml         |    6 +-
 opendj-sdk/opends/tests/functional-tests/shared/functions/baselib.xml     |    2 
 opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml |  126 +++++++++++++++++++++++++++++++-----------
 3 files changed, 97 insertions(+), 37 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/baselib.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/baselib.xml
index fbf9ca4..fc435a0 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/baselib.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/baselib.xml
@@ -55,7 +55,7 @@
         DSInfo=directory_server_information()
       </script>
 
-      <message>'Get Information about server %s' % dsPath</message>
+      <message>'Get Information about server %s %s' % (mylocation,dsPath)</message>
 
       <!-- Obtain the variables for the system from start-ds -->          
       <call function="'StartDsWithScript'">
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml
index 0ed4b94..d1370cc 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/environment.xml
@@ -155,40 +155,100 @@
     <function-prolog>
       This function gets information about the Directory Server  
     </function-prolog>
-    
-    <sequence>
-    
-      <!-- Install DS into temporary folder -->
-      <message>
-        'Extract temporary DS zip archive to %s.' % (TMPDIR)
-      </message>
-      <call function="'unZipFile'">
-        { 'location' : STAF_LOCAL_HOSTNAME, 
-          'zipfile'  : '%s/%s' % (ZIPPATH,ZIPNAME), 
-          'unzipdir' : '%s' % TMPDIR }
-      </call>
-                
-      <!-- Get Directory Server Variables -->
-      <call function="'GetDirectoryServerVars'">
-        { 'location'  : STAF_LOCAL_HOSTNAME,
-          'dsPath'    : '%s/%s' % (TMPDIR,OPENDSNAME)  }
-      </call>
 
-      <!-- Set Directory Server Variables -->
-      <call function="'SetVar'">
-        { 'location'  : STAF_LOCAL_HOSTNAME,
-          'type'      : 'shared',
-          'variable'  : 'ServerInfo=%s' % DSInfoServersDict }
-      </call>
-      
-      <!-- Uninstall DS from temporary folder -->
-      <message>'Remove temporary DS zip archive'</message>
-      <call function="'deleteFolder'">
-        { 'location'   : STAF_LOCAL_HOSTNAME ,
-          'foldername' : '%s/%s' % (TMPDIR,OPENDSNAME) }
-      </call> 
-      
-    </sequence>
+     <try>
+         
+      <sequence>
+        
+        <script>
+          InstanceInstallDir= '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
+        </script>
+            
+        <!-- Copy DS zip archive to remote host-->
+        <message>
+          'Copy DS zip archive to %s %s.zip.' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
+        </message>
+        <call function="'copyFile'">
+          { 'srcfile'    : '%s/%s' % (ZIPPATH,ZIPNAME),
+            'destfile'   : '%s.zip' % InstanceInstallDir,
+            'remotehost' : STAF_REMOTE_HOSTNAME }
+        </call>
+
+        <if expr="RC != 0">
+          <return>RC</return>
+        </if>
+                        
+        <!-- Install DS into temporary folder -->
+        <message>
+          'Extract temporary DS zip archive to %s %s.' % (STAF_REMOTE_HOSTNAME,DIRECTORY_INSTANCE_DIR)
+        </message>
+        <call function="'unZipFile'">
+          { 'location' : STAF_REMOTE_HOSTNAME, 
+            'zipfile'  : '%s.zip' % InstanceInstallDir, 
+            'unzipdir' : '%s' % DIRECTORY_INSTANCE_DIR }
+        </call>
+
+        <if expr="RC != 0">
+          <return>RC</return>
+        </if>
+                                
+        <!-- Get Directory Server Variables -->
+        <call function="'GetDirectoryServerVars'">
+          { 'location'  : STAF_REMOTE_HOSTNAME,
+            'dsPath'    : '%s' % InstanceInstallDir  }
+        </call>
+
+        <if expr="RC != 0">
+          <throw exception="'TestExceptionResultFailed'">
+            'Invalid Result %s' % RC
+          </throw>
+        </if>
+                
+        <!-- Set Directory Server Variables -->
+        <call function="'SetVar'">
+          { 'location'  : STAF_REMOTE_HOSTNAME,
+            'type'      : 'shared',
+            'variable'  : 'ServerInfo=%s' % DSInfoServersDict }
+        </call>
+
+        <if expr="RC != 0">
+          <throw exception="'TestExceptionResultFailed'">
+            'Invalid Result %s' % RC
+          </throw>
+        </if>
+                      
+        <!-- Uninstall DS from temporary folder -->
+        <message>
+          'Remove temporary DS zip archive from %s %s' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
+        </message>
+        
+        <call function="'deleteFolder'">
+          { 'location'   : STAF_REMOTE_HOSTNAME ,
+            'foldername' : '%s' % InstanceInstallDir }
+        </call>
+        
+        <call function="'deleteFile'">
+          { 'location'   : STAF_REMOTE_HOSTNAME ,
+            'foldername' : '%s.zip' % InstanceInstallDir }
+        </call>
+                  
+      </sequence>
+
+    <catch exception="'TestExceptionResultFailed'" typevar="eType" var="eInfo">
+      <sequence>
+        <message>'caught %s with %s' % (eType,eInfo)</message>
+        <message>
+          'Remove temporary DS zip archive from %s %s' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
+        </message>
+        <call function="'deleteFolder'">
+          { 'location'   : STAF_REMOTE_HOSTNAME ,
+            'foldername' : '%s' % InstanceInstallDir }
+        </call> 
+      </sequence>
+    </catch>
+
+    </try>
+        
   </function>
 	
 	
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml b/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml
index 3899b66..4f3bee8 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/runTestJob.xml
@@ -91,8 +91,8 @@
         ServerSystemName='unknown'
         ServerSvnRevision='unknown'
                   
-        if ServersInfoDict.has_key('%s/%s' % (TMPDIR,OPENDSNAME)):       
-          ServerInfoDict=ServersInfoDict['%s/%s' % (TMPDIR,OPENDSNAME)]
+        if ServersInfoDict.has_key('%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)):       
+          ServerInfoDict=ServersInfoDict['%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)]
           
           ServerInfoKey='server version'
           if ServerInfoDict.has_key(ServerInfoKey):
@@ -131,7 +131,7 @@
             ServerSvnRevision=ServerInfoDict[ServerInfoKey]  
                                                                                                 
         else:
-          ServerInfoDict='No key found (%s/%s)' % (TMPDIR,OPENDSNAME)
+          ServerInfoDict='No key found (%s/%s)' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
                     
       </script>
       

--
Gitblit v1.10.0