From 00a8487a4400ee6c3b2b62d8adebb0cbd75a94ab Mon Sep 17 00:00:00 2001
From: mkeyes <mkeyes@localhost>
Date: Thu, 02 Aug 2007 13:48:52 +0000
Subject: [PATCH] Converted more Security functional test cases to use dsconfig.

---
 /dev/null                                                                                           |   36 ---------
 opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml |   17 ++-
 opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml          |   17 ++-
 opends/tests/functional-tests/testcases/security/pwd_storage/security_deprecated_schemes.xml        |   40 ++++++++--
 opends/tests/functional-tests/testcases/security/pwd_policy/security_last_login.xml                 |   82 +++++++++++---------
 5 files changed, 97 insertions(+), 95 deletions(-)

diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_disable_last-login-time-attr.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_disable_last-login-time-attr.ldif
deleted file mode 100644
index 0da6e52..0000000
--- a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_disable_last-login-time-attr.ldif
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-
-dn: cn=Default Password Policy,cn=Password Policies,cn=config
-changetype: modify
-delete: ds-cfg-last-login-time-attribute
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_disable_last-login-time-format.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_disable_last-login-time-format.ldif
deleted file mode 100644
index 9ea04d8..0000000
--- a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_disable_last-login-time-format.ldif
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-
-dn: cn=Default Password Policy,cn=Password Policies,cn=config
-changetype: modify
-delete: ds-cfg-last-login-time-format
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_by_time.ldif b/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_by_time.ldif
deleted file mode 100644
index 91a2fe5..0000000
--- a/opends/tests/functional-tests/shared/data/security/pwd_policy/admin_reset_force_pwd_by_time.ldif
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-
-dn: cn=Default Password Policy,cn=Password Policies,cn=config
-changetype: modify
-delete: ds-cfg-require-change-by-time
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_BASE64.ldif b/opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_BASE64.ldif
deleted file mode 100644
index 584e88b..0000000
--- a/opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_BASE64.ldif
+++ /dev/null
@@ -1,29 +0,0 @@
-# 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.
-#
-
-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
diff --git a/opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_many_schemes.ldif b/opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_many_schemes.ldif
deleted file mode 100644
index b3c8fbe..0000000
--- a/opends/tests/functional-tests/shared/data/security/pwd_storage/admin_add_many_schemes.ldif
+++ /dev/null
@@ -1,36 +0,0 @@
-# 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.
-#
-
-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: MD5
--
-add: ds-cfg-default-password-storage-scheme
-ds-cfg-default-password-storage-scheme: BASE64
--
-add: ds-cfg-default-password-storage-scheme
-ds-cfg-default-password-storage-scheme: SSHA256
-
diff --git a/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml b/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml
index 3438842..3e6e0fd 100755
--- a/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml
+++ b/opends/tests/functional-tests/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml
@@ -167,14 +167,17 @@
                'Security: Pwd Change: Admin Resetting Pwd Time Exp'
             </message>
 
-            <call function="'modifyEntry'">
-              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
-                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
-                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
-                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                'entryToBeModified'   : '%s/security/pwd_policy/admin_reset_force_pwd_by_time.ldif' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'require-change-by-time' ,
+                    'attributeValue'         : '20061030183752.848Z' ,
+                    'modifyType'             : 'remove' }
             </call>
-
+            
             <message>
                'Security: Pwd Change: User Searching With Password'
             </message>
diff --git a/opends/tests/functional-tests/testcases/security/pwd_policy/security_last_login.xml b/opends/tests/functional-tests/testcases/security/pwd_policy/security_last_login.xml
index a9336a5..8ed0ac7 100755
--- a/opends/tests/functional-tests/testcases/security/pwd_policy/security_last_login.xml
+++ b/opends/tests/functional-tests/testcases/security/pwd_policy/security_last_login.xml
@@ -122,15 +122,17 @@
             <message>
                'Security: Last Login: Admin Disable Last Login Attribute Only'
             </message>
-
-            <call function="'modifyEntry'">
-              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
-                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
-                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
-                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                'entryToBeModified'   : '%s/security/pwd_policy/admin_disable_last-login-time-attr.ldif' % logsRemoteDataDir }
+            
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'last-login-time-attribute' ,
+                    'modifyType'             : 'reset' }
             </call>
-
+            
             <message>
                'Security: Last Login: Admin Enable Last Login Format Only'
             </message>
@@ -705,14 +707,16 @@
                'Security: Last Login: Long Idle Lockout - Disabled Last Login Step 1. Disable Last Login'
             </message>
 
-            <call function="'modifyEntry'">
-              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
-                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
-                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
-                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                'entryToBeModified'   : '%s/security/pwd_policy/admin_disable_last-login-time-attr.ldif' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'last-login-time-attribute' ,
+                    'modifyType'             : 'reset' }
             </call>
-
+            
             <message>
                'Security: Last Login: Long Idle Lockout - Disabled Last Login Step 2. Check User Bind'
             </message>
@@ -842,14 +846,16 @@
                'Security: Last Login: Long Idle Lockout - Disabled Last Login 2 Step 1. Disable Last Login'
             </message>
 
-            <call function="'modifyEntry'">
-              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
-                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
-                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
-                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                'entryToBeModified'   : '%s/security/pwd_policy/admin_disable_last-login-time-format.ldif' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'last-login-time-format' ,
+                    'modifyType'             : 'reset' }
             </call>
-
+            
             <message>
                'Security: Last Login: Long Idle Lockout - Disabled Last Login 2 Step 2. Check User Bind'
             </message>
@@ -1268,15 +1274,16 @@
                'Security: Last Login: Long Idle Lockout - Pwd Change Override 3 Step 1. Disable Last Login'
             </message>
 
-            <call function="'modifyEntry'">
-              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
-                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
-                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
-                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                'entryToBeModified'   : '%s/security/pwd_policy/admin_disable_last-login-time-format.ldif' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'last-login-time-format' ,
+                    'modifyType'             : 'reset' }
             </call>
-
-
+            
             <message>
                'Security: Last Login: Long Idle Lockout - Pwd Change Override 3 Step 2. Check User Bind'
             </message>
@@ -1377,14 +1384,15 @@
                'Security: Last Login: Postamble Step 2. Admin Disabling Last Login Time Attribute'
             </message>
 
-            <call function="'modifyEntry'">
-              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
-                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
-                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
-                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
-                'entryToBeModified'   : '%s/security/pwd_policy/admin_disable_last-login-time-attr.ldif' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'last-login-time-attribute' ,
+                    'modifyType'             : 'reset' }
             </call>
-
             
             <message>
                'Security: Last Login: Postamble Step 3. User Binding'
diff --git a/opends/tests/functional-tests/testcases/security/pwd_storage/security_deprecated_schemes.xml b/opends/tests/functional-tests/testcases/security/pwd_storage/security_deprecated_schemes.xml
index 706274e..8a28284 100755
--- a/opends/tests/functional-tests/testcases/security/pwd_storage/security_deprecated_schemes.xml
+++ b/opends/tests/functional-tests/testcases/security/pwd_storage/security_deprecated_schemes.xml
@@ -64,15 +64,39 @@
                'Security: Deprecated Pwd Schemes: Preamble Step 1. Admin Adding 3 Pwd Storage Schemes'
             </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_many_schemes.ldif' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'default-password-storage-scheme' ,
+                    'attributeValue'         : 'MD5' ,
+                    'modifyType'             : 'add' }
             </call>
-
-
+            
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'default-password-storage-scheme' ,
+                    'attributeValue'         : 'BASE64' ,
+                    'modifyType'             : 'add' }
+            </call>
+            
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'default-password-storage-scheme' ,
+                    'attributeValue'         : 'SSHA256' ,
+                    'modifyType'             : 'add' }
+            </call>
+            
             <message>
                'Security: Deprecated Pwd Schemes: Preamble Step 2. User Change Password'
             </message>
diff --git a/opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml b/opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml
index 2de5db0..81e42b4 100755
--- a/opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml
+++ b/opends/tests/functional-tests/testcases/security/pwd_storage/security_multiple_schemes.xml
@@ -60,14 +60,17 @@
                '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' % logsRemoteDataDir }
+            <call function="'modifyPwdPolicy'">
+                  { 'dsInstanceHost'         : DIRECTORY_INSTANCE_HOST ,
+                    'dsInstancePort'         : DIRECTORY_INSTANCE_PORT ,
+                    'dsInstanceDn'           : DIRECTORY_INSTANCE_DN ,
+                    'dsInstancePswd'         : DIRECTORY_INSTANCE_PSWD ,
+                    'propertyName'           : 'Default Password Policy' ,
+                    'attributeName'          : 'default-password-storage-scheme' ,
+                    'attributeValue'         : 'BASE64' ,
+                    'modifyType'             : 'add' }
             </call>
-
+            
             <call function="'testCase_Postamble'"/>
             
           </sequence>

--
Gitblit v1.10.0