<!--- Define default value for basedn --> basedn1 = 'ou=people,ou=password tests,'
basedn = '%s o=Pwd Validator Tests,dc=example,dc=com' % basedn1
msg = 'Security: Pwd Validator: Dictionary:'
<!--- Test Case information #@TestName Dictionary: Preamble #@TestPurpose Preamble Enabling Dictionary Validator #@TestStep Admin Enabling Dictionary modifyPwdValidator #@TestStep Admin Enabling Validator modifyPwdPolicy password-validator:Dictionary #@TestResult Success if the 2 tests are PASS <
testcase name="getTestCaseName('Dictionary: Preamble')">
<
call function="'testCase_Preamble'"/>
'%s Preamble - Admin Enabling Dictionary' % msg
<
call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Dictionary' ,
'attributeName' : 'enabled' ,
'attributeValue' : 'true' ,
'%s Preamble - Admin Enabling Validator' % msg
<
call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'password-validator' ,
'attributeValue' : 'Dictionary' }
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName Dictionary: user modifying password to a #@TestPurpose dictionary string with all letters #@TestStep user modifying password to string with all letters matching a dictionary word zymochemistry RC 53 #@TestStep user binding with invalid password RC 49 #@TestResult Success if the 2 tests are PASS <
testcase name="getTestCaseName ('Dictionary: user modifying password to string with all letters')">
<
call function="'testCase_Preamble'"/>
'%s user modifying password to string with all letters' % msg
<
call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn,
'dsInstancePswd' : 'inflict' ,
'dsAuthzID' : 'dn:uid=abergin, %s' % basedn,
'dsNewPassword' : 'zymochemistry' ,
'%s user binding with invalid password' % msg
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn,
'dsInstancePswd' : 'zymochemistry' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName Dictionary: user modifying password to a Reverse #@TestPurpose dictionary string with reverse password #@TestStep user modifying password to a reverse password from inflict to tcilfni RC 53 #@TestStep user binding with invalid password RC 49 #@TestResult Success if the 2 tests are PASS <
testcase name="getTestCaseName('Dictionary: Using Using Reverse Password')">
<
call function="'testCase_Preamble'"/>
'%s user modifying password to reverse password' % msg
<
call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn,
'dsInstancePswd' : 'inflict' ,
'dsAuthzID' : 'dn:uid=abergin, %s' % basedn ,
'dsNewPassword' : 'tcilfni' ,
'%s user binding with invalid password' % msg
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn ,
'dsInstancePswd' : 'tcilfni' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base',
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName Dictionary: Disable Reverse Password #@TestPurpose Disable Reverse Password and test #@TestStep Disable Reverse Password set test-reversed-password #@TestStep user modifying password to a reverse password from inflict to tcilfni RC 0 #@TestStep user binding with valid password RC 0 #@TestResult Success if the 3 tests are PASS <
testcase name="getTestCaseName('Dictionary: Disable Reverse Password')">
<
call function="'testCase_Preamble'"/>
'Security: Pwd Validator: Dictionary: Disable Reverse Password'
<
call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Dictionary' ,
'attributeName' : 'test-reversed-password' ,
'attributeValue' : 'false' ,
<
call function="'testCase_Postamble'"/>
<
testcase name="getTestCaseName('Dictionary: Using Reverse Password 2')">
<
call function="'testCase_Preamble'"/>
'%s user modifying password to reverse password 2' % msg
<
call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn,
'dsInstancePswd' : 'inflict' ,
'dsAuthzID' : 'dn:uid=abergin, %s' % basedn ,
'dsNewPassword' : 'tcilfni' }
'%s user binding with valid password' % msg
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn ,
'dsInstancePswd' : 'tcilfni' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName Dictionary: Postamble #@TestPurpose Postamble Disabling Dictionary Validator #@TestStep Admin Disabling Validator modifyPwdPolicy remove password-validator:Dictionary #@TestStep User Changing Password with zymochemistry RC 0 #@TestStep User Searching with valid Password RC 0 #@TestResult Success if the 2 tests are PASS <
testcase name="getTestCaseName('Dictionary: Postamble')">
<
call function="'testCase_Preamble'"/>
'%s Postamble Step 1. Admin Disabling Validator' % msg
<
call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'password-validator' ,
'attributeValue' : 'Dictionary' ,
'modifyType' : 'remove' }
<
call function="'modifyPwdValidator'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Dictionary' ,
'attributeName' : 'enabled' ,
'attributeValue' : 'false' ,
<
call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'list-password-validators' ,
returnString = STAXResult[0][1]
<
call function="'checktestString'">
{ 'returnString' : returnString ,
'expectedString' : 'dictionary : false' }
<!--- User Change Password --> '%s Postamble Step 2. User Changing Password' % msg
<
call function="'ldapPasswordModifyWithScript'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'dn:uid=abergin,%s' % basedn ,
'dsInstancePswd' : 'tcilfni' ,
'dsAuthzID' : 'dn:uid=abergin, %s' % basedn,
'dsNewPassword' : 'chemistry' }
'%s Postamble Step 3. User Searching With Password' % msg
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=abergin,%s' % basedn ,
'dsInstancePswd' : 'zymochemistry' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
<
call function="'testCase_Postamble'"/>