From 02c92369ae8abd543b0b376dc9b17bb07fad7c26 Mon Sep 17 00:00:00 2001
From: Gary Williams <gary.williams@forgerock.com>
Date: Wed, 21 Sep 2011 06:36:52 +0000
Subject: [PATCH] Add PTA mapped-search with use-ssl functional test

---
 opends/tests/staf-tests/shared/functions/security.xml |   81 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 1 deletions(-)

diff --git a/opends/tests/staf-tests/shared/functions/security.xml b/opends/tests/staf-tests/shared/functions/security.xml
index c3c9c58..2660aef 100755
--- a/opends/tests/staf-tests/shared/functions/security.xml
+++ b/opends/tests/staf-tests/shared/functions/security.xml
@@ -328,7 +328,86 @@
       <return>STAXResult</return>
     </sequence>
   </function>
-  
+
+  <!-- **************************************************** -->
+  <!--                       List a certificate                                 -->
+  <!-- **************************************************** -->  
+  <function name="ListCertificate">
+    <function-prolog>
+      This function lists a certificate
+    </function-prolog>
+    <function-map-args>
+      <function-arg-def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
+        <function-arg-description>
+          Location of target host
+        </function-arg-description>
+      </function-arg-def>
+      <function-arg-def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
+        <function-arg-description>
+          Pathname to installation root
+        </function-arg-description>
+      </function-arg-def>
+      <function-arg-def name="certAlias" type="optional" default="'server-cert'">
+        <function-arg-description>
+          Alias certificate
+        </function-arg-description>
+      </function-arg-def>
+      <function-arg-def name="keystore" type="optional" default="'keystore'">
+        <function-arg-description>
+          Path for the key store file
+        </function-arg-description>
+      </function-arg-def>
+      <function-arg-def name="storepass" type="optional" default="'servercert'">
+        <function-arg-description>
+          Password to protect the contents of the key store
+        </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 -->
+      <script>
+        if dsPath:
+          dsConfigPath='%s/config' % (dsPath)
+          dsBinPath='%s/%s' % (dsPath,fileFolder)
+        
+        STAFCmdParamsList=[]
+        STAFCmdParams=''
+
+        STAFCmdParamsList.append('-list')
+        STAFCmdParamsList.append('-v')
+        
+        if certAlias:
+          STAFCmdParamsList.append('-alias %s' % certAlias)
+        
+        if keystore:
+          STAFCmdParamsList.append('-keystore %s' % keystore)
+
+        if storepass:
+          STAFCmdParamsList.append('-storepass %s' % storepass)
+        
+        STAFCmdParams=' '.join(STAFCmdParamsList)
+
+      </script>
+      
+      <call function="'runCommand'">
+        { 'name'       : 'List a Certificate',
+          'location'   : location,
+          'command'    : '%s/bin/keytool' % JAVA_HOME,
+          'arguments'  : STAFCmdParams ,
+          'path'       : dsConfigPath,
+          'expectedRC' : expectedRC
+        }
+      </call>
+      <return>STAXResult</return>  
+    </sequence>
+  </function>  
   
   <!-- **************************************************** -->
   <!--                      Add certificate to an attribute -->

--
Gitblit v1.10.0