From ab8b4361421cb3e9b625677ae13d58a0399ebf8f Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Thu, 30 Oct 2008 17:12:12 +0000
Subject: [PATCH] Issue 851: log archiving, reporting and results collection fix

---
 opends/tests/staf-tests/shared/tests/runTestJob.xml |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/opends/tests/staf-tests/shared/tests/runTestJob.xml b/opends/tests/staf-tests/shared/tests/runTestJob.xml
index 614eb5f..8be924a 100644
--- a/opends/tests/staf-tests/shared/tests/runTestJob.xml
+++ b/opends/tests/staf-tests/shared/tests/runTestJob.xml
@@ -425,6 +425,11 @@
         except IOError:
           errorfh.write('Error: Unable to open %s. Reason IOError.' % textfile )
 
+      </script>
+
+      <message>'Starting to create results XML file.'</message>
+      
+      <script>
         # Create the objects
         localstaf =test_env.staf(STAF_LOCAL_HOSTNAME)
         remotestaf=test_env.staf(STAF_REMOTE_HOSTNAME)
@@ -577,13 +582,19 @@
         # Create the results elements and attributes
         for tcname in testCaseList:
 
+          print 'Processing %s' % tcname
+
           if testDict.has_key(tcname):
             tcnamesplit=tcname.split(":")
             if tcnamesplit[0]:
               tcgroup=tcnamesplit[0].strip()
               if tcnamesplit[1]:
                 tcsuite=tcnamesplit[1].strip()
-                tcsuiteshort=tcsuite.split(".")[2].strip()
+                try:
+                  tcsuiteshort=tcsuite.split(".")[2].strip()
+                except:
+                  print 'Default test suite short name to %s.' % tcsuite
+                  tcsuiteshort=tcsuite
               else:
                 tcsuite=tcgroup
               if tcnamesplit[2]:
@@ -759,7 +770,11 @@
 
               if os.path.isfile(testSuiteFile):            
                 testSuiteName=os.path.basename(testSuiteFile.replace('-log.xml',''))
-                testSuiteShortName=testSuiteName.split('.')[2]
+                try:
+                  testSuiteShortName=testSuiteName.split('.')[2]
+                except:
+                  print 'Default test suite short name to %s.' % testSuiteName
+                  testSuiteShortName=testSuiteName
 
                 print 'suite= %s' %  testSuiteName
                 

--
Gitblit v1.10.0