mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

mkeyes
15.10.2007 209b3870fa8b6e2651dae301a908c18a93e35952
Adding functional tests that test the behavior of the list-xxx-yyy subcommand for dsconfig.
1 files modified
5 files added
406 ■■■■■ changed files
opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml 57 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/dsconfig/dsconfig_cleanup.xml 94 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/dsconfig/dsconfig_list.xml 122 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/dsconfig/dsconfig_setup.xml 103 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/dsconfig/list.dat 24 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/runFuncTests.xml 6 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/dsconfig/dsconfig.xml
New file
@@ -0,0 +1,57 @@
<?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="main_dsconfig"/>
  <function name="main_dsconfig">
    <sequence>
      <block name="'dsconfig'">
        <sequence>
          <script>
            CurrentTestPath['group']='dsconfig'
          </script>
          <import machine="STAF_LOCAL_HOSTNAME"
            file="'%s/testcases/dsconfig/dsconfig_list.xml' % (TESTS_DIR)"/>
          <call function="'dsconfig_list'" />
        </sequence>
      </block>
    </sequence>
  </function>
</stax>
opends/tests/functional-tests/testcases/dsconfig/dsconfig_cleanup.xml
New file
@@ -0,0 +1,94 @@
<?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 2007 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="dsconfig_cleanup"/>
  <function name="dsconfig_cleanup">
    <sequence>
      <block name="'cleanup'">
        <sequence>
          <block name="'Block DS Process Stop'">
          <!--- Stop DS -->
            <sequence>
              <message>
                 'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
              </message>
              <call function="'StopDsWithScript'">
                { 'location'  : STAF_REMOTE_HOSTNAME,
                  'dsHost'    : DIRECTORY_INSTANCE_HOST,
                  'dsPort'    : DIRECTORY_INSTANCE_PORT,
                  'dsBindDN'  : DIRECTORY_INSTANCE_DN,
                  'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
              </call>
              <call function="'checkRC'">
                  { 'returncode' : RC ,
                    'result'     : STAXResult }
              </call>
            </sequence>
          <!--- End Block DS Process Stop -->
          </block>
          <block name="'Block Remove DS Topology'">
          <!-- Remove  the topology created for the test suite -->
            <sequence>
              <message>
                 'Remove DS topology created for the Test Suite'
              </message>
              <call function="'removeTopology'"/>
              <call function="'checkRC'">
                  { 'returncode' : RC ,
                    'result'     : STAXResult }
              </call>
            </sequence>
          <!-- End Block Remove DS Topology-->
          </block>
        </sequence>
      </block>
     </sequence>
  </function>
</stax>
opends/tests/functional-tests/testcases/dsconfig/dsconfig_list.xml
New file
@@ -0,0 +1,122 @@
<?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_list"/>
  <function name="dsconfig_list">
    <sequence>
      <block name="'dsconfig-list'">
        <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/list.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>
            <testcase name="'%s: %s' % ( CurrentTestPath['group'], componentList[componentNumber][0] )" >
              <sequence>
                <message>
                    'Listing component %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2])
                </message>
                <call function="'dsconfig'">
                {   'location'       :  location ,
                    'dsPath'         :  dsPath ,
                    'dsInstanceHost' :  dsInstanceHost ,
                    'dsInstancePort' :  dsInstancePort ,
                    'dsInstanceDn'   :  dsInstanceDn ,
                    'dsInstancePswd' :  dsInstancePswd ,
                    'subcommand'     :  '%s' % componentList[componentNumber][0] ,
                    'expectedRC'     : 0
                }
                </call>
                <script>
                 returnString = STAXResult[0][1]
                </script>
                <call function="'searchStringForSubstring'">
                    { 'returnString'       : returnString ,
                      'testString'         : componentList[componentNumber][1]  ,
                      'expectedResult'     : '1' }
                </call>
                <call function="'checktestString'">
                    { 'returnString'       : returnString ,
                      'expectedString'     : componentList[componentNumber][2] }
                </call>
                <script>
                    componentNumber=componentNumber+1
                </script>
              </sequence>
            </testcase>
          </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>
opends/tests/functional-tests/testcases/dsconfig/dsconfig_setup.xml
New file
@@ -0,0 +1,103 @@
<?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 2007 Sun Microsystems, Inc.
 ! -->
<stax>
  <defaultcall function="dsconfig_setup"/>
  <function name="dsconfig_setup">
    <sequence>
      <block name="'setup'">
        <sequence>
          <script>
            CurrentTestPath['group']='dsconfig'
          </script>
          <block name="'Block Create DS Topology'">
          <!-- Create the topology necessary to the test group/suite -->
            <sequence>
              <message>
                 'Create DS topology as described in config.py'
              </message>
              <call function="'createTopology'">
                { 'initialiseInstance' : True }
              </call>
              <call function="'checkRC'">
                  { 'returncode' : RC ,
                    'result'     : STAXResult }
              </call>
            </sequence>
          <!--- End Block Create DS Topology -->
          </block>
          <block name="'Block DS Process Active'">
          <!--- Start DS -->
            <sequence>
              <message>
                 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
              </message>
              <!--- Start DS -->
              <call function="'StartDsWithScript'">
               { 'location'  : STAF_REMOTE_HOSTNAME }
              </call>
              <call function="'checkRC'">
                  { 'returncode' : RC ,
                    'result'     : STAXResult }
              </call>
              <!--- Check that DS started -->
              <call function="'isAlive'">
                { 'noOfLoops'        : 5 ,
                  'noOfMilliSeconds' : 2000 }
              </call>
            </sequence>
          <!--- End Block DS Process Active -->
          </block>
        </sequence>
      </block>
     </sequence>
  </function>
</stax>
opends/tests/functional-tests/testcases/dsconfig/list.dat
New file
@@ -0,0 +1,24 @@
list-account-status-notification-handlers:Account Status Notification Handler:Error Log Handler:
list-alert-handlers:Alert Handler:JMX Alert Handler:
list-attribute-syntaxes:Attribute Syntax:Object Class Description:
list-backends:monitor:tasks:
list-certificate-mappers:Fingerprint Mapper:Subject Attribute to User Attribute:
list-connection-handlers:LDAP Connection Handler:LDAPS Connection Handler:
list-extended-operation-handlers:Get Connection ID:Password Policy State:
list-group-implementations:Dynamic:Static:
list-identity-mappers:Exact Match:Regular Expression:
list-key-managers:JKS:PKCS12:
list-log-publishers:File-Based Audit Logger:File-Based Error Logger:
list-log-retention-policies:File Count Retention Policy:Free Disk Space Retention Policy:
list-log-rotation-policies:24 Hours Time Limit Rotation Policy:7 Days Time Limit Rotation Policy:
list-matching-rules:Case Exact Equality Matching Rule:Numeric String Equality Matching Rule:
list-monitor-providers:Client Connections:System Info:
list-password-generators:Password Generator:Random Password Generator:
list-password-policies:Default Password Policy:Root Password Policy:
list-password-storage-schemes:Salted SHA-256:MD5:
list-password-validators:Attribute Value:Character Set:
list-plugins:Entry UUID:Password Policy Import:
list-sasl-mechanism-handlers:CRAM-MD5:GSSAPI:
list-synchronization-providers:Synchronization Provider:Type:
list-trust-managers:Blind Trust:JKS:
list-virtual-attributes:entryUUID:isMemberOf:
opends/tests/functional-tests/testcases/runFuncTests.xml
@@ -54,6 +54,12 @@
      -->
      <import machine="STAF_LOCAL_HOSTNAME"
              file="'%s/testcases/dsconfig/dsconfig.xml' % TESTS_DIR" />
      <!--
      <call function="'main_dsconfig'" />
      -->
      <import machine="STAF_LOCAL_HOSTNAME"
              file="'%s/testcases/backends/backends.xml' % TESTS_DIR" />
      <!--
      <call function="'main_backends'" />