From 1431a1338d3cc7d3da342459a546e922760039e1 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Fri, 11 Sep 2009 17:28:19 +0000
Subject: [PATCH] Add PRODUCTNAME variable in config.py

---
 opends/tests/staf-tests/shared/python/common.py                              |    4 +-
 opends/tests/staf-tests/shared/xsl/gen-suites-report.xsl                     |    5 +-
 opends/tests/staf-tests/functional-tests/testcases/setup/import.xml          |   10 ++++-
 opends/tests/staf-tests/shared/tests/config.py.stubs                         |    1 
 opends/tests/staf-tests/shared/functions/baselib.xml                         |    4 +-
 opends/tests/staf-tests/shared/ant/staf.xml                                  |    7 ---
 opends/tests/staf-tests/shared/xsl/gen-groups-report.xsl                     |    5 +-
 opends/tests/staf-tests/shared/xsl/gen-tests-report.xsl                      |    5 +-
 opends/tests/staf-tests/functional-tests/testcases/setup/general_options.xml |    6 +-
 opends/tests/staf-tests/shared/ant/build.properties                          |    2 +
 opends/tests/staf-tests/shared/tests/runTestJob.xml                          |    2 
 opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml   |    6 +-
 opends/tests/staf-tests/shared/xsl/gen-alltests-report.xsl                   |    5 +-
 opends/tests/staf-tests/shared/xsl/id.xsl                                    |    5 +-
 14 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/opends/tests/staf-tests/functional-tests/testcases/setup/general_options.xml b/opends/tests/staf-tests/functional-tests/testcases/setup/general_options.xml
index e30027b..cc0fa57 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/setup/general_options.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/setup/general_options.xml
@@ -23,7 +23,7 @@
  !
  ! CDDL HEADER END
  !
- !      Copyright 2008 Sun Microsystems, Inc.
+ !      Copyright 2008-2009 Sun Microsystems, Inc.
  ! -->
 <stax>
   
@@ -96,7 +96,7 @@
           <call function="'grep'">
             { 'location'  : STAF_REMOTE_HOSTNAME,
               'filename'  : grepFile,
-              'testString': 'OpenDS Directory Server'
+              'testString': PRODUCTNAME
             }
           </call>
 
@@ -125,7 +125,7 @@
           <call function="'grep'">
             { 'location'  : STAF_REMOTE_HOSTNAME,
               'filename'  : grepFile,
-              'testString': 'OpenDS Directory Server'
+              'testString': PRODUCTNAME
             }
           </call>
 
diff --git a/opends/tests/staf-tests/functional-tests/testcases/setup/import.xml b/opends/tests/staf-tests/functional-tests/testcases/setup/import.xml
index 51ee963..c0145b7 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/setup/import.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/setup/import.xml
@@ -23,7 +23,7 @@
  !
  ! CDDL HEADER END
  !
- !      Copyright 2008 Sun Microsystems, Inc.
+ !      Copyright 2008-2009 Sun Microsystems, Inc.
  ! -->
 <stax>
   
@@ -494,10 +494,16 @@
             }
           </call>
 
+          <script>
+            if PRODUCTNAME.startswith('OpenDS'):
+              expectedNb = 1
+            else:
+              expectedNb = 2
+          </script>
           <call function="'checktestRC'">
             { 'returncode' : nb,
               'result'     : a,
-              'expected'   : 1
+              'expected'   : expectedNb
             }
           </call>
 
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml
index f005d26..281e9c5 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml
@@ -23,7 +23,7 @@
  !
  ! CDDL HEADER END
  !
- !      Copyright 2008 Sun Microsystems, Inc.
+ !      Copyright 2008-2009 Sun Microsystems, Inc.
  ! -->
 <stax>
 
@@ -196,8 +196,8 @@
                   dsVersion='unknown'
                   dsBuild='unknown'
 
-                dsServer = 'OpenDS Directory Server %s - %s' \
-                           % (dsVersion.rstrip(), dsBuild)
+                dsServer = '%s %s - %s' \
+                           % (PRODUCTNAME, dsVersion.rstrip(), dsBuild)
 
                 dsServerType = DEFAULT_VALUES['dsServerType.1']
               </script>
diff --git a/opends/tests/staf-tests/shared/ant/build.properties b/opends/tests/staf-tests/shared/ant/build.properties
index 5f73466..12dfcb7 100644
--- a/opends/tests/staf-tests/shared/ant/build.properties
+++ b/opends/tests/staf-tests/shared/ant/build.properties
@@ -107,6 +107,8 @@
 test.plan.functional.default=aci,backends,clu,clu_secure,core,dsconfig,dsml,groups,i18n,indexes,logging,monitoring,plugins,privileges,replication,schema,security,setup,snmp,tasks,virtualAttributes
 test.plan.stress.default=ldap_operation,import_ldif
 verbose.mode=false
+
+product.name=OpenDS Directory Server
 logs.uri=file://
 tests.os.string=${os.name}
 tests.jvm.string=${java.version}(${sun.arch.data.model} bits)
diff --git a/opends/tests/staf-tests/shared/ant/staf.xml b/opends/tests/staf-tests/shared/ant/staf.xml
index c0a61a7..e5a68bf 100644
--- a/opends/tests/staf-tests/shared/ant/staf.xml
+++ b/opends/tests/staf-tests/shared/ant/staf.xml
@@ -130,13 +130,6 @@
       </sequential>
     </for>
 
-    <!-- Add DSML service extension -->
-    <mkdir dir="${staf.install.dir}/DSML"/>
-    <copy todir="${staf.install.dir}/DSML">
-      <fileset dir="${basedir}/../staf-tests/shared/dsml"
-               includes="dsmlService.jar"/>
-    </copy>
-
     <delete includeemptydirs="true">
       <fileset dir="${tmp.dir}" includes="**/*"/>
     </delete>
diff --git a/opends/tests/staf-tests/shared/functions/baselib.xml b/opends/tests/staf-tests/shared/functions/baselib.xml
index 8fd2ac1..5dcd55e 100755
--- a/opends/tests/staf-tests/shared/functions/baselib.xml
+++ b/opends/tests/staf-tests/shared/functions/baselib.xml
@@ -23,7 +23,7 @@
  !
  ! CDDL HEADER END
  !
- !      Copyright 2007-2008 Sun Microsystems, Inc.
+ !      Copyright 2007-2009 Sun Microsystems, Inc.
  ! -->
 <stax>
   <function name="GetDirectoryServerVars">
@@ -74,7 +74,7 @@
             <script>
               DSInfo.SystemList=STAXResult[0][1].split('\n')
               DSInfo.ServerDict['server version']= \
-              DSInfo.getServerVersion(DSInfo.SystemList[0])
+              DSInfo.getServerVersion(DSInfo.SystemList[0],PRODUCTNAME)
               
               for DSInfo.line in DSInfo.SystemList:
                 DSInfo.key=DSInfo.line[0:DSInfo.line.find(':')].strip()
diff --git a/opends/tests/staf-tests/shared/python/common.py b/opends/tests/staf-tests/shared/python/common.py
index cea23b4..9421c7b 100644
--- a/opends/tests/staf-tests/shared/python/common.py
+++ b/opends/tests/staf-tests/shared/python/common.py
@@ -75,8 +75,8 @@
     self.ServerDict={}
     self.SystemDict={}
 
-  def getServerVersion(self,string):
-    return string.replace("OpenDS Directory Server ","")
+  def getServerVersion(self,string,productname):
+    return string.replace("%s " % productname,"")
 
   def getServerBuildId(self,string):
     return string.replace("Build ","")
diff --git a/opends/tests/staf-tests/shared/tests/config.py.stubs b/opends/tests/staf-tests/shared/tests/config.py.stubs
index 47b27d4..c9b5e5a 100644
--- a/opends/tests/staf-tests/shared/tests/config.py.stubs
+++ b/opends/tests/staf-tests/shared/tests/config.py.stubs
@@ -29,6 +29,7 @@
 STAF_REMOTE_HOSTNAME          = '${remote.hostname}'
 STAF_CLIENT_HOSTNAME          = '${client.hostname}'
 TMPDIR                        = '${temp.dir}'
+PRODUCTNAME                   = '${product.name}'
 OPENDSNAME                    = '${opends.name}'
 ZIPNAME                       = '${opends.name}.zip'
 ZIPPATH                       = '${opends.dir}'
diff --git a/opends/tests/staf-tests/shared/tests/runTestJob.xml b/opends/tests/staf-tests/shared/tests/runTestJob.xml
index a8d22ff..0aabc67 100644
--- a/opends/tests/staf-tests/shared/tests/runTestJob.xml
+++ b/opends/tests/staf-tests/shared/tests/runTestJob.xml
@@ -163,7 +163,7 @@
         if ServersInfoDict.has_key(ServerPath):
           ServerInfoDict=ServersInfoDict[ServerPath]
 
-          ServerName=OPENDSNAME
+          ServerName=PRODUCTNAME
 
           ServerInfoKey='server version'
           if ServerInfoDict.has_key(ServerInfoKey):
diff --git a/opends/tests/staf-tests/shared/xsl/gen-alltests-report.xsl b/opends/tests/staf-tests/shared/xsl/gen-alltests-report.xsl
index 62ef242..10ebc74 100644
--- a/opends/tests/staf-tests/shared/xsl/gen-alltests-report.xsl
+++ b/opends/tests/staf-tests/shared/xsl/gen-alltests-report.xsl
@@ -54,6 +54,7 @@
   <!--- Test Report Header Variables -->
   <xsl:variable name="id"           select="identification"/>
   <xsl:variable name="sut"          select="$id/sut"/>
+  <xsl:variable name="productname"  select="normalize-space($id/productname)"/>
   <xsl:variable name="url"          select="normalize-space($id/tests-url)"/>
   <xsl:variable name="tests-dir"    select="normalize-space($id/tests-dir)"/>
   <xsl:variable name="version"      select="$sut/version"/>
@@ -79,7 +80,7 @@
   <link rel="stylesheet" href="./opends.css" type="text/css" />
 
     <xsl:element name="title">
-      <xsl:value-of select="concat('Test Report for OpenDS ',$version)"/>
+      <xsl:value-of select="concat('Test Report for ',$productname,' ',$version)"/>
     </xsl:element>
   
   </xsl:element>
@@ -95,7 +96,7 @@
   <table class="tertmasttable" width="100%" cellspacing="0">
     <tbody>
       <tr>
-        <td><div class="collectionheader"><xsl:value-of select="concat('Test Report for OpenDS ',$version)"/></div></td>
+        <td><div class="collectionheader"><xsl:value-of select="concat('Test Report for ',$productname,' ',$version)"/></div></td>
         <td width="10%"><a href="https://opends.dev.java.net/"><img src="./opends_logo_sm.png" alt="OpenDS Logo" width="104" height="33" border="0" align="middle" /></a> </td>
       </tr>
     </tbody>
diff --git a/opends/tests/staf-tests/shared/xsl/gen-groups-report.xsl b/opends/tests/staf-tests/shared/xsl/gen-groups-report.xsl
index bb1f5cc..422df20 100644
--- a/opends/tests/staf-tests/shared/xsl/gen-groups-report.xsl
+++ b/opends/tests/staf-tests/shared/xsl/gen-groups-report.xsl
@@ -57,6 +57,7 @@
   <xsl:variable name="id"             select="identification"/>
   <xsl:variable name="sut"            select="$id/sut"/>
   <xsl:variable name="testware"       select="$id/testware"/>
+  <xsl:variable name="productname"    select="normalize-space($id/productname)"/>
   <xsl:variable name="mailto"         select="normalize-space($id/mailto)"/>
   <xsl:variable name="tests-dir"      select="normalize-space($id/tests-dir)"/>
   <xsl:variable name="url"            select="normalize-space($id/tests-url)"/>
@@ -89,7 +90,7 @@
   <link rel="stylesheet" href="./opends.css" type="text/css" />
 
     <xsl:element name="title">
-      <xsl:value-of select="concat('Test Groups Report for OpenDS ',$version)"/>
+      <xsl:value-of select="concat('Test Groups Report for ',$productname,' ',$version)"/>
     </xsl:element>
   
   </xsl:element>
@@ -105,7 +106,7 @@
   <table class="tertmasttable" width="100%" cellspacing="0">
     <tbody>
       <tr>
-        <td><div class="collectionheader"><xsl:value-of select="concat('Test Groups Report for OpenDS ',$version)"/></div></td>
+        <td><div class="collectionheader"><xsl:value-of select="concat('Test Groups Report for ',$productname,' ',$version)"/></div></td>
         <td width="10%"><a href="https://opends.dev.java.net/"><img src="./opends_logo_sm.png" alt="OpenDS Logo" width="104" height="33" border="0" align="middle" /></a> </td>
       </tr>
     </tbody>
diff --git a/opends/tests/staf-tests/shared/xsl/gen-suites-report.xsl b/opends/tests/staf-tests/shared/xsl/gen-suites-report.xsl
index 6862d93..eab74a2 100644
--- a/opends/tests/staf-tests/shared/xsl/gen-suites-report.xsl
+++ b/opends/tests/staf-tests/shared/xsl/gen-suites-report.xsl
@@ -60,6 +60,7 @@
   <!--- Test Suites Report Header Variables -->
   <xsl:variable name="id"             select="identification"/>
   <xsl:variable name="sut"            select="$id/sut"/>
+  <xsl:variable name="productname"    select="normalize-space($id/productname)"/>
   <xsl:variable name="mailto"         select="normalize-space($id/mailto)"/>
   <xsl:variable name="tests-dir"      select="normalize-space($id/tests-dir)"/>
   <xsl:variable name="url"            select="normalize-space($id/tests-url)"/>
@@ -92,7 +93,7 @@
   <link rel="stylesheet" href="../../reports/opends.css" type="text/css" />
 
     <xsl:element name="title">
-      <xsl:value-of select="concat('Test Suites Report for OpenDS ',$version)"/>
+      <xsl:value-of select="concat('Test Suites Report for ',$productname,' ',$version)"/>
     </xsl:element>
   
   </xsl:element>
@@ -108,7 +109,7 @@
   <table class="tertmasttable" width="100%" cellspacing="0">
     <tbody>
       <tr>
-        <td><div class="collectionheader"><xsl:value-of select="concat('Test Suites Report for OpenDS ',$version)"/></div></td>
+        <td><div class="collectionheader"><xsl:value-of select="concat('Test Suites Report for ',$productname,' ',$version)"/></div></td>
         <td width="10%"><a href="https://opends.dev.java.net/"><img src="../../reports/opends_logo_sm.png" alt="OpenDS Logo" width="104" height="33" border="0" align="middle" /></a> </td>
       </tr>
     </tbody>
diff --git a/opends/tests/staf-tests/shared/xsl/gen-tests-report.xsl b/opends/tests/staf-tests/shared/xsl/gen-tests-report.xsl
index b642116..49febdc 100644
--- a/opends/tests/staf-tests/shared/xsl/gen-tests-report.xsl
+++ b/opends/tests/staf-tests/shared/xsl/gen-tests-report.xsl
@@ -61,6 +61,7 @@
   <!--- Test Report Header Variables -->
   <xsl:variable name="id"             select="identification"/>
   <xsl:variable name="sut"            select="$id/sut"/>
+  <xsl:variable name="productname"    select="normalize-space($id/productname)"/>
   <xsl:variable name="mailto"         select="normalize-space($id/mailto)"/>
   <xsl:variable name="tests-dir"      select="normalize-space($id/tests-dir)"/>
   <xsl:variable name="url"            select="normalize-space($id/tests-url)"/>
@@ -107,7 +108,7 @@
   <link rel="stylesheet" href="../../reports/opends.css" type="text/css" />
 
     <xsl:element name="title">
-      <xsl:value-of select="concat('Test Case Report for OpenDS ',$version)"/>
+      <xsl:value-of select="concat('Test Cases Report for ',$productname,' ',$version)"/>
     </xsl:element>
   
   </xsl:element>
@@ -123,7 +124,7 @@
   <table class="tertmasttable" width="100%" cellspacing="0">
     <tbody>
       <tr>
-        <td><div class="collectionheader"><xsl:value-of select="concat('Test Case Report for OpenDS ',$version)"/></div></td>
+        <td><div class="collectionheader"><xsl:value-of select="concat('Test Cases Report for ',$productname,' ',$version)"/></div></td>
         <td width="10%"><a href="https://opends.dev.java.net/"><img src="../../reports/opends_logo_sm.png" alt="OpenDS Logo" width="104" height="33" border="0" align="middle" /></a> </td>
       </tr>
     </tbody>
diff --git a/opends/tests/staf-tests/shared/xsl/id.xsl b/opends/tests/staf-tests/shared/xsl/id.xsl
index 3e7cba4..2ea4119 100644
--- a/opends/tests/staf-tests/shared/xsl/id.xsl
+++ b/opends/tests/staf-tests/shared/xsl/id.xsl
@@ -60,6 +60,7 @@
   <xsl:variable name="url"            select="normalize-space($id/tests-url)"/>
   <xsl:variable name="tests-dir"      select="normalize-space($id/tests-dir)"/>
   <xsl:variable name="mailto"         select="normalize-space($id/mailto)"/>
+  <xsl:variable name="productname"    select="normalize-space($id/productname)"/>
   <xsl:variable name="version"        select="normalize-space($sut[@product='opends']/version)"/>
  
   <xsl:element name="html">
@@ -76,7 +77,7 @@
   <link rel="stylesheet" href="./opends.css" type="text/css" />
 
     <xsl:element name="title">
-      <xsl:value-of select="concat('Identification for OpenDS ',$version)"/>
+      <xsl:value-of select="concat('Identification for ',$productname,' ',$version)"/>
     </xsl:element>
   
   </xsl:element>
@@ -92,7 +93,7 @@
   <table class="tertmasttable" width="100%" cellspacing="0">
     <tbody>
       <tr>
-        <td><div class="collectionheader"><xsl:value-of select="concat('Identification for OpenDS ',$version)"/></div></td>
+        <td><div class="collectionheader"><xsl:value-of select="concat('Identification for ',$productname,' ',$version)"/></div></td>
         <td width="10%"><a href="https://opends.dev.java.net/"><img src="./opends_logo_sm.png" alt="OpenDS Logo" width="104" height="33" border="0" align="middle" /></a> </td>
       </tr>
     </tbody>

--
Gitblit v1.10.0