#@TestStep Check for existence of ds-cfg-allow-pre-encoded-passwords and value is set to false #@TestResult Success if the test is PASS <
function name="pwp_preemcoded_pwds_001" scope="local">
<
testcase name="getTestCaseName('PWP Get Preencoded Password')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : '%s Get Allow Pre-encoded Password Property.' % msg1 }
dsconfigOptions=' '.join(options)
<
call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'get-password-policy-prop',
'optionsString' : dsconfigOptions,
'expectedString' : 'allow-pre-encoded-passwords : false'
<
call function="'testStep'">
{ 'stepMessage' : '%s Get Allow Pre-encoded Password Attribute.' % msg1 }
<
call function="'compareEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'attrToBeCompared' : 'ds-cfg-allow-pre-encoded-passwords:false',
'entryToBeCompared': basepwp }
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Preencoded Passwords #@TestName Add Entry With Pre-encoded Password #@TestPurpose Adding New Entry With a Pre-encoded Password #@TestResult Success if the test is PASS <
function name="pwp_preemcoded_pwds_002" scope="local">
<
testcase name="getTestCaseName('PWP Default - Add New Entry')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : '%s Adding New Entry With a Pre-encoded Password.' % msg1 }
<
call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=pguy,%s' % basedn ,
'dsInstancePswd' : 'superguy' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Preencoded Passwords #@TestName Enable Pre-encoded Passwords in pwd policy #@TestPurpose Admin Enabling Preencoded Passwords #@TestStep set allow-pre-encoded-passwords to true #@TestResult Success if the test is PASS <
function name="pwp_preemcoded_pwds_003" scope="local">
<
testcase name="getTestCaseName('PWP Enable Preencoded Passwords')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : '%s Set Allow Pre-encoded Password to true.' % msg1 }
dsconfigOptions=' '.join(options)
<
call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-password-policy-prop',
'optionsString' : dsconfigOptions
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Preencoded Passwords #@TestName Test Enabled Pre-encoded Passwords #@TestPurpose Test Enabled Pre-encoded Passwords #@TestResult Success if the test is PASS <
function name="pwp_preemcoded_pwds_004" scope="local">
<
testcase name="getTestCaseName('PWP Enabled - Add New Entry')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : '%s Add New Entry With Pre-encoded Password.' % msg1 }
<
call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=pguy,%s' % basedn ,
'dsInstancePswd' : 'superguy' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' }
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker Preencoded Passwords #@TestName Reset Pre-encoded Passwords #@TestPurpose Admin Reset Pre-encoded Passwords #@TestStep Disable Pre-encoded Passwords 0 #@TestResult Success if the test is PASS <
function name="pwp_preemcoded_pwds_005" scope="local">
<
testcase name="getTestCaseName('PWP Disable Preencoded Passwords')">
<
call function="'testCase_Preamble'"/>
'Test Name = %s' % STAXCurrentTestcase
<
call function="'testStep'">
{ 'stepMessage' : '%s Reset Allow Pre-encoded Password.' % msg1 }
dsconfigOptions=' '.join(options)
<
call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-password-policy-prop',
'optionsString' : dsconfigOptions
<
call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'uid=pgal,%s' % basedn ,
'dsInstancePswd' : 'supergal' ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-s base' ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>