5789N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5789N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5789N/A<!--
5789N/A ! CDDL HEADER START
5789N/A !
5789N/A ! The contents of this file are subject to the terms of the
5789N/A ! Common Development and Distribution License, Version 1.0 only
5789N/A ! (the "License"). You may not use this file except in compliance
5789N/A ! with the License.
5789N/A !
6982N/A ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A ! or http://forgerock.org/license/CDDLv1.0.html.
5789N/A ! See the License for the specific language governing permissions
5789N/A ! and limitations under the License.
5789N/A !
5789N/A ! When distributing Covered Code, include this CDDL HEADER in each
6982N/A ! file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A ! If applicable, add the following below this CDDL HEADER, with the
6982N/A ! fields enclosed by brackets "[]" replaced with your own identifying
6982N/A ! information:
5789N/A ! Portions Copyright [yyyy] [name of copyright owner]
5789N/A !
5789N/A ! CDDL HEADER END
5789N/A !
5789N/A ! Copyright 2006-2008 Sun Microsystems, Inc.
5789N/A ! Portions copyright 2012 ForgeRock AS.
5789N/A ! -->
5789N/A<stax>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Create New Password Policy
5789N/A #@TestIssue None
5789N/A #@TestPurpose Create a Non Default Password Policy
5789N/A #@TestPreamble None
5789N/A #@TestStep Create a new Password Policy called Sales
5789N/A #@TestStep Set default-password-storage-schemeSalted SHA-1
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if dsconfig returns 0
5789N/A -->
5789N/A <function name="pwp_non_default_001" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Create New Password Policy')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Add Sales Password Policy.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Sales Password Policy"')
5789N/A options.append('--type "password-policy"')
5789N/A options.append('--set "default-password-storage-scheme:Salted SHA-1"')
5789N/A options.append('--set "password-attribute:userPassword"')
5789N/A
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'create-password-policy',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Adding New Entry With Sales Password Policy
5789N/A #@TestIssue None
5789N/A #@TestPurpose Adding New Entry With Sales Password Policy
5789N/A #@TestPreamble None
5789N/A #@TestStep addEntry add_sales_person.ldif
5789N/A SearchObject with uid=sguy returns 0
5789N/A SearchObject with uid=sgal eturns 0
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_non_default_002" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Add New Entry Using Sales Password Policy')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Add New Entry Using Sales Password Policy.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <call function="'addEntry'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'entryToBeAdded' : '%s/password_policy/add_sales_person.ldif' \
5789N/A % remote.data }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=sguy,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'superguy' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=sgal,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'supergal' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Modify Sales Password Policy
5789N/A #@TestIssue None
5789N/A #@TestPurpose Admin Changing Sales Lockout Count
5789N/A #@TestPreamble None
5789N/A #@TestStep Set lockout-failure-count to 3
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if dsconfig returns 0
5789N/A -->
5789N/A <function name="pwp_non_default_003" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Modify Sales Password Policy')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Set Lockout Failure Count to 3.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Sales Password Policy"')
5789N/A options.append('--set "lockout-failure-count:3"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'set-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Test Sales Password Policy
5789N/A #@TestIssue None
5789N/A #@TestPurpose Test Sales Password Policy
5789N/A #@TestPreamble None
5789N/A #@TestStep Testing Sales Password Policy with Lockout Count
5789N/A search with bad pwd 3x good pwd 1x
5789N/A SearchObject returns 49 4x
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_non_default_004" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Test Sales Password Policy')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Test New Sales Password Policy Lockout Count.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A search_pwds = ['bad', 'bad', 'bad', 'superguy']
5789N/A </script>
5789N/A
5789N/A <iterate var="pwds" in="search_pwds" indexvar="index">
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=sguy,%s' % basedn ,
5789N/A 'dsInstancePswd' : '%s' % pwds ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A </iterate>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Testing Default Password Policy with Lockout Count
5789N/A #@TestIssue None
5789N/A #@TestPurpose Testing Default Password Policy with Lockout Count
5789N/A #@TestPreamble None
5789N/A #@TestStep Testing Default Password Policy with Lockout Count
5789N/A search with bad pwd 3x good pwd 1x
5789N/A SearchObject returns 49 3x
5789N/A SearchObject returns 0 1x
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_non_default_005" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Test Default Password Policy')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Testing Default Password Policy with Lockout Count.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A search_pwds = ['bad', 'bad', 'bad']
5789N/A </script>
5789N/A
5789N/A <iterate var="pwds" in="search_pwds" indexvar="index">
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=tclow,%s' % basedn ,
5789N/A 'dsInstancePswd' : '%s' % pwds ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A </iterate>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=tclow,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'cardreader' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Delete Sales Password Policy
5789N/A #@TestIssue None
5789N/A #@TestPurpose Admin Deleting Sales Lockout Count
5789N/A #@TestPreamble None
5789N/A #@TestStep Admin Deleting Sales Lockout Count
5789N/A dsconfig delete Sales Password Policy
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if dsconfig returns 0
5789N/A -->
5789N/A <function name="pwp_non_default_006" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Delete Sales Password Policy')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Admin Deleting Sales Lockout Count' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Sales Password Policy"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'delete-password-policy',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Non Default Password Policy
5789N/A #@TestName Test Sales Password Policy after Remove
5789N/A #@TestIssue None
5789N/A #@TestPurpose Test Sales Password Policy after Remove
5789N/A #@TestPreamble None
5789N/A #@TestStep Testing Sales Password Policy after removing it
5789N/A #@TestPostamble None
5789N/A #@TestResult Success if SearchObject returns 80 (Other)
5789N/A -->
5789N/A <function name="pwp_non_default_007" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Test Sales Password Policy after Remove')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Test Sales Password Policy after Remove.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=sgal,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'supergal' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 80 }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A</stax>