From fc6e98c8d25d75e6225e0b4596d6a13d7a08407c Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Tue, 05 Feb 2008 09:01:26 +0000
Subject: [PATCH] allow runCommand to manage return code (call of checktestRC()) and remove the call of checktestRC in functions that use runCommand ; change setOSvariables to getOSvariables call in environment.xml

---
 opends/tests/functional-tests/testcases/security/sasl/security_sasl_plain.xml |    2 
 opends/tests/shared/functions/tools.xml                                       |   52 ++-
 opends/tests/shared/functions/dsconfig.xml                                    |  231 +++++---------
 opends/tests/shared/functions/dsadm.xml                                       |  205 +++++-------
 opends/tests/shared/functions/environment.xml                                 |    3 
 opends/tests/shared/functions/topology.xml                                    |   56 +--
 opends/tests/shared/functions/ldap.xml                                        |  231 ++++----------
 opends/tests/shared/functions/security.xml                                    |   99 ++---
 opends/tests/shared/functions/utils.xml                                       |   35 +
 9 files changed, 351 insertions(+), 563 deletions(-)

diff --git a/opends/tests/functional-tests/testcases/security/sasl/security_sasl_plain.xml b/opends/tests/functional-tests/testcases/security/sasl/security_sasl_plain.xml
index 56046c6..dbaf8a3 100755
--- a/opends/tests/functional-tests/testcases/security/sasl/security_sasl_plain.xml
+++ b/opends/tests/functional-tests/testcases/security/sasl/security_sasl_plain.xml
@@ -320,7 +320,7 @@
             </call>
             
              <script> 
-                 returnString = STAXReason[0][1]
+                 returnString = STAXResult[0][1]
             </script> 
     
             <call function="'checktestString'">
diff --git a/opends/tests/shared/functions/dsadm.xml b/opends/tests/shared/functions/dsadm.xml
index f33f7e4..12a2af7 100755
--- a/opends/tests/shared/functions/dsadm.xml
+++ b/opends/tests/shared/functions/dsadm.xml
@@ -98,7 +98,7 @@
           Help option
         </function-arg-description>
         <function-arg-property name="help" value="option"/>
-      </function-arg-def>    
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -151,13 +151,10 @@
           'name'      : 'Setup DS Script',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'path'      : dsPath
+          'path'      : dsPath,
+          'expectedRC': 'noCheck'
         }
       </call>
-      <call function="'checkRC'">
-        { 'returncode' : RC ,
-          'result'     : STAXResult }
-      </call>
     </sequence>
   </function>
 
@@ -208,7 +205,13 @@
           Directory server build information
         </function-arg-description>
         <function-arg-property name="type" value="option"/>
-      </function-arg-def>                
+      </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -248,19 +251,11 @@
         { 'location'  : location,
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        startRC=RC
-        startResult=STAXResult
-      </script>
-      <call function="'checkRC'">
-          { 'returncode' : startRC ,
-            'result'     : startResult }
-      </call>
-     
-      <return>startResult</return>
+      <return>STAXResult</return>
           
     </sequence>
     
@@ -404,6 +399,12 @@
         </function-arg-description>
         <function-arg-property name="type" value="option"/>
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -488,13 +489,10 @@
         { 'location'  : location,
           'name'      : 'Stop DS Script',
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
-      <call function="'checkRC'">
-        { 'returncode' : RC ,
-          'result'     : STAXResult }
-      </call>
       <call function="'Sleep'">
         { 'sleepForMilliSeconds'  : 3000 }
       </call>
@@ -668,7 +666,13 @@
           Optional extra parameters for specific test cases
         </function-arg-description>
         <function-arg-property name="type" value="string"/>
-      </function-arg-def>    
+      </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
       
     <sequence>
@@ -684,18 +688,11 @@
         { 'location'  : location,
           'name'      : 'Offline Import',
           'command'   : '%s/import-ldif%s' % (dsBinPath,fileExt),
-          'arguments' : '-l %s -n %s %s' % (ldifFile,backEnd,extraParams)
+          'arguments' : '-l %s -n %s %s' % (ldifFile,backEnd,extraParams),
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        importRC=RC
-        importResult=STAXResult
-      </script>
-      <call function="'checkRC'">
-          { 'returncode' : importRC ,
-            'result'     : importResult }
-      </call>
-      <return>importRC</return>
+      <return>RC</return>
     </sequence>
   </function>
     
@@ -865,7 +862,13 @@
           Start time for task
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
-      </function-arg-def>            
+      </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -962,14 +965,10 @@
         { 'location'  : location,
           'name'      : 'Offline Import Script',
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
-      <call function="'checkRC'">
-        { 'returncode' : RC ,
-          'result'     : STAXResult }
-      </call>
-            
     </sequence>
   </function>
 
@@ -1482,7 +1481,8 @@
       </function-arg-def>
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
       </function-arg-def>
@@ -1528,26 +1528,13 @@
         { 'location'  : location,
           'name'      : 'Export Script',
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }              
-      </call> 
-      <message> 
-        '%s %s' % (STAFCmd,STAFCmdParams)
-      </message>
-
-     <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
-      </return>                
+        STAXResult
+      </return>
     </sequence>
   </function>
   
@@ -1842,7 +1829,8 @@
       </function-arg-def>             
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
 	    </function-arg-def>
@@ -1886,23 +1874,14 @@
         { 'location'  : location,
           'name'      : 'Backup Script',
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }              
       </call> 
-   
-    <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
-        }
-      </call>
+      
       <return>
-        STAXReason
-      </return>                
+        STAXResult
+      </return>
     </sequence>
   </function>      
      
@@ -2157,7 +2136,8 @@
       </function-arg-def>        
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
       </function-arg-def>      
@@ -2198,24 +2178,15 @@
         { 'location'  : location,
           'name'      : 'Restore Script',
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }              
-      </call> 
-   
-    <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
-      </call>
+      </call> 
+      
       <return>
-        STAXReason
-      </return>                
-    </sequence>      
+        STAXResult
+      </return>
+    </sequence>
   </function>
 
   <!-- Restore Task Function --> 
@@ -3215,7 +3186,7 @@
           Sleep time in milliseconds between ldap check tries
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
-      </function-arg-def> 
+      </function-arg-def>
       
     </function-map-args>
 
@@ -3375,7 +3346,13 @@
           Help option
         </function-arg-description>
         <function-arg-property name="help" value="option"/>
-      </function-arg-def>    
+      </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -3410,21 +3387,12 @@
           'name'      : 'Status Script',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'path'      : dsPath
+          'path'      : dsPath,
+          'expectedRC': expectedRC
         }
       </call>
-
-      <script>
-        CmdRC=RC
-        CmdResult=STAXResult
-      </script>
-
-      <call function="'checkRC'">
-        { 'returncode' : CmdRC ,
-          'result'     : CmdResult }
-      </call>
-
-      <return>CmdResult</return>
+      
+      <return>STAXResult</return>
       
     </sequence>
 
@@ -3495,7 +3463,13 @@
           Help option
         </function-arg-description>
         <function-arg-property name="help" value="option"/>
-      </function-arg-def>    
+      </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -3544,21 +3518,12 @@
           'name'      : 'Base 64 %s Script' % subcommand,
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'path'      : dsPath
+          'path'      : dsPath,
+          'expectedRC': expectedRC
         }
       </call>
-
-      <script>
-        CmdRC=RC
-        CmdResult=STAXResult
-      </script>
-
-      <call function="'checkRC'">
-        { 'returncode' : CmdRC ,
-          'result'     : CmdResult }
-      </call>
-
-      <return>CmdResult</return>
+      
+      <return>STAXResult</return>
             
     </sequence>
   </function>
diff --git a/opends/tests/shared/functions/dsconfig.xml b/opends/tests/shared/functions/dsconfig.xml
index 8ac7562..0fd315e 100755
--- a/opends/tests/shared/functions/dsconfig.xml
+++ b/opends/tests/shared/functions/dsconfig.xml
@@ -143,7 +143,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -182,22 +183,13 @@
         { 'name'      : 'Modify dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <if expr="expectedRC != 'noCheck'">
-        <call function="'checktestRC'">
-          { 'returncode' : STAXCode ,
-            'result'     : STAXReason ,
-            'expected'   : expectedRC }
-        </call>
-      </if>        
+      
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -301,7 +293,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -338,27 +331,20 @@
         { 'name'      : 'Get dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <script>
         STAXCode=RC
         STAXReason=STAXResult[0][1]
       </script>
-      <if expr="expectedAttributeValue == 'none'">
-        <call function="'checktestRC'">
-          { 'returncode' : STAXCode,
-            'result'     : STAXReason,
-            'expected'   : expectedRC
+      <if expr="expectedAttributeValue != 'none'">
+        <call function="'checktestString'">
+          { 'expectedString'  : expectedAttributeValue,
+            'returnString'    : STAXReason
           }
         </call>
-        <else>
-          <call function="'checktestString'">
-            { 'expectedString'  : expectedAttributeValue,
-              'returnString'    :  STAXReason
-            }
-          </call>
-        </else>
       </if>
       <return>
         STAXReason
@@ -451,7 +437,8 @@
           
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -482,21 +469,12 @@
         { 'name'      : 'execute dsconfig subcommand',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>  
@@ -607,14 +585,8 @@
           'expectedRC'             : expectedRC
         }
       </call>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
-        }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
    </sequence>
   </function>
@@ -726,14 +698,8 @@
           'expectedRC'     : expectedRC
         }
       </call>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
-        }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
    </sequence>
   </function>
@@ -809,7 +775,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -840,20 +807,12 @@
         { 'name'      : 'Modify dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason ,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -965,14 +924,8 @@
           'expectedRC'             : expectedRC
         }
       </call>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
-        }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
    </sequence>
   </function>
@@ -1048,7 +1001,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -1077,24 +1031,15 @@
         STAFCmdParams=' '.join(STAFCmdParamsList)
       </script>
       <call function="'runCommand'">
-        { 'name' : 'Modify dsconfig object',
+        { 'name'      : 'Modify dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1206,14 +1151,8 @@
           'expectedRC'     : expectedRC
         }
       </call>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
-        }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1309,6 +1248,13 @@
           <function-arg-property-data type="choice" value="'substring'" />
         </function-arg-property>
       </function-arg-def>
+      
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Local variables -->
@@ -1325,7 +1271,8 @@
         { 'name'      : 'dsconfig addIndex',
           'location'  : location,
           'command'   : dsconfigCmd,
-          'arguments' : dsconfigParams
+          'arguments' : dsconfigParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
@@ -1437,6 +1384,13 @@
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
+      
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Local variables -->
@@ -1455,7 +1409,8 @@
         { 'name'      : 'dsconfig modifyIndex',
           'location'  : location,
           'command'   : dsconfigCmd,
-          'arguments' : dsconfigParams
+          'arguments' : dsconfigParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
@@ -1538,6 +1493,13 @@
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
+      
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Local variables -->
@@ -1553,7 +1515,8 @@
         { 'name'      : 'dsconfig removeIndex',
           'location'  : location,
           'command'   : dsconfigCmd,
-          'arguments' : dsconfigParams
+          'arguments' : dsconfigParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
@@ -1637,7 +1600,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -1667,21 +1631,12 @@
         { 'name'      : 'Modify dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1742,7 +1697,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -1770,21 +1726,12 @@
         { 'name'      : 'List synchronization providers',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1876,7 +1823,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -1910,21 +1858,12 @@
         { 'name'      : 'Modify dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
-        }
-      </call> 
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -2023,7 +1962,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -2057,21 +1997,12 @@
         { 'name'      : 'Modify dsconfig object',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
diff --git a/opends/tests/shared/functions/environment.xml b/opends/tests/shared/functions/environment.xml
index 15e96f7..8ac82e0 100755
--- a/opends/tests/shared/functions/environment.xml
+++ b/opends/tests/shared/functions/environment.xml
@@ -119,7 +119,7 @@
     <sequence>
     
       <!-- Resolve any OS related variables -->           
-      <call function="'setOSvariables'">
+      <call function="'getOSvariables'">
         { 'hostname' : STAF_REMOTE_HOSTNAME }
       </call>
 
@@ -154,7 +154,6 @@
 
         DSCONFIG = 'dsconfig'       
         DSREPLICATION = 'dsreplication'   
-        NO_CHECK = 'noCheck'  
           
         AdminUID = 'admin'
         AdminPswd = 'admin'
diff --git a/opends/tests/shared/functions/ldap.xml b/opends/tests/shared/functions/ldap.xml
index 52c3b35..242109e 100755
--- a/opends/tests/shared/functions/ldap.xml
+++ b/opends/tests/shared/functions/ldap.xml
@@ -82,6 +82,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
         </function-arg-def>
@@ -127,21 +128,11 @@
           'arguments'   : STAFCmdParams,
           'location'    : mylocation,
           'name'        : 'Add Entry From LDIF',
-          'verbose'     : verbose
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'expectedRC'  : expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -360,6 +351,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
         </function-arg-def>    
@@ -486,21 +478,13 @@
         { 'name'      : 'LDAP Modify Script',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
       
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -562,6 +546,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
         </function-arg-def>    
@@ -604,21 +589,13 @@
         { 'location'  : location,
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'name'      : 'Modify Entry from ldif file'
+          'name'      : 'Modify Entry from ldif file',
+          'expectedRC': expectedRC
         }
       </call>
       
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -933,6 +910,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
         </function-arg-def>    
@@ -1207,7 +1185,8 @@
       </function-arg-def>
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          Expected return code value. Default value is 0. Wildcard 'noCheck' to not check the RC
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
         </function-arg-def>    
@@ -1263,22 +1242,12 @@
         { 'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
           'location'  : location,
-          'name'      : 'ldapsearch'
+          'name'      : 'ldapsearch',
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <if expr="expectedRC != 'noCheck'">
-        <call function="'checktestRC'">
-          { 'returncode' : STAXCode ,
-            'result'     : STAXReason ,
-            'expected'   : expectedRC }
-        </call>
-      </if>        
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
 
@@ -1340,7 +1309,8 @@
       </function-arg-def>
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          expected value. Default is 0
+          Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
       </function-arg-def>
     </function-map-args>
@@ -1349,20 +1319,12 @@
         { 'name'      : 'Search Base Object No Password',
           'command'   : '%s/ldapsearch%s' % (dsBinPath,fileExt),
           'arguments' : '-h %s -p %s -D "%s" %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,dsInstanceDn,extraParams,dsBaseDN,dsFilter),
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1418,6 +1380,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
         </function-arg-def>    
@@ -1427,20 +1390,12 @@
         { 'name'      : 'Anonymous Search Base Object',
           'location'  : location,
           'command'   : '%s/ldapsearch%s' % (dsBinPath,fileExt),
-          'arguments' : '-h %s -p %s %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter)
+          'arguments' : '-h %s -p %s %s -b "%s" "%s"' % (dsInstanceHost,dsInstancePort,extraParams,dsBaseDN,dsFilter),
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1635,6 +1590,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
       </function-arg-def>    
@@ -1747,20 +1703,12 @@
         { 'name'      : 'LDAP Delete Script',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1822,6 +1770,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
       </function-arg-def>    
@@ -1866,20 +1815,12 @@
         { 'name'      : 'Delete Object',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
     
@@ -2087,6 +2028,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
       </function-arg-def>    
@@ -2198,20 +2140,12 @@
         { 'name'      : 'LDAP Compare Script',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -2279,6 +2213,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
       </function-arg-def>    
@@ -2320,20 +2255,12 @@
         { 'name'      : 'Compare Object',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -2521,6 +2448,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>      
       </function-arg-def>    
@@ -2613,20 +2541,12 @@
         { 'name'      : 'LDAP Password Modify Script',
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
-          'location'  : location
+          'location'  : location,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -2725,6 +2645,7 @@
     <function-arg-def name="expectedRC" type="optional" default="0">
       <function-arg-description>
         Expected return code value. Default value is 0
+        Wildcard 'noCheck' to not check the RC
       </function-arg-description>
       <function-arg-property name="type" value="string"/>
     </function-arg-def>      
@@ -2778,31 +2699,26 @@
         
         STAFCmd='modifyAnAttribute' 
       </script>
+      
+      <if expr="suppressTestStatus == '1'">
+        <script>
+          expectedRC = 'noCheck'
+        </script>
+      </if>
+      
       <call function="'runCommand'" >
         { 'name'      : 'Modify An Attribute value',
           'command'   : '%s/bin/java' % JAVA_HOME,
           'arguments' : '%s %s' % (STAFCmd,STAFCmdParams),
           'location'  : location,
           'path'      : '%s/../%s' % (dsPath,relativeJavaDir),
-          'env'       : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)]
+          'env'       : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)],
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
       
-      <if expr="suppressTestStatus != '1'">
-        <sequence>
-          <call function="'checktestRC'">
-          { 'returncode' : STAXCode ,
-            'result'     : STAXReason,
-            'expected'   : expectedRC }
-          </call>
-        </sequence>
-      </if>
       <return>
-        [STAXCode,STAXReason]
+        [RC,STAXResult]
       </return>
     </sequence>
     
@@ -2908,6 +2824,7 @@
     <function-arg-def name="expectedRC" type="optional" default="0">
       <function-arg-description>
         Expected return code value. Default value is 0
+        Wildcard 'noCheck' to not check the RC
       </function-arg-description>
       <function-arg-property name="type" value="string"/>
     </function-arg-def>      
@@ -3003,7 +2920,8 @@
       </function-arg-def>
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          expected value. Default is 0
+          Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
       </function-arg-def>
     </function-map-args>
@@ -3037,20 +2955,12 @@
           'arguments' : '%s %s' % (STAFCmd,STAFCmdParams),
           'location'  : location,
           'env'       : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)],
-          'path'      : '%s/../%s' % (dsPath,relativeJavaDir)
+          'path'      : '%s/../%s' % (dsPath,relativeJavaDir),
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -3119,6 +3029,7 @@
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
           Expected return code value. Default value is 0
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="integer"/>
       </function-arg-def>
@@ -3156,20 +3067,12 @@
           'arguments' : '%s %s' % (STAFCmd,STAFCmdParams),
           'location'  : location,
           'env'       : ['PATH=/bin:/usr/bin:%s/bin' % dsPath, 'JAVA_HOME=%s' % JAVA_HOME,'CLASSPATH=%s/../%s' % (dsPath,relativeJavaDir)],
-          'path'      : '%s/../%s' % (dsPath,relativeJavaDir)
+          'path'      : '%s/../%s' % (dsPath,relativeJavaDir),
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason,
-          'expected'   : expectedRC }
-      </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
diff --git a/opends/tests/shared/functions/security.xml b/opends/tests/shared/functions/security.xml
index e60b09f..fa7a214 100755
--- a/opends/tests/shared/functions/security.xml
+++ b/opends/tests/shared/functions/security.xml
@@ -74,6 +74,12 @@
           The storetype. can be JKS or PKCS12
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Local variables -->
@@ -87,19 +93,11 @@
           'location'  : location,
           'command'   : '%s/bin/keytool' % JAVA_HOME,
           'arguments' : '-genkey -alias %s -keyalg rsa -dname "%s" -keystore %s -storepass %s -keypass %s -storetype %s ' % (certAlias,dname,keystore,storepass,keypass,storetype),
-          'path'      : dsConfigPath
+          'path'      : dsConfigPath,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-           'result'     : STAXReason
-        }
-      </call>
-      <return>STAXReason</return>
+      <return>STAXResult</return>
     </sequence>
   </function>
   
@@ -147,6 +145,12 @@
           The storetype. can be JKS or PKCS12
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Local variables -->
@@ -161,19 +165,11 @@
           'location'  : location,
           'command'   : '%s/bin/keytool' % JAVA_HOME,
           'arguments' : '-selfcert -alias %s -keystore "%s"  -keypass "%s" -storepass "%s" -storetype "%s" ' % (certAlias,keystore,keypass,storepass,storetype),
-          'path'      : dsConfigPath
+          'path'      : dsConfigPath,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode  ,
-          'result'     : STAXReason
-        }
-      </call>
-      <return>STAXReason</return>
+      <return>STAXResult</return>
     </sequence>
   </function>
   
@@ -226,6 +222,12 @@
           Output file to store certificate
         </function-arg-description> 
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -246,18 +248,11 @@
           'location'   : location,
           'command'    : '%s/bin/keytool' % JAVA_HOME,
           'arguments'  : '-export -alias %s -file %s -keystore "%s"  -storepass "%s" -storetype %s %s' % (certAlias,outputfile,keystore,storepass,storetype,STAFCmdParams),
-          'path'       : dsConfigPath
+          'path'       : dsConfigPath,
+          'expectedRC' : expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason }
-      </call>
-      <return>STAXReason</return>  
+      <return>STAXResult</return>  
     </sequence>
   </function>
   
@@ -305,6 +300,12 @@
           Certificate to import
         </function-arg-description>  
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       
@@ -320,19 +321,11 @@
           'location'    : location,
           'command'     : '%s/bin/keytool' % JAVA_HOME,
           'arguments'   : '-import  -alias %s -file %s -keystore "%s"  -storepass "%s" -storetype %s -noprompt' % (certAlias,inputfile,keystore,storepass,storetype),
-          'path'        : dsConfigPath
+          'path'        : dsConfigPath,
+          'expectedRC'  : expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason 
-        }
-      </call>
-      <return>STAXReason</return>  
+      <return>STAXResult</return>
     </sequence>
   </function>
   
@@ -375,6 +368,12 @@
           fingerprint. can be MD5 or SHA1
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Local variables -->
@@ -388,19 +387,11 @@
           'location'  : location,
           'command'   : '%s/bin/keytool' % JAVA_HOME,
           'arguments' : ' -list -v -keystore "%s"  -storepass "%s"  -alias "%s"' % (keystore,storepass,certAlias),
-          'path'      : dsConfigPath
+          'path'      : dsConfigPath,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode ,
-          'result'     : STAXReason
-        }
-      </call>
-      <return>STAXReason</return>
+      <return>STAXResult</return>
     </sequence>
   </function>
   
diff --git a/opends/tests/shared/functions/tools.xml b/opends/tests/shared/functions/tools.xml
index d88fb3b..c9aadc1 100755
--- a/opends/tests/shared/functions/tools.xml
+++ b/opends/tests/shared/functions/tools.xml
@@ -85,6 +85,13 @@
         </function-arg-description>
         <function-arg-property name="help" value="option"/>
       </function-arg-def>
+      
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Build the Command -->
@@ -118,25 +125,10 @@
           'location'  : location,
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
-      <script>
-         STAXCode=RC
-         STAXReason=STAXResult
-      </script>
-      <if expr="STAXCode != 0">
-        <sequence>
-          <message level="'error'">
-            'make-ldif failed (Code=%s,Reason=%s).' % (STAXCode,STAXReason)
-          </message>
-        </sequence>
-      </if>
-      <call function="'checktestRC'">
-       { 'returncode' : STAXCode ,
-         'result'     : STAXReason }
-      </call>
-
-    <return>[STAXCode, STAXReason]</return>
+      <return>[RC, STAXResult]</return>
     </sequence>
   </function> 
   
@@ -428,6 +420,13 @@
         </function-arg-description>
         <function-arg-property name="help" value="option"/>
       </function-arg-def>
+      
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     <sequence>
       <!-- Build the Command -->
@@ -461,6 +460,7 @@
           'location'  : location,
           'command'   : STAFCmd,
           'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>STAXResult</return>
@@ -896,6 +896,12 @@
           [ 'uid', 'telephonenumber' ]
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
     
     <sequence>
@@ -908,7 +914,8 @@
         { 'name'      : 'rebuild index',
           'location'  : location,
           'command'   : _cmd,
-          'arguments' : _args
+          'arguments' : _args,
+          'expectedRC': expectedRC
         }
       </call>
       <return>STAXResult</return>
@@ -938,6 +945,12 @@
           Specify a list of attributes to trigger index verification on
         </function-arg-description>
       </function-arg-def>
+      <function-arg-def name="expectedRC" type="optional" default="0">
+        <function-arg-description>
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
+        </function-arg-description>
+      </function-arg-def>
     </function-map-args>
 
     <sequence>
@@ -950,7 +963,8 @@
         { 'name'      : 'verify index',
           'location'  : location,
           'command'   : _cmd,
-          'arguments' : _args
+          'arguments' : _args,
+          'expectedRC': expectedRC
         }
       </call>
       <return>STAXResult</return>
diff --git a/opends/tests/shared/functions/topology.xml b/opends/tests/shared/functions/topology.xml
index 616b7fe..7e6692e 100755
--- a/opends/tests/shared/functions/topology.xml
+++ b/opends/tests/shared/functions/topology.xml
@@ -894,10 +894,11 @@
         </function-arg-description>
         <function-arg-property name="type" value="boolean" />
       </function-arg-def>
-                                      
+      
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -975,21 +976,12 @@
         { 'name'      : 'Enable Replication',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1083,7 +1075,8 @@
       
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -1135,21 +1128,12 @@
         { 'name'      : 'Initialize Replication',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>
@@ -1224,7 +1208,8 @@
 
       <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-        Expected return code value. Default value is 0
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
         <function-arg-property name="type" value="string" />
       </function-arg-def>
@@ -1266,21 +1251,12 @@
         { 'name'      : 'Disable Replication',
           'location'  : location,
           'command'   : STAFCmd,
-          'arguments' : STAFCmdParams
-        }
-      </call>
-      <script>
-        STAXCode=RC
-        STAXReason=STAXResult
-      </script>
-      <call function="'checktestRC'">
-        { 'returncode' : STAXCode,
-          'result'     : STAXReason,
-          'expected'   : expectedRC
+          'arguments' : STAFCmdParams,
+          'expectedRC': expectedRC
         }
       </call>
       <return>
-        STAXReason
+        STAXResult
       </return>
     </sequence>
   </function>        
diff --git a/opends/tests/shared/functions/utils.xml b/opends/tests/shared/functions/utils.xml
index 8116d47..db0c97e 100755
--- a/opends/tests/shared/functions/utils.xml
+++ b/opends/tests/shared/functions/utils.xml
@@ -53,7 +53,7 @@
     </function-map-args>
 
     <sequence>
-      <if expr="expected == NO_CHECK">
+      <if expr="expected == 'noCheck'">
         <return/>
       </if>                
       <if expr="returncode == expected">
@@ -106,7 +106,7 @@
       </function-arg-def>
     </function-map-args>  
     <sequence>    
-      <if expr="expected == NO_CHECK">
+      <if expr="expected == 'noCheck'">
         <return/>
       </if>        
       <if expr="returncode == expected">
@@ -494,9 +494,9 @@
     </sequence>
   </function>
 
-  <function name="setOSvariables">
+  <function name="getOSvariables">
     <function-prolog>
-      Set OS related variables
+      Get OS related variables
     </function-prolog>
     <function-map-args>
       <function-arg-def name="hostname" type="required">
@@ -1446,10 +1446,10 @@
           The duration that the process is allowed to run
         </function-arg-description>
       </function-arg-def>      
-      <function-arg-def name="verbose" default="True" type="optional">
+      <function-arg-def name="expectedRC" type="optional" default="0">
         <function-arg-description>
-          A boolean (use True or False here, case matters) to output the 
-          outputs of the command
+          Expected return code value. Default value is 0.
+          Wildcard 'noCheck' to not check the RC
         </function-arg-description>
       </function-arg-def>
     </function-map-args>
@@ -1471,6 +1471,7 @@
       </message>
 
       <block name="'%s:Wrapper for %s' % (_id,re.compile('\..*$').sub('',os.path.basename(command)))">
+      
           <process name="name">
             <location>location</location>
             <command>command</command>
@@ -1481,12 +1482,20 @@
             <stderr mode="'stdout'"/>
             <returnstdout/>
           </process>
+      
       </block>
       
-      <if expr="verbose == True">
-        <message level="'info'">
-          '%s: Command returned:\n%s' % (_id,STAXResult[0][1])
-        </message>
+      <script>
+        cmdRC = RC
+        cmdOutput = STAXResult
+      </script>
+      <if expr="expectedRC != 'noCheck'">
+        <call function="'checktestRC'">
+          { 'returncode' : cmdRC,
+            'result'     : cmdOutput[0][1],
+            'expected'   : expectedRC
+          }
+        </call>
       </if>
       <script>
         def dig(var):
@@ -1504,10 +1513,10 @@
             return 'could not evaluate the following component: %s' % var
         
         if stripOutput == True:
-          STAXResult=dig(STAXResult)
+          cmdOutput=dig(cmdOutput)
       </script>
       <return>
-        STAXResult
+        cmdOutput
       </return>
     </sequence>
   </function>

--
Gitblit v1.10.0