From 8b8b49f2eec4eb970c8dac2814e43a9144bd1d2b Mon Sep 17 00:00:00 2001
From: mkeyes <mkeyes@localhost>
Date: Fri, 17 Aug 2007 22:10:18 +0000
Subject: [PATCH] Adding some functional tests using dsconfig with the get-xxx-yyy-prop subcommands
---
opends/tests/functional-tests/testcases/dsconfig/dsconfig_get.xml | 128 ++++++++++++++++++++++++++++++++
opends/tests/functional-tests/testcases/dsconfig/get.dat | 49 ++++++++++++
opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml | 5 +
3 files changed, 181 insertions(+), 1 deletions(-)
diff --git a/opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml b/opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml
index 9429dab..08f569c 100755
--- a/opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml
+++ b/opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml
@@ -45,7 +45,10 @@
file="'%s/testcases/dsconfig/dsconfig_list.xml' % (TESTS_DIR)"/>
<call function="'dsconfig_list'" />
-
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/dsconfig/dsconfig_get.xml' % (TESTS_DIR)"/>
+ <call function="'dsconfig_get'" />
+
</sequence>
</block>
diff --git a/opends/tests/functional-tests/testcases/dsconfig/dsconfig_get.xml b/opends/tests/functional-tests/testcases/dsconfig/dsconfig_get.xml
new file mode 100644
index 0000000..27d493b
--- /dev/null
+++ b/opends/tests/functional-tests/testcases/dsconfig/dsconfig_get.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE stax SYSTEM "../../shared/stax.dtd">
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License"). You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ ! Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ ! Portions Copyright 2006-2007 Sun Microsystems, Inc.
+ ! -->
+<stax>
+
+ <defaultcall function="dsconfig_get"/>
+
+ <function name="dsconfig_get">
+
+ <sequence>
+
+ <block name="'dsconfig-get'">
+
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='aci'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/dsconfig/dsconfig_setup.xml' % (TESTS_DIR)"/>
+ <call function="'dsconfig_setup'" />
+
+
+ <script>
+ componentList = []
+
+ f = open('%s/testcases/dsconfig/get.dat' % (TESTS_DIR),'r')
+ for line in f.readlines():
+ if line.startswith('#'):
+ continue
+ else:
+ lineSingle = line.split(':')
+ componentList.append(lineSingle)
+
+ componentNumber=0
+ testNumber=0
+ </script>
+ <iterate var="dummyIndex" in="componentList">
+ <sequence>
+ <script>
+ thisTestname = componentList[componentNumber][0] + ", " + componentList[componentNumber][2]
+ </script>
+ <testcase name="getTestCaseName(thisTestname)" >
+ <sequence>
+ <message>
+ 'Getting component %s, %s, %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2], componentList[componentNumber][3], componentList[componentNumber][4])
+ </message>
+
+ <call function="'dsconfig'">
+ { 'location' : location ,
+ 'dsPath' : dsPath ,
+ 'dsInstanceHost' : dsInstanceHost ,
+ 'dsInstancePort' : dsInstancePort ,
+ 'dsInstanceDn' : dsInstanceDn ,
+ 'dsInstancePswd' : dsInstancePswd ,
+ 'subcommand' : '%s' % componentList[componentNumber][0] ,
+ 'objectType' : '%s' % componentList[componentNumber][1] ,
+ 'objectName' : '%s' % componentList[componentNumber][2] ,
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : componentList[componentNumber][3] ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : componentList[componentNumber][4] }
+ </call>
+
+
+ </sequence>
+ </testcase>
+ <script>
+ componentNumber=componentNumber+1
+ </script>
+ </sequence>
+ </iterate>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/dsconfig/dsconfig_cleanup.xml' % (TESTS_DIR)"/>
+ <call function="'dsconfig_cleanup'" />
+
+
+ <call function="'testSuite_Postamble'"/>
+
+ </sequence>
+ </block>
+ </sequence>
+ </function>
+
+</stax>
diff --git a/opends/tests/functional-tests/testcases/dsconfig/get.dat b/opends/tests/functional-tests/testcases/dsconfig/get.dat
new file mode 100644
index 0000000..fc06ce1
--- /dev/null
+++ b/opends/tests/functional-tests/testcases/dsconfig/get.dat
@@ -0,0 +1,49 @@
+get-account-status-notification-handler-prop:handler-name:Error Log Handler:account-status-notification-type:notification-handler-class:
+get-attribute-syntax-prop:syntax-name:Absolute Subtree Specification:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Attribute Type Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Authentication Password:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Binary:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Bit String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Boolean:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Certificate:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Certificate List:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Certificate Pair:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Country String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Delivery Method:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Directory String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Distinguished Name:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:DIT Content Rule Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:DIT Structure Rule Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Enhanced Guide:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Facsimile Telephone Number:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Fax:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Generalized Time:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Guide:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:IA5 String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Integer:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:JPEG:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:LDAP Syntax Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Matching Rule Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Matching Rule Use Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Name and Optional UID:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Name Form Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Numeric String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Object Class Description:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Object Identifier:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Octet String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Other Mailbox:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Postal Address:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Presentation Address:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Printable String:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Protocol Information:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Relative Subtree Specification:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Substring Assertion:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Subtree Specification:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Sun-defined Access Control Information:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Supported Algorithm:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Telephone Number:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Teletex Terminal Identifier:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:Telex Number:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:User Password:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:UTC Time:enabled:syntax-class:
+get-attribute-syntax-prop:syntax-name:UUID:enabled:syntax-class:
\ No newline at end of file
--
Gitblit v1.10.0