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

el_kaboing
08.41.2006 896fcb118400d134d48509bd382cc400e3010850
Adding functional tests for Issue 322.
4 files added
1 files modified
368 ■■■■■ changed files
opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_BASE64.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_storage/user_add_pwd.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_storage/user_change_pwd_mult_schemes.ldif 29 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml 277 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml 4 ●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_BASE64.ldif
New file
@@ -0,0 +1,29 @@
# 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 Sun Microsystems, Inc.
#
dn: cn=Default Password Policy,cn=Password Policies,cn=config
changetype: modify
add: ds-cfg-default-password-storage-scheme
ds-cfg-default-password-storage-scheme: BASE64
opends/tests/functional-tests/shared/data/security/pwd_storage/user_add_pwd.ldif
New file
@@ -0,0 +1,29 @@
# 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 Sun Microsystems, Inc.
#
dn: uid=bhall,ou=People,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com
changetype: modify
add: userpassword
userpassword: anotherorange
opends/tests/functional-tests/shared/data/security/pwd_storage/user_change_pwd_mult_schemes.ldif
New file
@@ -0,0 +1,29 @@
# 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 Sun Microsystems, Inc.
#
dn: uid=bhall,ou=People,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: manyoranges
opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml
New file
@@ -0,0 +1,277 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "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 Sun Microsystems, Inc.
 -->
<stax>
  <defaultcall function="multiple_schemes"/>
  <function name="multiple_schemes">
      <sequence>
        <!--- Test case: Admin Add Base64 Storage Scheme -->
        <testcase name="'Security: Mult Pwd Schemes: Preamble'">
          <sequence>
            <message>
               'Security: Multiple Pwd Schemes: Preamble - Admin Adding BASE64 Storage Scheme'
            </message>
            <call function="'modifyEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'entryToBeModified'   : '%s/security/pwd_storage/admin_add_BASE64.ldif' % STAGED_DATA_DIR }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : Check for Multi-value for Pwd Schemes - SSHA-->
        <testcase name="'Security: Mult Pwd Schemes: Check Pwd Schemes - SSHA'">
          <sequence>
            <message>
               'Security: Multiple Pwd Schemes: Checking for Password Schemes - SSHA'
            </message>
            <call function="'SearchObject'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'dsBaseDN'         : 'cn=Default Password Policy,cn=Password Policies,cn=config' ,
                'dsFilter'         : 'objectclass=*'  ,
                'attributes'      : 'ds-cfg-default-password-storage-scheme' }
            </call>
            <script>
             returnString = STAXResult[0][1]
            </script>
            <call function="'checktestString'">
                { 'returnString'       : returnString ,
                  'expectedString'     : 'SSHA' }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : Check for Multi-value for Pwd Schemes - BASE64-->
        <testcase name="'Security: Mult Pwd Schemes: Check Pwd Schemes - BASE64'">
          <sequence>
            <message>
               'Security: Multiple Pwd Schemes: Checking for Password Schemes - BASE64'
            </message>
            <call function="'SearchObject'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'dsBaseDN'         : 'cn=Default Password Policy,cn=Password Policies,cn=config' ,
                'dsFilter'         : 'objectclass=*'  ,
                'attributes'      : 'ds-cfg-default-password-storage-scheme' }
            </call>
            <script>
             returnString = STAXResult[0][1]
            </script>
            <call function="'checktestString'">
                { 'returnString'       : returnString ,
                  'expectedString'     : 'BASE64' }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : User Change Password Multiple Schemes-->
        <testcase name="'Security: Mult Pwd Schemes: Pwd Change'">
          <sequence>
            <message>
               'Security: Multiple Pwd Schemes: User Changing Password'
            </message>
            <call function="'modifyEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : 'uid=bhall,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
                'dsInstancePswd'   : 'oranges' ,
                'entryToBeModified'   : '%s/security/pwd_storage/user_change_pwd_mult_schemes.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Multiple Pwd Schemes: User Binding With New Password'
            </message>
            <call function="'SearchObject'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : 'uid=bhall,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
                'dsInstancePswd'   : 'manyoranges' ,
                'dsBaseDN'   : 'dc=example,dc=com' ,
                'dsFilter'         : 'objectclass=*'  ,
                'extraParams'      : '-s base' }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Multiple Pwd Schemes: Checking for SSHA Scheme On New Password'
            </message>
            <call function="'SearchObject'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'dsBaseDN'         : 'uid=bhall,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
                'dsFilter'         : 'objectclass=*'  ,
                'attributes'      : 'userpassword' }
            </call>
            <script>
             returnString = STAXResult[0][1]
            </script>
            <call function="'checktestString'">
                { 'returnString'       : returnString ,
                  'expectedString'     : '{SSHA}' }
            </call>
          </sequence>
        </testcase>
        <testcase name="'Security: Mult Pwd Schemes: Check for Second Scheme On Pwd Change'">
          <sequence>
            <message>
               'Security: Multiple Pwd Schemes: Checking for BASE64 Scheme On New Password'
            </message>
            <call function="'SearchObject'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'dsBaseDN'         : 'uid=bhall,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
                'dsFilter'         : 'objectclass=*'  ,
                'attributes'      : 'userpassword' }
            </call>
            <script>
             returnString = STAXResult[0][1]
            </script>
            <call function="'checktestString'">
                { 'returnString'       : returnString ,
                  'expectedString'     : '{BASE64}' }
            </call>
          </sequence>
        </testcase>
        <!--- Test Case : User Improperly Add a Password-->
        <testcase name="'Security: Mult Pwd Schemes: Improper Pwd Add'">
          <sequence>
            <message>
               'Security: Multiple Pwd Schemes: User Improperly Add Password'
            </message>
            <call function="'modifyEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : 'uid=bhall,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
                'dsInstancePswd'   : 'manyoranges' ,
                'entryToBeModified'   : '%s/security/pwd_storage/user_add_pwd.ldif' % STAGED_DATA_DIR }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult ,
                  'expected'   : 53 }
            </call>
          </sequence>
        </testcase>
        <!--- Test case: Admin Reset To SSHA Storage Scheme -->
        <testcase name="'Security: Mult Pwd Schemes: Postamble'">
          <sequence>
            <message>
               'Security: Mult Pwd Schemes: Postamble - Admin Resetting to SSHA Storage Scheme'
            </message>
            <call function="'modifyEntry'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'entryToBeModified'   : '%s/security/pwd_storage/admin_reset_SSHA.ldif' % STAGED_DATA_DIR }
            </call>
            <if expr="RC != 0">
                <tcstatus result="'fail'"/>
            </if>
            <message>
               'Security: Multiple Pwd Schemes: User Bind Final'
            </message>
            <call function="'SearchObject'">
              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : 'uid=bhall,ou=people,ou=password tests,o=Pwd Storage Tests,dc=example,dc=com' ,
                'dsInstancePswd'   : 'manyoranges' ,
                'dsBaseDN'   : 'dc=example,dc=com' ,
                'dsFilter'         : 'objectclass=*'  ,
                'extraParams'      : '-s base' }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
          </sequence>
        </testcase>
        <return>RC</return>
     </sequence>
  </function>
</stax>
opends/tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml
@@ -109,6 +109,10 @@
        <call function="'pwd_CLEAR'" />
        <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
          file="'%s/testcases/security/pwd_storage/security_multiple_schemes.xml' % (TESTS_DIR)"/>
        <call function="'multiple_schemes'" />
        <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
          file="'%s/testcases/security/pwd_storage/security_teardown_pwd_storage.xml' % (TESTS_DIR)"/>
        <call function="'teardown_pwd_storage'" />