From 94f992bfd82bb540b5b057a86a564289a647fce3 Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Tue, 04 Aug 2009 10:14:21 +0000
Subject: [PATCH] refactoring to use different backend types
---
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_startup.ldif | 14
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring.xml | 91
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_schemaExtension.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_7bit.xml | 536
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkoptions.xml | 1163
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_cleanup.xml | 36
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml | 239
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Schema.ldif | 28
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_users.xml | 6396 ++--
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests.xml | 3
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml | 176
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/global_acis.ldif | 41
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_startTLS.xml | 109
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backendsetup.xml | 13
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_cleanup.xml | 48
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_provider.xml | 952
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_lastmod.xml | 40
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema.xml | 65
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_user_tests.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_global_acis.ldif | 13
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/quickstart/quickstart.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_setup.xml | 113
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/groups.xml | 111
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml | 1164
opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml | 16
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci26.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml | 1093
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax.xml | 126
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_pwd_policy_root.xml | 101
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_cleanup.xml | 127
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/security.xml | 127
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml | 705
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml | 1001
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_virtual_static.xml | 1419
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/dynamic/schema_dynamic.xml | 32
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth.xml | 118
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml | 1336
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_teardown_startTLS.xml | 6
opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml | 13
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Exclude.ldif | 28
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_directory_manager.xml | 3753 +-
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml | 608
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml | 181
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml | 578
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif | 28
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_list-backends_checkbehavior.xml | 639
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema_cleanup.xml | 10
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci16.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/core.xml | 5
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci22.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export.xml | 4033 +-
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_dbtest_checkbehavior.xml | 821
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci13.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci5.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_dynamic.xml | 912
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml | 85
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_bob_pkcs12.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_writer.xml | 53
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_jks.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_encode-password_checkbehavior.xml | 1019
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_pkcs12.xml | 104
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import-tasks.xml | 2123
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml | 828
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_uniqueness.xml | 36
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci11.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Include.ldif | 28
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci24.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_setup.xml | 96
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif.gz | 0
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/rfc/schema_rfc.xml | 34
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_uniquemember.xml | 1430
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci3.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml | 421
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_acis.xml | 82
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_bob_startTLS.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_setup_pkcs12.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_setup_startTLS.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup.xml | 392
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export-tasks.xml | 691
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore.xml | 345
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restart_db.xml | 239
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_get.xml | 348
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_jks.xml | 91
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkbehavior.xml | 261
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation_properties.xml | 592
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_authentication.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backends.xml | 65
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci1.xml | 13
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml | 824
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/global_acis.xml | 1734
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/entry_acis.ldif | 41
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_new_root_user.xml | 3717 +-
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_import_task.xml | 869
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_createbackend.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_teardown_pkcs12.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention.xml | 610
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_unindexed_searches.xml | 1320
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci6.xml | 11
opendj-sdk/opends/tests/staf-tests/shared/functions/tools.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_proxy_auth.xml | 99
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging.xml | 96
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml | 132
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_manage-tasks_checkbehavior.xml | 798
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins.xml | 94
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_componant.xml | 239
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_base64_checkbehavior.xml | 316
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import.xml | 2558 +-
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml | 135
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci14.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_refint.xml | 35
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_force_pwd_change_startTLS.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup-tasks.xml | 102
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_entryUUID.xml | 531
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml | 101
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_status_checkbehavior.xml | 195
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_LDAPcmds.xml | 2
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci23.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/allowed-tasks.xml | 169
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci15.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml | 921
opendj-sdk/opends/tests/staf-tests/shared/python/common.py | 1
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldappasswordmodify_checkbehavior.xml | 493
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_properties.xml | 1297
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/solaris/schema_solaris.xml | 32
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks.xml | 141
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci4.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_member.xml | 1579
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_auth.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_setup.xml | 164
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_list.xml | 207
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapdelete_checkbehavior.xml | 263
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu.xml | 115
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci25.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml | 725
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci21.xml | 11
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_entry_acis.ldif | 19
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkoptions.xml | 2285 +-
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/account_activation/security_account_activation.xml | 113
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig.xml | 98
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/virtualAttributes/virtualAttributes.ldif | 4
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci12.xml | 13
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml | 735
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/sasl/security_sasl.xml | 124
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_custom_jks.xml | 6
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml | 405
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention_properties.xml | 621
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/schema_start.ldif | 10
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/tasks.xml | 103
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci2.xml | 13
opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/groups.ldif | 12
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation.xml | 461
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_validator/security_pwd_validator.xml | 157
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_setup.xml | 46
155 files changed, 33,299 insertions(+), 31,361 deletions(-)
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif
index 998f566..929d1af 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
-# Copyright 2006-2008 Sun Microsystems, Inc.
+# Copyright 2006-2009 Sun Microsystems, Inc.
#
#
# dc=com sample LDIF file
@@ -36,12 +36,6 @@
objectclass: top
objectclass: domain
dc: com
-aci: (target ="ldap:///dc=example,dc=com")(targetattr !=
- "userPassword")(version 3.0;acl "Anonymous read-search access";
- allow (read, search, compare)(userdn = "ldap:///anyone");)
-aci: (target="ldap:///dc=example,dc=com") (targetattr =
- "*")(version 3.0; acl "allow all Admin group"; allow(all) groupdn =
- "ldap:///cn=Directory Administrators,ou=Groups,dc=example,dc=com";)
dn: dc=example,dc=com
objectclass: top
@@ -66,26 +60,6 @@
objectclass: top
objectclass: organizationalunit
ou: People
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr =
- "userpassword || telephonenumber || facsimiletelephonenumber")(version 3.0;
- acl "Allow self entry modification";allow (write)(userdn = "ldap:///self");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Accounting)")(version 3.0;
- acl "Accounting Managers Group Permissions";allow (write) (groupdn =
- "ldap:///cn=Accounting Managers,ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Human Resources)")(version 3.0;
- acl "HR Group Permissions";allow (write)(groupdn = "ldap:///cn=HR Managers,
- ou=groups,dc=example,dc=com
- ");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn ||sn || uid")(targetfilter ="(ou=Product Testing)")(version 3.0;
- acl "QA Group Permissions";allow (write)(groupdn = "ldap:///cn=QA Managers,
- ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Product Development)")(version 3.0;
- acl "Engineering Group Permissions";allow (write)(groupdn = "ldap:///
- cn=PD Managers,ou=groups,dc=example,dc=com");)
dn: ou=Special Users,dc=example,dc=com
objectclass: top
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif.gz b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif.gz
index 5cd5a4f..60febd1 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif.gz
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Example.ldif.gz
Binary files differ
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Exclude.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Exclude.ldif
index b2e2126..d51a48e 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Exclude.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Exclude.ldif
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
-# Copyright 2006-2008 Sun Microsystems, Inc.
+# Copyright 2006-2009 Sun Microsystems, Inc.
#
#
# dc=com sample LDIF file
@@ -37,12 +37,6 @@
objectclass: top
objectclass: domain
dc: com
-aci: (target ="ldap:///dc=example,dc=com")(targetattr !=
- "userPassword")(version 3.0;acl "Anonymous read-search access";
- allow (read, search, compare)(userdn = "ldap:///anyone");)
-aci: (target="ldap:///dc=example,dc=com") (targetattr =
- "*")(version 3.0; acl "allow all Admin group"; allow(all) groupdn =
- "ldap:///cn=Directory Administrators,ou=Groups,dc=example,dc=com";)
dn: dc=example,dc=com
objectclass: top
@@ -67,26 +61,6 @@
objectclass: top
objectclass: organizationalunit
ou: People
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr =
- "userpassword || telephonenumber || facsimiletelephonenumber")(version 3.0;
- acl "Allow self entry modification";allow (write)(userdn = "ldap:///self");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Accounting)")(version 3.0;
- acl "Accounting Managers Group Permissions";allow (write) (groupdn =
- "ldap:///cn=Accounting Managers,ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Human Resources)")(version 3.0;
- acl "HR Group Permissions";allow (write)(groupdn = "ldap:///cn=HR Managers,
- ou=groups,dc=example,dc=com
- ");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn ||sn || uid")(targetfilter ="(ou=Product Testing)")(version 3.0;
- acl "QA Group Permissions";allow (write)(groupdn = "ldap:///cn=QA Managers,
- ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Product Development)")(version 3.0;
- acl "Engineering Group Permissions";allow (write)(groupdn = "ldap:///
- cn=PD Managers,ou=groups,dc=example,dc=com");)
dn: ou=Special Users,dc=example,dc=com
objectclass: top
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Include.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Include.ldif
index 40c10b3..1d9c780 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Include.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Include.ldif
@@ -19,7 +19,7 @@
#
# CDDL HEADER END
#
-# Copyright 2006-2008 Sun Microsystems, Inc.
+# Copyright 2006-2009 Sun Microsystems, Inc.
#
#
# dc=com sample LDIF file
@@ -34,12 +34,6 @@
objectclass: top
objectclass: domain
dc: com
-aci: (target ="ldap:///dc=example,dc=com")(targetattr !=
- "userPassword")(version 3.0;acl "Anonymous read-search access";
- allow (read, search, compare)(userdn = "ldap:///anyone");)
-aci: (target="ldap:///dc=example,dc=com") (targetattr =
- "*")(version 3.0; acl "allow all Admin group"; allow(all) groupdn =
- "ldap:///cn=Directory Administrators,ou=Groups,dc=example,dc=com";)
dn: dc=example,dc=com
objectclass: top
@@ -50,26 +44,6 @@
objectclass: top
objectclass: organizationalunit
ou: People
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr =
- "userpassword || telephonenumber || facsimiletelephonenumber")(version 3.0;
- acl "Allow self entry modification";allow (write)(userdn = "ldap:///self");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Accounting)")(version 3.0;
- acl "Accounting Managers Group Permissions";allow (write) (groupdn =
- "ldap:///cn=Accounting Managers,ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Human Resources)")(version 3.0;
- acl "HR Group Permissions";allow (write)(groupdn = "ldap:///cn=HR Managers,
- ou=groups,dc=example,dc=com
- ");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn ||sn || uid")(targetfilter ="(ou=Product Testing)")(version 3.0;
- acl "QA Group Permissions";allow (write)(groupdn = "ldap:///cn=QA Managers,
- ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Product Development)")(version 3.0;
- acl "Engineering Group Permissions";allow (write)(groupdn = "ldap:///
- cn=PD Managers,ou=groups,dc=example,dc=com");)
dn: uid=scarter, ou=People, dc=example,dc=com
cn: Sam Carter
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Schema.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Schema.ldif
index ce7aa55..2f2faea 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Schema.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/backends/Schema.ldif
@@ -19,7 +19,7 @@
#
# CDDL HEADER END
#
-# Copyright 2006-2008 Sun Microsystems, Inc.
+# Copyright 2006-2009 Sun Microsystems, Inc.
#
#
# dc=com sample LDIF file
@@ -34,12 +34,6 @@
objectclass: top
objectclass: domain
dc: com
-aci: (target ="ldap:///dc=example,dc=com")(targetattr !=
- "userPassword")(version 3.0;acl "Anonymous read-search access";
- allow (read, search, compare)(userdn = "ldap:///anyone");)
-aci: (target="ldap:///dc=example,dc=com") (targetattr =
- "*")(version 3.0; acl "allow all Admin group"; allow(all) groupdn =
- "ldap:///cn=Directory Administrators,ou=Groups,dc=example,dc=com";)
dn: dc=example,dc=com
objectclass: top
@@ -50,26 +44,6 @@
objectclass: top
objectclass: organizationalunit
ou: People
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr =
- "userpassword || telephonenumber || facsimiletelephonenumber")(version 3.0;
- acl "Allow self entry modification";allow (write)(userdn = "ldap:///self");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Accounting)")(version 3.0;
- acl "Accounting Managers Group Permissions";allow (write) (groupdn =
- "ldap:///cn=Accounting Managers,ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Human Resources)")(version 3.0;
- acl "HR Group Permissions";allow (write)(groupdn = "ldap:///cn=HR Managers,
- ou=groups,dc=example,dc=com
- ");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn ||sn || uid")(targetfilter ="(ou=Product Testing)")(version 3.0;
- acl "QA Group Permissions";allow (write)(groupdn = "ldap:///cn=QA Managers,
- ou=groups,dc=example,dc=com");)
-aci: (target ="ldap:///ou=People,dc=example,dc=com")(targetattr !=
- "cn || sn || uid")(targetfilter ="(ou=Product Development)")(version 3.0;
- acl "Engineering Group Permissions";allow (write)(groupdn = "ldap:///
- cn=PD Managers,ou=groups,dc=example,dc=com");)
dn: uid=scarter, ou=People, dc=example,dc=com
cn: Sam Carter
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/entry_acis.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/entry_acis.ldif
new file mode 100644
index 0000000..a6fd04c
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/entry_acis.ldif
@@ -0,0 +1,41 @@
+# 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
+#
+# Copyright 2009 Sun Microsystems, Inc.
+#
+
+dn: dc=com
+changetype: modify
+add: aci
+aci: (target="ldap:///dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; allow (all)(userdn = "ldap:///uid=my_application,dc=groups,dc=com");)
+-
+add: aci
+aci: (target="ldap:///ou=static,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_staticgroup1,dc=groups,dc=com");)
+-
+add: aci
+aci: (target="ldap:///ou=static,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_staticgroup2,dc=groups,dc=com");)
+-
+add: aci
+aci: (target="ldap:///ou=dynamic,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_dynamicgroup1,dc=groups,dc=com");)
+-
+add: aci
+aci: (target="ldap:///ou=dynamic,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_dynamicgroup2,dc=groups,dc=com");)
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/global_acis.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/global_acis.ldif
new file mode 100644
index 0000000..804834b
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/global_acis.ldif
@@ -0,0 +1,41 @@
+# 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
+#
+# Copyright 2009 Sun Microsystems, Inc.
+#
+
+dn: cn=Access Control Handler,cn=config
+changetype: modify
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (target="ldap:///dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; allow (all)(userdn = "ldap:///uid=my_application,dc=groups,dc=com");)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (target="ldap:///ou=static,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_staticgroup1,dc=groups,dc=com");)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (target="ldap:///ou=static,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_staticgroup2,dc=groups,dc=com");)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (target="ldap:///ou=dynamic,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_dynamicgroup1,dc=groups,dc=com");)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (target="ldap:///ou=dynamic,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application"; deny (all)(groupdn = "ldap:///cn=my_dynamicgroup2,dc=groups,dc=com");)
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/groups.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/groups.ldif
index 59bace3..c0b95cf 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/groups.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/groups/groups.ldif
@@ -20,23 +20,13 @@
#
# CDDL HEADER END
#
-# Copyright 2007-2008 Sun Microsystems, Inc.
+# Copyright 2007-2009 Sun Microsystems, Inc.
#
dn: dc=com
objectclass: top
objectclass: domain
dc: com
-aci: (target="ldap:///dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application";
- allow (all)(userdn = "ldap:///uid=my_application,dc=groups,dc=com");)
-aci: (target="ldap:///ou=static,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application";
- deny (all)(groupdn = "ldap:///cn=my_staticgroup1,dc=groups,dc=com");)
-aci: (target="ldap:///ou=static,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application";
- deny (all)(groupdn = "ldap:///cn=my_staticgroup2,dc=groups,dc=com");)
-aci: (target="ldap:///ou=dynamic,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application";
- deny (all)(groupdn = "ldap:///cn=my_dynamicgroup1,dc=groups,dc=com");)
-aci: (target="ldap:///ou=dynamic,dc=groups,dc=com")(targetattr = "*")(version 3.0;acl "access for application";
- deny (all)(groupdn = "ldap:///cn=my_dynamicgroup2,dc=groups,dc=com");)
dn: dc=groups,dc=com
objectclass: top
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_entry_acis.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_entry_acis.ldif
new file mode 100644
index 0000000..cd9111f
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_entry_acis.ldif
@@ -0,0 +1,19 @@
+dn: uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (targetattr="*")(version 3.0; acl "rep_search_aci_tmorris"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
+-
+dn: uid=abergin, ou=People, o=Privileges Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (targetattr="*")(version 3.0; acl "del_search_aci_abergin"; allow (search,read) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
+-
+dn: uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (targetattr="*")(version 3.0; acl "del_search_aci_dmiller"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
+-
+dn: uid=gfarmer, ou=People, o=Privileges Tests, dc=example,dc=com
+changetype: modify
+add: aci
+aci: (targetattr="*")(version 3.0; acl "del_search_aci_gfarmer"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_global_acis.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_global_acis.ldif
new file mode 100644
index 0000000..8a5811b
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_global_acis.ldif
@@ -0,0 +1,13 @@
+dn: cn=Access Control Handler,cn=config
+changetype: modify
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (targetattr="*")(version 3.0; acl "rep_search_aci_tmorris"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (targetattr="*")(version 3.0; acl "del_search_aci_abergin"; allow (search,read) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (targetattr="*")(version 3.0; acl "del_search_aci_dmiller"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
+-
+add: ds-cfg-global-aci
+ds-cfg-global-aci: (targetattr="*")(version 3.0; acl "del_search_aci_gfarmer"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_startup.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_startup.ldif
index e24263c..b22f8ac 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_startup.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/privileges/privileges_startup.ldif
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
-# Copyright 2008 Sun Microsystems, Inc.
+# Copyright 2008-2009 Sun Microsystems, Inc.
#
dn: cn=Aroot Manager,cn=Root DNs,cn=config
@@ -39,6 +39,14 @@
ds-rlim-time-limit: 0
ds-rlim-size-limit: 0
+dn: dc=com
+dc: com
+objectclass: domain
+
+dn: dc=example,dc=com
+dc: example
+objectclass: domain
+
dn: o=Privileges Tests, dc=example,dc=com
o: Privileges Tests
objectclass: top
@@ -157,7 +165,6 @@
facsimiletelephonenumber: +1 408 555 8473
roomnumber: 4117
userpassword: irrefutable
-aci: (targetattr="*")(version 3.0; acl "rep_search_aci_tmorris"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
dn: uid=abergin, ou=People, o=Privileges Tests, dc=example,dc=com
cn: Andy Bergin
@@ -176,7 +183,6 @@
facsimiletelephonenumber: +1 408 555 7472
roomnumber: 3472
userpassword: inflict
-aci: (targetattr="*")(version 3.0; acl "del_search_aci_abergin"; allow (search,read) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
dn: uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com
cn: David Miller
@@ -195,7 +201,6 @@
facsimiletelephonenumber: +1 408 555 0111
roomnumber: 4135
userpassword: gosling
-aci: (targetattr="*")(version 3.0; acl "del_search_aci_dmiller"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
dn: uid=gfarmer, ou=People, o=Privileges Tests, dc=example,dc=com
cn: Gern Farmer
@@ -217,7 +222,6 @@
title: Engineer
title: architect
title: sweeper
-aci: (targetattr="*")(version 3.0; acl "del_search_aci_gfarmer"; allow (write) userdn="ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com";)
dn: uid=kwinters, ou=People, o=Privileges Tests, dc=example,dc=com
cn: Kelly Winters
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/schema_start.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/schema_start.ldif
index 2174776..563dcc0 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/schema_start.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/schema/ldifs/schema_start.ldif
@@ -20,9 +20,17 @@
#
# CDDL HEADER END
#
-# Copyright 2006-2008 Sun Microsystems, Inc.
+# Copyright 2006-2009 Sun Microsystems, Inc.
#
+dn: dc=com
+dc: com
+objectclass: domain
+
+dn: dc=example,dc=com
+dc: example
+objectclass: domain
+
dn: o=extensible object tests,dc=example,dc=com
o: extensible object tests
objectclass: top
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/virtualAttributes/virtualAttributes.ldif b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/virtualAttributes/virtualAttributes.ldif
index 6a60efc..58e328b 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/virtualAttributes/virtualAttributes.ldif
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/shared/data/virtualAttributes/virtualAttributes.ldif
@@ -20,15 +20,13 @@
#
# CDDL HEADER END
#
-# Copyright 2007-2008 Sun Microsystems, Inc.
+# Copyright 2007-2009 Sun Microsystems, Inc.
#
dn: dc=com
objectclass: top
objectclass: domain
dc: com
-aci: (target="ldap:///dc=virtualAttributes,dc=com")(targetattr = "*")(version 3.0;acl "access for application";
- allow (all)(userdn = "ldap:///uid=my_application,dc=virtualAttributes,dc=com");)
dn: dc=virtualAttributes,dc=com
objectclass: top
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml
index 6b156c1..117d846 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_aci"/>
@@ -33,59 +33,90 @@
</function-list-args>
<sequence>
- <block name="'aci'">
-
+ <try>
+ <block name="'aci'">
+
+ <sequence>
+
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+
+ <script>
+ CurrentTestPath['group']='aci'
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'testGroup_Preamble'"/>
+
+ <!-- List of ACI test suites to run -->
+ <script>
+ suiteList=[]
+ suiteList.append('global_acis')
+ suiteList.append('aci_target')
+ suiteList.append('aci_targetattr')
+ suiteList.append('aci_targetfilter')
+ suiteList.append('aci_targattrfilter')
+ suiteList.append('aci_targetscope')
+ suiteList.append('aci_targetcontrol')
+ suiteList.append('aci_delete_entry')
+ suiteList.append('aci_add_entry')
+ suiteList.append('aci_modify_entry')
+ suiteList.append('aci_modify_filter_tests')
+ suiteList.append('aci_compare_tests')
+ suiteList.append('multiple_aci_tests')
+ suiteList.append('aci_modify_rdn')
+ suiteList.append('aci_rdn_wildcards')
+ suiteList.append('aci_bindtypes')
+ suiteList.append('aci_proxy_auth')
+ suiteList.append('aci_effective_rights')
+#OOS #suiteList.append('aci_import')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/aci/%s.xml' % (TESTS_DIR,_suite)"/>
+ <call function="'%s' % _suite" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
<sequence>
-
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
-
- <script>
- CurrentTestPath['group']='aci'
- GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'testGroup_Preamble'"/>
-
- <!-- List of ACI test suites to run -->
- <script>
- suiteList=[]
- suiteList.append('global_acis')
- suiteList.append('aci_target')
- suiteList.append('aci_targetattr')
- suiteList.append('aci_targetfilter')
- suiteList.append('aci_targattrfilter')
- suiteList.append('aci_targetscope')
- suiteList.append('aci_targetcontrol')
- suiteList.append('aci_delete_entry')
- suiteList.append('aci_add_entry')
- suiteList.append('aci_modify_entry')
- suiteList.append('aci_modify_filter_tests')
- suiteList.append('aci_compare_tests')
- suiteList.append('multiple_aci_tests')
- suiteList.append('aci_modify_rdn')
- suiteList.append('aci_rdn_wildcards')
- suiteList.append('aci_bindtypes')
- suiteList.append('aci_proxy_auth')
- suiteList.append('aci_effective_rights')
-#OOS suiteList.append('aci_import')
- </script>
-
- <iterate var="_suite" in="suiteList">
- <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/aci/%s.xml' % (TESTS_DIR,_suite)"/>
- <call function="'%s' % _suite" />
- </sequence>
- </iterate>
-
- <call function="'testGroup_Postamble'"/>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
</sequence>
- </block>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
+
</sequence>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_cleanup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_cleanup.xml
index 96ebe31..cebee63 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_cleanup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_cleanup.xml
@@ -23,70 +23,97 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="aci_cleanup"/>
- <function name="aci_cleanup">
+ <function name="aci_cleanup" scope="local">
<sequence>
- <block name="'cleanup'">
-
- <sequence>
+ <block name="'aci_cleanup'">
-
- <block name="'Block DS Process Stop'">
- <!--- Stop DS -->
- <sequence>
- <message>
- 'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
- </message>
+ <testcase name="getTestCaseName('ACI Cleanup')">
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ <try>
+
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'runFunction'">
+ { 'functionName' : 'ldapDeleteWithScript' ,
+ 'functionMessage' : 'Recursive delete of suffix.' ,
+ 'functionException' : 'LDAP.DeleteException' ,
+ 'functionArguments' : { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsDeleteSubtree' : 'TRUE' ,
+ 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'dsDn' : ['%s' % server.suffix] }
+ }
</call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
+
+ <call function="'runFunction'">
+ { 'functionName' : 'StopDsWithScript' ,
+ 'functionMessage' : 'Stop the Directory Server.' ,
+ 'functionException' : 'Server.StopException' ,
+ 'functionArguments' : { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsHost' : server.host ,
+ 'dsAdminPort' : server.adminport ,
+ 'dsBindDN' : server.dn ,
+ 'dsBindPwd' : server.password }
+ }
</call>
-
- </sequence>
- <!--- End Block DS Process Stop -->
- </block>
-
-
-
- <block name="'Block Remove DS Topology'">
- <!-- Remove the topology created for the test suite -->
- <sequence>
-
- <message>
- 'Remove DS topology created for the Test Suite'
- </message>
-
- <call function="'removeTopology'"/>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- </sequence>
- <!-- End Block Remove DS Topology-->
- </block>
-
- </sequence>
+ <call function="'runFunction'">
+ { 'functionName' : 'removeTopology' ,
+ 'functionMessage' : 'Remove DS topology.' ,
+ 'functionException' : 'Server.RemoveTopologyException'
+ }
+ </call>
+
+ </sequence>
+
+ <catch exception="'STAXException.LDAP.DeleteException'" typevar="eType" var="eInfo">
+ <sequence>
+ <message log="1" level="'fatal'">
+ '%s: LDAPDelete failed. eInfo(%s)' % (eType,eInfo)
+ </message>
+ <throw exception="'STAFException.TestSuite.CleanupException'" />
+ </sequence>
+ </catch>
+
+ <catch exception="'STAXException.Server.RemoveTopologyException'" typevar="eType" var="eInfo">
+ <sequence>
+ <message log="1" level="'fatal'">
+ '%s: Remove topology failed. eInfo(%s)' % (eType,eInfo)
+ </message>
+ <throw exception="'STAFException.TestSuite.CleanupException'" />
+ </sequence>
+ </catch>
+
+ <catch exception="'STAXException.Server.StopException'" typevar="eType" var="eInfo">
+ <sequence>
+ <message log="1" level="'fatal'">
+ '%s: Failed to stop Directory Server. eInfo(%s)' % (eType,eInfo)
+ </message>
+ <throw exception="'STAFException.TestSuite.CleanupException'" />
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testCase_Postamble'"/>
+ </finally>
+
+ </try>
+
+ </testcase>
+
</block>
-
+
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests.xml
index 79eca18..d4856cb 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests.xml
@@ -528,7 +528,8 @@
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/testcases/aci/aci_cleanup.xml' % (TESTS_DIR)"/>
<call function="'aci_cleanup'" />
-
+
+ <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci1.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci1.xml
index 42d598f..590377f 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci1.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci1.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,14 +36,6 @@
<block name="'aci-modify-filter-tests-aci1'">
<sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='aci'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 1')">
<sequence>
@@ -262,9 +254,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci11.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci11.xml
index 174a420..5a21e03 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci11.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci11.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci11'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 11')">
<sequence>
@@ -254,9 +248,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci12.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci12.xml
index 3c10f26..aef1399 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci12.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci12.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,13 +36,7 @@
<block name="'aci-modify-filter-tests-aci12'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
+
<testcase name="getTestCaseName('ACI 12')">
<sequence>
<call function="'testCase_Preamble'"/>
@@ -246,9 +240,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci13.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci13.xml
index f808aca..5077b93 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci13.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci13.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci13'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 13')">
<sequence>
@@ -258,9 +252,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci14.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci14.xml
index 6560251..dc4e315 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci14.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci14.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci14'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 14')">
<sequence>
@@ -244,9 +238,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci15.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci15.xml
index 259e499..93ac427 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci15.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci15.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci15'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 15')">
<sequence>
@@ -254,9 +248,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci16.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci16.xml
index 5581902..4b6ec42 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci16.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci16.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci16'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 16')">
<sequence>
@@ -246,9 +240,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci2.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci2.xml
index 5d03d0f..f75f78a 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci2.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci2.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci2'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 2')">
<sequence>
@@ -252,10 +246,9 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
-
+
</sequence>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci21.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci21.xml
index 12bb3e7..f51ce55 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci21.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci21.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci21'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 21')">
<sequence>
@@ -260,9 +254,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci22.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci22.xml
index 0ae687a..123d97a 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci22.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci22.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci22'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 22')">
<sequence>
@@ -252,9 +246,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci23.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci23.xml
index c3af439..2121b27 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci23.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci23.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci23'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 23')">
<sequence>
@@ -264,9 +258,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci24.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci24.xml
index 39a5b38..32a11e5 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci24.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci24.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci24'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 24')">
<sequence>
@@ -250,9 +244,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci25.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci25.xml
index 63a6e57..8a6de6f 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci25.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci25.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci25'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 25')">
<sequence>
@@ -260,9 +254,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci26.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci26.xml
index 8e2617a..2a3ada7 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci26.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci26.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci26'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 26')">
<sequence>
@@ -252,9 +246,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci3.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci3.xml
index 3f6a0b3..9591653 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci3.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci3.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci3'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 3')">
<sequence>
@@ -264,9 +258,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci4.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci4.xml
index 85fe1e8..e833247 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci4.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci4.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci4'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 4')">
<sequence>
@@ -250,9 +244,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci5.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci5.xml
index 8a4c96e..7b856cf 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci5.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci5.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,12 +36,6 @@
<block name="'aci-modify-filter-tests-aci5'">
<sequence>
-
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
<testcase name="getTestCaseName('ACI 5')">
<sequence>
@@ -260,9 +254,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci6.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci6.xml
index b7a4ab8..112b30e 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci6.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_modify_filter_tests_aci6.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -37,12 +37,6 @@
<sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
<testcase name="getTestCaseName('ACI 6')">
<sequence>
<call function="'testCase_Preamble'"/>
@@ -252,9 +246,8 @@
<call function="'testCase_Postamble'"/>
</sequence>
+
</testcase>
-
- <call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_proxy_auth.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_proxy_auth.xml
index 4f930ef..e84a530 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_proxy_auth.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_proxy_auth.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -79,7 +79,8 @@
<message>
'ACI: Proxy Auth: Preamble - Removing Search Global ACI'
</message>
-
+
+ <!-- Remove the global ACI -->
<call function="'modifyGlobalAci'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
@@ -87,11 +88,13 @@
'aciValue' : GLOBAL_ACI_SEARCH ,
'opType' : 'remove' }
</call>
-
+
+ <!-- Allow the proxy auth control for all ldap users read only -->
<script>
- allow_aci='(targetcontrol=\"*\") (version 3.0; acl \"allow control access\"; allow(read) userdn=\"ldap:///anyone\";)'
+ allow_aci='(targetcontrol=\"2.16.840.1.113730.3.4.18\") (version 3.0; acl \"allow proxy auth control access\"; allow(read) userdn=\"ldap:///anyone\";)'
</script>
-
+
+ <!-- Add the ACI under suffix -->
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -106,7 +109,8 @@
<message>
'ACI: Proxy Auth: Preamble - existing branch, user searching entry that will be targeted in future tests'
</message>
-
+
+ <!-- Search a users entry as another user. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -126,11 +130,14 @@
'testString' : 'dn: uid=tmorris,ou=People,ou=aci branch,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
-
+
+ <!-- TODO: Also perform a modify operation - should return insufficient access -->
+
<message>
'ACI: Proxy Auth: Preamble - existing branch, user searching entry that will be non-targeted in future tests'
</message>
-
+
+ <!-- Search a users entry as another user. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -149,6 +156,8 @@
{ 'returnString' : returnString ,
'testString' : 'dn: uid=tmorris,ou=People,ou=non-aci branch,o=ACI Tests' }
</call>
+
+ <!-- TODO: Also perform a modify operation - should return insufficient access -->
<call function="'testCase_Postamble'"/>
@@ -183,7 +192,8 @@
<message>
'ACI: Proxy Auth: one proxied user, user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry as another user (uid=auser). This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -207,7 +217,8 @@
<message>
'ACI: Proxy Auth: one proxied user, second user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry as another user (uid=buser). This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -231,7 +242,8 @@
<message>
'ACI: Proxy Auth: one proxied user, proxied user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry as uid=aproxy. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -251,7 +263,8 @@
'testString' : 'dn: uid=tmorris,ou=People,ou=aci branch,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
-
+
+ <!-- Add the proxi aci for user uid=aproxy under ou=aci branch -->
<script>
curr_aci_ldif_file = 'add_proxy_aci.ldif'
curr_aci=retrieve_aci('%s/aci/aci_proxy_auth/%s' % (local.data,curr_aci_ldif_file));
@@ -269,14 +282,11 @@
'entryToBeModified' : '%s/aci/aci_proxy_auth/%s' % (remote.data,curr_aci_ldif_file) }
</call>
- <if expr="RC != 0">
- <tcstatus result="'fail'"/>
- </if>
-
<message>
'ACI: Proxy Auth: one proxied user, proxy user searching targeted entry'
</message>
-
+
+ <!-- Search users entry with proxy dn without allowed aci access. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -297,11 +307,14 @@
'testString' : 'dn: uid=tmorris,ou=People,ou=aci branch,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
-
+
+ <!-- TODO: Also perform a modify operation - should return insufficient access -->
+
<message>
'ACI: Proxy Auth: one proxied user, admin deleting both acis'
</message>
-
+
+ <!-- Delete the proxy aci for user uid=aproxy -->
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -310,14 +323,11 @@
'entryToBeModified' : '%s/aci/aci_proxy_auth/del_aci.ldif' % remote.data }
</call>
- <if expr="RC != 0">
- <tcstatus result="'fail'"/>
- </if>
-
<message>
'ACI: Proxy Auth: one proxied user, user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry as another user. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -368,6 +378,7 @@
<sequence>
<call function="'testCase_Preamble'"/>
+ <!-- Allow user uid=auser access to all entries under ou=aci branch -->
<script>
curr_aci_ldif_file = 'add_user_aci_all.ldif'
curr_aci=retrieve_aci('%s/aci/aci_proxy_auth/%s' % (local.data,curr_aci_ldif_file));
@@ -385,14 +396,11 @@
'entryToBeModified' : '%s/aci/aci_proxy_auth/%s' % (remote.data,curr_aci_ldif_file) }
</call>
- <if expr="RC != 0">
- <tcstatus result="'fail'"/>
- </if>
-
<message>
'ACI: Proxy Auth: one user, one proxied user, user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry under suffix as uid=auser. This should return a result -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -422,7 +430,8 @@
<message>
'ACI: Proxy Auth: one user, one proxied user, user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry as another user. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -446,7 +455,8 @@
<message>
'ACI: Proxy Auth: one user, one proxied user, proxied user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry just as proxy user. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -466,7 +476,8 @@
'testString' : 'dn: uid=tmorris,ou=People,ou=aci branch,o=ACI Tests' ,
'expectedResult' : '0' }
</call>
-
+
+ <!-- Add the proxi aci for user uid=aproxy under ou=aci branch -->
<script>
curr_aci_ldif_file = 'add_proxy_aci.ldif'
curr_aci=retrieve_aci('%s/aci/aci_proxy_auth/%s' % (local.data,curr_aci_ldif_file));
@@ -484,14 +495,11 @@
'entryToBeModified' : '%s/aci/aci_proxy_auth/%s' % (remote.data,curr_aci_ldif_file) }
</call>
- <if expr="RC != 0">
- <tcstatus result="'fail'"/>
- </if>
-
<message>
'ACI: Proxy Auth: one user, one proxied user, proxied user searching targeted entry'
</message>
-
+
+ <!-- Search users entry with proxy dn with allowed aci access. This should return results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -518,11 +526,14 @@
'testString' : 'cn:' ,
'expectedResult' : '1' }
</call>
+
+ <!-- TODO: Also perform a modify operation - should return success -->
<message>
'ACI: Proxy Auth: one user, one proxied user, proxied second user searching targeted entry'
</message>
-
+
+ <!-- Search users entry with proxy dn without allowed aci access. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -547,7 +558,8 @@
<message>
'ACI: Proxy Auth: one user, one proxied user, admin deleting both acis'
</message>
-
+
+ <!-- Remove aci attribute for uid=auser -->
<call function="'modifyEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -556,14 +568,11 @@
'entryToBeModified' : '%s/aci/aci_proxy_auth/del_aci.ldif' % remote.data }
</call>
- <if expr="RC != 0">
- <tcstatus result="'fail'"/>
- </if>
-
<message>
'ACI: Proxy Auth: one user, one proxied user, user searching targeted entry'
</message>
-
+
+ <!-- Search a users entry as a uid=auser. This should return no results -->
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
@@ -2460,7 +2469,7 @@
</call>
<script>
- allow_aci='(targetcontrol=\"*\") (version 3.0; acl \"allow control access\"; allow(read) userdn=\"ldap:///anyone\";)'
+ allow_aci='(targetcontrol=\"2.16.840.1.113730.3.4.18\") (version 3.0; acl \"allow proxy auth control access\"; allow(read) userdn=\"ldap:///anyone\";)'
</script>
<call function="'modifyAnAttribute'">
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_setup.xml
index bc92b66..1a8cdd0 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_setup.xml
@@ -23,104 +23,106 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="aci_setup"/>
- <function name="aci_setup">
+ <function name="aci_setup" scope="local">
<sequence>
<block name="'setup'">
-
- <sequence>
- <script>
- CurrentTestPath['group']='aci'
- </script>
-
-
- <block name="'Block Create DS Topology'">
- <!-- Create the topology necessary to the test group/suite -->
- <sequence>
-
- <message>
- 'Create DS topology as described in config.py'
- </message>
-
- <call function="'createTopology'">
- { 'initialiseInstance' : True }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- </sequence>
- <!--- End Block Create DS Topology -->
- </block>
+ <testcase name="getTestCaseName('ACI Setup')">
-
- <block name="'Block DS Process Active'">
- <!--- Start DS -->
- <sequence>
+ <try>
- <message>
- 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <!--- Start DS -->
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <!-- Create the topology necessary to the test group/suite -->
+ <call function="'runFunction'">
+ { 'functionName' : 'createTopology' ,
+ 'functionMessage' : 'Create DS topology' ,
+ 'functionException' : 'Server.CreateTopologyException' ,
+ 'functionArguments' : { 'initialiseInstance' : True }
+ }
</call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
+
+ <!-- Start the OpenDS Server -->
+ <call function="'runFunction'">
+ { 'functionName' : 'StartDsWithScript' ,
+ 'functionMessage' : 'Start the Directory Server.' ,
+ 'functionException' : 'Server.StartException' ,
+ 'functionArguments' : { 'location' : STAF_REMOTE_HOSTNAME }
+ }
</call>
-
+
<!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
-
- </sequence>
- <!--- End Block DS Process Active -->
- </block>
-
+ <call function="'runFunction'">
+ { 'functionName' : 'isAlive' ,
+ 'functionMessage' : 'Start the Directory Server.' ,
+ 'functionException' : 'Server.StartException' ,
+ 'functionArguments' : { 'noOfLoops' : 100 ,
+ 'noOfMilliSeconds' : 3000 }
+ }
+ </call>
+
+ <!-- Load the data needed by the test suite -->
+ <call function="'runFunction'">
+ { 'functionName' : 'ldapModifyWithScript' ,
+ 'functionMessage' : 'Adding Initial Entries' ,
+ 'functionException' : 'LDAP.ModifyException' ,
+ 'functionArguments' : { 'dsAdd' : 'TRUE' ,
+ 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'dsFilename' : '%s/aci/aci_startup.ldif' % remote.data }
+ }
+ </call>
+
+ </sequence>
-
- <block name="'Block DS Load Data'">
- <!-- Load the data needed by the test suite -->
- <sequence>
-
- <message>
- 'ACI: ACI Setup: Adding Initial Entries'
+ <catch exception="'STAXException.Server.CreateTopologyException'" typevar="eType" var="eInfo">
+ <sequence>
+ <message log="1" level="'fatal'">
+ '%s: Create topology failed. eInfo(%s)' % (eType,eInfo)
</message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : '%s/aci/aci_startup.ldif' % remote.data }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- </sequence>
- <!--- End Block DS Load Data -->
- </block>
-
-
- </sequence>
+ <throw exception="'STAFException.TestSuite.SetupException'" />
+ </sequence>
+ </catch>
+
+ <catch exception="'STAXException.Server.StartException'" typevar="eType" var="eInfo">
+ <sequence>
+ <message log="1" level="'fatal'">
+ '%s: Failed to start Directory Server. eInfo(%s)' % (eType,eInfo)
+ </message>
+ <throw exception="'STAFException.TestSuite.SetupException'" />
+ </sequence>
+ </catch>
+
+ <catch exception="'STAXException.LDAP.ModifyException'" typevar="eType" var="eInfo">
+ <sequence>
+ <message log="1" level="'fatal'">
+ '%s: LDAPModify failed. eInfo(%s)' % (eType,eInfo)
+ </message>
+ <throw exception="'STAFException.TestSuite.SetupException'" />
+ </sequence>
+ </catch>
+
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testCase_Postamble'"/>
+ </finally>
+
+ </try>
+
+ </testcase>
+
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/global_acis.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/global_acis.xml
index f45e664..465c965 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/global_acis.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/global_acis.xml
@@ -23,879 +23,895 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="global_acis"/>
- <function name="global_acis">
+ <function name="global_acis" scope="local">
<sequence>
<block name="'global-acis'">
-
- <sequence>
+
+ <try>
+
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='aci'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName ACI Global Tests
+ #@TestSuitePurpose Test the basic global ACI Support.
+ #@TestSuiteGroup Global ACI Tests
+ #@TestScript global_acis.xml
+ -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='aci'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
+ <call function="'common_setup'">
+ {
+ 'stopServer' : False,
+ 'ldifFile' : '%s/aci/aci_startup.ldif' % remote.data
+ }
+ </call>
+
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search
+ #@TestIssue 1402
+ #@TestPurpose Search against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ The attributes, sn and dn, should be returned
+ but not userpassword.
+ -->
+ <testcase name="getTestCaseName('Search')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Search, user searching entry'
+ </message>
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName ACI Global Tests
- #@TestSuitePurpose Test the basic global ACI Support.
- #@TestSuiteGroup Global ACI Tests
- #@TestScript global_acis.xml
- -->
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/aci/aci_setup.xml' % (TESTS_DIR)"/>
- <call function="'aci_setup'" />
-
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid userpassword' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'userpassword' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - One operational attribute for one entry
+ #@TestIssue 1622
+ #@TestPurpose Search one operational attribute for one entry against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches one operational attribute of an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ The attributes, creatorsname and dn, should be returned.
+ -->
+ <testcase name="getTestCaseName('Search Operational Attribute of an entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search
- #@TestIssue 1402
- #@TestPurpose Search against default global acis
- #@TestPreamble none
- #@TestStep Client searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- The attributes, sn and dn, should be returned
- but not userpassword.
- -->
- <testcase name="getTestCaseName('Search')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid userpassword' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'userpassword' ,
- 'expectedResult' : '0' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - One operational attribute for one entry
- #@TestIssue 1622
- #@TestPurpose Search one operational attribute for one entry against default global acis
- #@TestPreamble none
- #@TestStep Client searches one operational attribute of an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- The attributes, creatorsname and dn, should be returned.
- -->
- <testcase name="getTestCaseName('Search Operational Attribute of an entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching operational attribute of an entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'creatorsName'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'creatorsName' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - All operational attributes for one entry
- #@TestIssue 1622
- #@TestPurpose Search all operational attributes for one entry against default global acis
- #@TestPreamble Admin modify entry so there are modifyTimestamp and modifiersName attributes
- #@TestStep Client searches all operational attributes of an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- Six attributes and the dn should be returned.
- -->
- <testcase name="getTestCaseName('Search All Operational Attributes of an entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, admin modifying entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeModified' : '%s/aci/global_acis/mod_modifier_entry1.ldif' % (remote.data) }
- </call>
-
- <if expr="RC != 0">
- <tcstatus result="'fail'"/>
- </if>
-
- <message>
- 'ACI: Global: Search, user searching all operational attributes of an entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : '+'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'creatorsName:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'createTimestamp:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'entryDN:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'modifiersName:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'modifyTimestamp' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'subschemaSubentry:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - One operational attribute for cn=schema
- #@TestIssue 1622
- #@TestPurpose Search one operational attribute for cn=schema against default global acis
- #@TestPreamble none
- #@TestStep Client searches one operational attribute of cn=schema.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- The attributes, matchingrules and dn, should be returned.
- -->
- <testcase name="getTestCaseName('Search Operational Attribute, cn=schema')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching operational attribute of cn=schema'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=schema' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'matchingRules' ,
- 'extraParams' : '-T -s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'matchingRules:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: cn=schema' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - All operational attributes for cn=schema
- #@TestIssue 1622
- #@TestPurpose Search all operational attributes for cn=schema against default global acis
- #@TestPreamble none
- #@TestStep Client searches all operational attributes of cn=schema.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- Six attributes and the dn should be returned.
- -->
- <testcase name="getTestCaseName('Search All Operational Attributes, cn=schema')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching operational attribute of cn=schema'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=schema' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : '+' ,
- 'extraParams' : '-T -s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'attributeTypes:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dITStructureRules:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'ldapSyntaxes:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'matchingRules:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'nameForms:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'objectClasses:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: cn=schema' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - One operational attribute for root dse
- #@TestIssue 1622
- #@TestPurpose Search one operational attribute for root dse against default global acis
- #@TestPreamble none
- #@TestStep Client searches one operational attribute of root dse.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- The attributes, vendorname and dn, should be returned.
- -->
- <testcase name="getTestCaseName('Search Operational Attribute, root dse')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching operational attribute of root dse'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'vendorName' ,
- 'extraParams' : '-T -s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'vendorName:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: ' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - All operational attributes for root dse
- #@TestIssue 1622
- #@TestPurpose Search all operational attributes for root dse against default global acis
- #@TestPreamble none
- #@TestStep Client searches all operational attributes of root dse.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- Eight attributes and the dn should be returned.
- -->
- <testcase name="getTestCaseName('Search All Operational Attribute, root dse')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching operational attribute of root dse'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : '+' ,
- 'extraParams' : '-T -s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'namingContexts:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'supportedAuthPasswordSchemes:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'supportedControl:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'supportedExtension:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'supportedFeatures:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'supportedSASLMechanisms:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'vendorName:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'vendorVersion:' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: ' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - All operational attributes for cn=config
- #@TestIssue 1622
- #@TestPurpose Search all operational attributes for cn=config against default global acis
- #@TestPreamble none
- #@TestStep Client searches all operational attributes for cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50.
- -->
- <testcase name="getTestCaseName('Search Operational Attribute, cn=config')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Search, user searching operational attribute of an entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : '+' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - Anonymous
- #@TestIssue 1621
- #@TestPurpose Anonymous search against default global acis
- #@TestPreamble none
- #@TestStep Client searches entry as anonymous.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entry for step 1.
- The attributes, uid, sn and dn, should be returned for specified dn.
- -->
- <testcase name="getTestCaseName('Anon Search')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: AnonSearch, user searching entry'
- </message>
-
- <call function="'AnonSearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : 'ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'extraParams' : '-T' ,
- 'dsFilter' : '(uid=scarter)'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'uid' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Search - Anonymous with not equals filter
- #@TestIssue 1621
- #@TestPurpose Anonymous search with not equals filter against default global acis
- #@TestPreamble none
- #@TestStep Client searches entry as anonymous with not equals filter
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and entries for step 1.
- The attributes, uid, sn and dn, should be returned for all other entries but the
- for the specified dn.
- -->
- <testcase name="getTestCaseName('Anon Search, not equals filter')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: AnonSearch, not equals filter, user searching entry'
- </message>
-
- <call function="'AnonSearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : 'ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'extraParams' : '-T' ,
- 'dsFilter' : '(!(uid=scarter))'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'uid' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=tmorris,ou=People,ou=aci branch,o=ACI Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Compare
- #@TestIssue 1402
- #@TestPurpose Compare against default global acis
- #@TestPreamble none
- #@TestStep Client compares attribute in an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- and returns true for step 1.
- -->
- <testcase name="getTestCaseName('Compare')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Compare, user comparing entry'
- </message>
-
- <call function="'compareEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'attrToBeCompared' : 'l:Santa Clara',
- 'entryToBeCompared' : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'true' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Modify
- #@TestIssue 1402
- #@TestPurpose Modify against default global acis
- #@TestPreamble none
- #@TestStep Client modifies attribute in an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50.
- -->
- <testcase name="getTestCaseName('Modify')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Modify, user modifying entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'entryToBeModified' : '%s/aci/global_acis/mod_entry1.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
+ <message>
+ 'ACI: Global: Search, user searching operational attribute of an entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'creatorsName'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'creatorsName' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Delete
- #@TestIssue 1402
- #@TestPurpose Delete against default global acis
- #@TestPreamble none
- #@TestStep Client deletes an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50.
- -->
- <testcase name="getTestCaseName('Delete')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Delete, user deleting entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'entryToBeModified' : '%s/aci/global_acis/del_entry1.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Modify RDN
- #@TestIssue 1402
- #@TestPurpose Modify RDN against default global acis
- #@TestPreamble none
- #@TestStep Client modifies the RDN of an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50.
- -->
- <testcase name="getTestCaseName('Modify RDN')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Modify RDN, user modifying rdn of an entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'entryToBeModified' : '%s/aci/global_acis/modrdn_entry1.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker ACI Global Tests
- #@TestName Global ACI Modify Self
- #@TestIssue 1402
- #@TestPurpose Modify self against default global acis
- #@TestPreamble none
- #@TestStep Client modifies attribute in the user entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0.
- -->
- <testcase name="getTestCaseName('Self Modify')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ACI: Global: Self Modify, user modifying itself'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'entryToBeModified' : '%s/aci/global_acis/mod_entry2.ldif' % remote.data }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/aci/aci_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'aci_cleanup'" />
-
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - All operational attributes for one entry
+ #@TestIssue 1622
+ #@TestPurpose Search all operational attributes for one entry against default global acis
+ #@TestPreamble Admin modify entry so there are modifyTimestamp and modifiersName attributes
+ #@TestStep Client searches all operational attributes of an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ Six attributes and the dn should be returned.
+ -->
+ <testcase name="getTestCaseName('Search All Operational Attributes of an entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ <message>
+ 'ACI: Global: Search, admin modifying entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeModified' : '%s/aci/global_acis/mod_modifier_entry1.ldif' % (remote.data) }
+ </call>
+
+ <if expr="RC != 0">
+ <tcstatus result="'fail'"/>
+ </if>
+
+ <message>
+ 'ACI: Global: Search, user searching all operational attributes of an entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : '+'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'creatorsName:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'createTimestamp:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'entryDN:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'modifiersName:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'modifyTimestamp' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'subschemaSubentry:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - One operational attribute for cn=schema
+ #@TestIssue 1622
+ #@TestPurpose Search one operational attribute for cn=schema against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches one operational attribute of cn=schema.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ The attributes, matchingrules and dn, should be returned.
+ -->
+ <testcase name="getTestCaseName('Search Operational Attribute, cn=schema')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Search, user searching operational attribute of cn=schema'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=schema' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'matchingRules' ,
+ 'extraParams' : '-T -s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'matchingRules:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: cn=schema' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - All operational attributes for cn=schema
+ #@TestIssue 1622
+ #@TestPurpose Search all operational attributes for cn=schema against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches all operational attributes of cn=schema.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ Six attributes and the dn should be returned.
+ -->
+ <testcase name="getTestCaseName('Search All Operational Attributes, cn=schema')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Search, user searching operational attribute of cn=schema'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=schema' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : '+' ,
+ 'extraParams' : '-T -s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'attributeTypes:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dITStructureRules:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'ldapSyntaxes:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'matchingRules:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'nameForms:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'objectClasses:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: cn=schema' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - One operational attribute for root dse
+ #@TestIssue 1622
+ #@TestPurpose Search one operational attribute for root dse against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches one operational attribute of root dse.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ The attributes, vendorname and dn, should be returned.
+ -->
+ <testcase name="getTestCaseName('Search Operational Attribute, root dse')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Search, user searching operational attribute of root dse'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'vendorName' ,
+ 'extraParams' : '-T -s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'vendorName:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: ' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - All operational attributes for root dse
+ #@TestIssue 1622
+ #@TestPurpose Search all operational attributes for root dse against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches all operational attributes of root dse.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ Eight attributes and the dn should be returned.
+ -->
+ <testcase name="getTestCaseName('Search All Operational Attribute, root dse')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Search, user searching operational attribute of root dse'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : '+' ,
+ 'extraParams' : '-T -s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'namingContexts:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'supportedAuthPasswordSchemes:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'supportedControl:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'supportedExtension:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'supportedFeatures:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'supportedSASLMechanisms:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'vendorName:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'vendorVersion:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: ' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - All operational attributes for cn=config
+ #@TestIssue 1622
+ #@TestPurpose Search all operational attributes for cn=config against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches all operational attributes for cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50.
+ -->
+ <testcase name="getTestCaseName('Search Operational Attribute, cn=config')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Search, user searching operational attribute of an entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : '+' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - Anonymous
+ #@TestIssue 1621
+ #@TestPurpose Anonymous search against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches entry as anonymous.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entry for step 1.
+ The attributes, uid, sn and dn, should be returned for specified dn.
+ -->
+ <testcase name="getTestCaseName('Anon Search')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: AnonSearch, user searching entry'
+ </message>
+
+ <call function="'AnonSearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : 'ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-T' ,
+ 'dsFilter' : '(uid=scarter)'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'uid' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Search - Anonymous with not equals filter
+ #@TestIssue 1621
+ #@TestPurpose Anonymous search with not equals filter against default global acis
+ #@TestPreamble none
+ #@TestStep Client searches entry as anonymous with not equals filter
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and entries for step 1.
+ The attributes, uid, sn and dn, should be returned for all other entries but the
+ for the specified dn.
+ -->
+ <testcase name="getTestCaseName('Anon Search, not equals filter')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: AnonSearch, not equals filter, user searching entry'
+ </message>
+
+ <call function="'AnonSearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : 'ou=People,ou=aci branch,o=ACI Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'extraParams' : '-T' ,
+ 'dsFilter' : '(!(uid=scarter))'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'uid' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=tmorris,ou=People,ou=aci branch,o=ACI Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Compare
+ #@TestIssue 1402
+ #@TestPurpose Compare against default global acis
+ #@TestPreamble none
+ #@TestStep Client compares attribute in an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ and returns true for step 1.
+ -->
+ <testcase name="getTestCaseName('Compare')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Compare, user comparing entry'
+ </message>
+
+ <call function="'compareEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'attrToBeCompared' : 'l:Santa Clara',
+ 'entryToBeCompared' : 'uid=tclow, ou=People, ou=aci branch, o=ACI Tests, dc=example,dc=com' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'true' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Modify
+ #@TestIssue 1402
+ #@TestPurpose Modify against default global acis
+ #@TestPreamble none
+ #@TestStep Client modifies attribute in an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50.
+ -->
+ <testcase name="getTestCaseName('Modify')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Modify, user modifying entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'entryToBeModified' : '%s/aci/global_acis/mod_entry1.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Delete
+ #@TestIssue 1402
+ #@TestPurpose Delete against default global acis
+ #@TestPreamble none
+ #@TestStep Client deletes an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50.
+ -->
+ <testcase name="getTestCaseName('Delete')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Delete, user deleting entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'entryToBeModified' : '%s/aci/global_acis/del_entry1.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Modify RDN
+ #@TestIssue 1402
+ #@TestPurpose Modify RDN against default global acis
+ #@TestPreamble none
+ #@TestStep Client modifies the RDN of an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50.
+ -->
+ <testcase name="getTestCaseName('Modify RDN')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Modify RDN, user modifying rdn of an entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'entryToBeModified' : '%s/aci/global_acis/modrdn_entry1.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker ACI Global Tests
+ #@TestName Global ACI Modify Self
+ #@TestIssue 1402
+ #@TestPurpose Modify self against default global acis
+ #@TestPreamble none
+ #@TestStep Client modifies attribute in the user entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0.
+ -->
+ <testcase name="getTestCaseName('Self Modify')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ACI: Global: Self Modify, user modifying itself'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,ou=people,o=ACI Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'entryToBeModified' : '%s/aci/global_acis/mod_entry2.ldif' % remote.data }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global ACI Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backends.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backends.xml
index f379858..5fa3a26 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backends.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backends.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_backends"/>
@@ -32,6 +32,8 @@
<function-required-arg name="STAXParentID"/>
</function-list-args>
<sequence>
+
+ <try>
<block name="'backends'">
<sequence>
@@ -49,27 +51,58 @@
<!-- List of backends test suites to run -->
<script>
- testList = []
- testList.append('import')
- testList.append('import-tasks')
- testList.append('backup')
- testList.append('backup-tasks')
- testList.append('restore')
- testList.append('restore-tasks')
- testList.append('export')
- testList.append('export-tasks')
+ suiteList = []
+ suiteList.append('import')
+ suiteList.append('import-tasks')
+ suiteList.append('backup')
+ suiteList.append('backup-tasks')
+ suiteList.append('restore')
+ suiteList.append('restore-tasks')
+ suiteList.append('export')
+ suiteList.append('export-tasks')
</script>
-
- <iterate var="_test" in="testList" >
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
<sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/%s.xml' % (TESTS_DIR,_test)"/>
- <call function="'main_%s' % _test" />
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/backends/%s.xml' % (TESTS_DIR,_suite)"/>
+ <call function="'main_%s' % _suite" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
</sequence>
</iterate>
- <call function="'testGroup_Postamble'"/>
+
</sequence>
</block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
+
</sequence>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backendsetup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backendsetup.xml
index 04e533e..65b754d 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backendsetup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backendsetup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -74,16 +74,11 @@
<message>
'Backend: Backend Setup for Export, Backup, and Restore Tests'
</message>
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/backend_start.ldif' % remote.data }
+ <call function="'ImportLdifWithScript'">
+ { 'dsLdifFile' : '%s/backends/backend_start.ldif' % remote.data ,
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE }
</call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
-
<call function="'testCase_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup-tasks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup-tasks.xml
index 5e31de4..1def1dd 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup-tasks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup-tasks.xml
@@ -23,53 +23,77 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_backup-tasks"/>
<function name="main_backup-tasks">
<sequence>
<block name="'backup-tasks'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)" />
- <call function="'backend_setup'"> { 'loadBackend' : True } </call>
- <testcase name="getTestCaseName('Test 1')">
+ <try>
+ <sequence>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <testcase name="getTestCaseName('Test 1')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend ExportTasks1: Backup the data in OpenDS by scheduling a task'
+ </message>
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : '3',
+ 'backupDir' : '%s/backends/' % remote.data
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend ExportTasks1: Backup the data in OpenDS by scheduling a task'
- </message>
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : '3',
- 'backupDir' : '%s/backends/' % remote.data
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'" />
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'"/>
- <call function="'testSuite_Postamble'"/>
- </sequence>
+ </finally>
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup.xml
index 310f3b8..1a7a94e 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/backup.xml
@@ -23,197 +23,223 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_backup"/>
<function name="main_backup">
<sequence>
<block name="'backup'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'" />
- <!--- Test Suite information
- #@TestSuiteName Backend Backup Tests
- #@TestSuitePurpose Verify that the basic backup functionality is working in the Directory Server.
- #@TestSuiteID Backup Tests
- #@TestSuiteGroup Backup
- #@TestGroup Backend
- #@TestScript backup.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'">
- { 'startDS' : False,
- 'loadBackend' : True
- }
- </call>
- <!--- Test Case information
- #@TestMarker Backend Backup Tests
- #@TestName Export: Backup 1
- #@TestID Backup1
- #@TestPurpose Backup the data in OpenDS.
- #@TestPreamble
- #@TestSteps Client calls backup with the parameters
- default backendID, and backupDirectory
- #@TestPostamble
- #@TestResult Success if backup returns 0
- -->
- <testcase name="getTestCaseName('Test 1')">
+
+ <try>
+
+ <sequence>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'" />
+ <!--- Test Suite information
+ #@TestSuiteName Backend Backup Tests
+ #@TestSuitePurpose Verify that the basic backup functionality is working in the Directory Server.
+ #@TestSuiteID Backup Tests
+ #@TestSuiteGroup Backup
+ #@TestGroup Backend
+ #@TestScript backup.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : False ,
+ 'loadData' : False ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker Backend Backup Tests
+ #@TestName Export: Backup 1
+ #@TestID Backup1
+ #@TestPurpose Backup the data in OpenDS.
+ #@TestPreamble
+ #@TestSteps Client calls backup with the parameters
+ default backendID, and backupDirectory
+ #@TestPostamble
+ #@TestResult Success if backup returns 0
+ -->
+ <testcase name="getTestCaseName('Test 1')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend Backup1: Create a backup of the data in OpenDS'
+ </message>
+ <call function="'backup'">
+ { 'backupDir' : '%s/backends/backup1' % remote.data
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Backup Tests
+ #@TestName Export: Backup 2
+ #@TestID Backup2
+ #@TestPurpose Create an incremental backup of the data in OpenDS.
+ #@TestPreamble
+ #@TestSteps Client calls backup with the parameters
+ default backendID, backupDir, and incremental
+ #@TestPostamble
+ #@TestResult Success if backup returns 0
+ -->
+ <testcase name="getTestCaseName('Test 2')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend Backup2: Create an incremental backup of the data in OpenDS'
+ </message>
+ <call function="'backup'">
+ { 'backupDir' : '%s/backends/backup1' % remote.data,
+ 'extraParams' : '-i'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Backup Tests
+ #@TestName Export: Backup 3
+ #@TestID Backup3
+ #@TestPurpose Create a backup of the data in OpenDS with a backup id.
+ #@TestPreamble
+ #@TestSteps Client calls backup with the parameters
+ default backendID, backupDir, and backupID
+ #@TestPostamble
+ #@TestResult Success if backup returns 0
+ -->
+ <testcase name="getTestCaseName('Test 3')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend Backup3: Create a backup of the data in OpenDS with a backup id'
+ </message>
+ <call function="'backup'">
+ { 'backupDir' : '%s/backends/backup2' % remote.data,
+ 'extraParams' : '-I 20070714142807Z'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Backup Tests
+ #@TestName Export: Backup 4
+ #@TestID Backup4
+ #@TestPurpose Create an incremental backup of the data in OpenDS with a backup id.
+ #@TestPreamble
+ #@TestSteps Client calls backup with the parameters
+ default backendID, backupDir, incremental, and backupID
+ #@TestPostamble
+ #@TestResult Success if backup returns 0
+ -->
+ <testcase name="getTestCaseName('Test 4')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ 'Backend Backup4: Create an incremental backup of the data in OpenDS with a backup id'
+ </message>
+ <call function="'backup'">
+ { 'backupDir' : '%s/backends/backup2' % remote.data,
+ 'extraParams' : '-B 20070714142807Z -i'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Backup Tests
+ #@TestName Export: Backup 5
+ #@TestID Backup5
+ #@TestPurpose Create a compressed backup of the data in OpenDS.
+ #@TestPreamble
+ #@TestSteps Client calls backup with the parameters
+ default backendID, backupDir, and compress
+ #@TestPostamble
+ #@TestResult Success if backup returns 0
+ -->
+ <testcase name="getTestCaseName('Test 5')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend Backup5: Create a compressed backup of the data in OpenDS'
+ </message>
+ <call function="'backup'">
+ { 'backupDir' : '%s/backends/backup1' % remote.data,
+ 'extraParams' : '-c'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend Backup1: Create a backup of the data in OpenDS'
- </message>
- <call function="'backup'">
- { 'backupDir' : '%s/backends/backup1' % remote.data
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Backup Tests
- #@TestName Export: Backup 2
- #@TestID Backup2
- #@TestPurpose Create an incremental backup of the data in OpenDS.
- #@TestPreamble
- #@TestSteps Client calls backup with the parameters
- default backendID, backupDir, and incremental
- #@TestPostamble
- #@TestResult Success if backup returns 0
- -->
- <testcase name="getTestCaseName('Test 2')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend Backup2: Create an incremental backup of the data in OpenDS'
- </message>
- <call function="'backup'">
- { 'backupDir' : '%s/backends/backup1' % remote.data,
- 'extraParams' : '-i'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Backup Tests
- #@TestName Export: Backup 3
- #@TestID Backup3
- #@TestPurpose Create a backup of the data in OpenDS with a backup id.
- #@TestPreamble
- #@TestSteps Client calls backup with the parameters
- default backendID, backupDir, and backupID
- #@TestPostamble
- #@TestResult Success if backup returns 0
- -->
- <testcase name="getTestCaseName('Test 3')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend Backup3: Create a backup of the data in OpenDS with a backup id'
- </message>
- <call function="'backup'">
- { 'backupDir' : '%s/backends/backup2' % remote.data,
- 'extraParams' : '-I 20070714142807Z'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Backup Tests
- #@TestName Export: Backup 4
- #@TestID Backup4
- #@TestPurpose Create an incremental backup of the data in OpenDS with a backup id.
- #@TestPreamble
- #@TestSteps Client calls backup with the parameters
- default backendID, backupDir, incremental, and backupID
- #@TestPostamble
- #@TestResult Success if backup returns 0
- -->
- <testcase name="getTestCaseName('Test 4')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <message>
- 'Backend Backup4: Create an incremental backup of the data in OpenDS with a backup id'
- </message>
- <call function="'backup'">
- { 'backupDir' : '%s/backends/backup2' % remote.data,
- 'extraParams' : '-B 20070714142807Z -i'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Backup Tests
- #@TestName Export: Backup 5
- #@TestID Backup5
- #@TestPurpose Create a compressed backup of the data in OpenDS.
- #@TestPreamble
- #@TestSteps Client calls backup with the parameters
- default backendID, backupDir, and compress
- #@TestPostamble
- #@TestResult Success if backup returns 0
- -->
- <testcase name="getTestCaseName('Test 5')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend Backup5: Create a compressed backup of the data in OpenDS'
- </message>
- <call function="'backup'">
- { 'backupDir' : '%s/backends/backup1' % remote.data,
- 'extraParams' : '-c'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'"> { 'stopDS' : False } </call>
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
+
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export-tasks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export-tasks.xml
index 0357f27..6f5b665 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export-tasks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export-tasks.xml
@@ -23,349 +23,372 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_export-tasks"/>
<function name="main_export-tasks">
<sequence>
<block name="'export-tasks'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'" />
- <!--- Test Suite information
- #@TestSuiteName Backend Export Tasks Tests
- #@TestSuitePurpose Verify that the basic export task functionality is working in the Directory Server.
- #@TestSuiteID Export Tasks Tests
- #@TestSuiteGroup Export Tasks
- #@TestGroup Backend
- #@TestScript export.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'"> { 'loadBackend' : True } </call>
+ <try>
<sequence>
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Export Tasks 1
- #@TestID ExportTasks1
- #@TestPurpose Verify an export task of a LDIF file on the default backend.
- #@TestPreamble
- #@TestSteps An ldif file is created that describes the export task to be
- scheduled. The task is scheduled by adding the ldif file
- with the static ldapmodify.
- #@TestPostamble
- #@TestResult Success if OpenDS returns 0
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'" />
+ <!--- Test Suite information
+ #@TestSuiteName Backend Export Tasks Tests
+ #@TestSuitePurpose Verify that the basic export task functionality is working in the Directory Server.
+ #@TestSuiteID Export Tasks Tests
+ #@TestSuiteGroup Export Tasks
+ #@TestGroup Backend
+ #@TestScript export.xml
+ #@TestHTMLLink http://opends.dev.java.net/
-->
- <testcase name="getTestCaseName('Test 1')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend ExportTasks1: Export the data in OpenDS by scheduling a task'
- </message>
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : '1',
- 'ldifFile' : '%s/backends/ExportTasks1.ldif' % remote.data
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: LDIF Default
- #@TestID LDIF Default
- #@TestPurpose Verify an export task of a LDIF file on the default backend.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: LDIF Non Default
- #@TestID LDIF Non Default
- #@TestPurpose Verify an export task of a LDIF file on a differrent backend to the default.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Include Branch
- #@TestID Fractional Include Branch
- #@TestPurpose Verify an export task of a LDIF file specifying a branch that should be included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Include Branches
- #@TestID Fractional Include Branches
- #@TestPurpose Verify an export task of a LDIF file specifying multiple branches that should be included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Exclude Branch
- #@TestID Fractional Exclude Branch
- #@TestPurpose Verify an export task of a LDIF file specifying a branch that should be excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Exclude Branches
- #@TestID Fractional Exclude Branches
- #@TestPurpose Verify an export task of a LDIF file specifying multiple branches that should be excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Branches Mix
- #@TestID Fractional Branches Mix
- #@TestPurpose Verify an export task of a LDIF file specifying a mix of include and exclude branches.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Include Attribute
- #@TestID Fractional Include Attribute
- #@TestPurpose Verify an export task of a LDIF file specifying an attribute that should be included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Include Attributes
- #@TestID Fractional Include Attributes
- #@TestPurpose Verify an export task of a LDIF file specifying multiple attributes that should be included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Exclude Attribute
- #@TestID Fractional Exclude Attribute
- #@TestPurpose Verify an export task of a LDIF file specifying an attribute that should be excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Exclude Attributes
- #@TestID Fractional Exclude Attributes
- #@TestPurpose Verify an export task of a LDIF file specifying multiple attribute that should be excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Mix
- #@TestID Fractional Mix
- #@TestPurpose Verify an export task of a LDIF file specifying a mix of fractional attributes and branches.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Filtered Include
- #@TestID Filtered Include
- #@TestPurpose Verify an export task of a LDIF file specifying a search filter control which entries are included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Filtered Includes
- #@TestID Filtered Includes
- #@TestPurpose Verify an export task of a LDIF file specifying a search filter control which entries are included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Filtered Excludes
- #@TestID Filtered Excludes
- #@TestPurpose Verify an export task of a LDIF file specifying multiple search filters control which entries are excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Filtered Includes
- #@TestID Filtered Includes
- #@TestPurpose Verify an export task of a LDIF file specifying multiple search filters control which entries are included in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Filtered Excludes Complex
- #@TestID Filtered Excludes Complex
- #@TestPurpose Verify an export task of a LDIF file specifying complex search filters control which entries are excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Filtered Excludes Complex
- #@TestID Filtered Excludes Complex
- #@TestPurpose Verify an export task of a LDIF file specifying complex search filters control which entries are excluded in the export task.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Fractional Filtered Mix
- #@TestID Fractional Filtered Mix
- #@TestPurpose Verify an export task of a LDIF file specifying a mix of fractional and filtered.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Append To LDIF
- #@TestID Append To LDIF
- #@TestPurpose Verify an export task of a LDIF file specifying that the export task process should append to the existing LDIF file.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Compress LDIF
- #@TestID Compress LDIF
- #@TestPurpose Verify an export task where the LDIF file is compressed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Encrypt LDIF
- #@TestID Encrypt LDIF
- #@TestPurpose Verify an export task where the LDIF file is encrypted.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Hash Signed LDIF
- #@TestID Hash Signed LDIF
- #@TestPurpose Verify an export task where the LDIF file is hashed/signed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Wrap Column
- #@TestID Wrap Column
- #@TestPurpose Verify an export task of a LDIF file containing wrapped columns
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tasks Tests
- #@TestName Export Tasks: Error Codes
- #@TestID Error Codes
- #@TestPurpose Verify an export task fails with an error code.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+ <sequence>
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Export Tasks 1
+ #@TestID ExportTasks1
+ #@TestPurpose Verify an export task of a LDIF file on the default backend.
+ #@TestPreamble
+ #@TestSteps An ldif file is created that describes the export task to be
+ scheduled. The task is scheduled by adding the ldif file
+ with the static ldapmodify.
+ #@TestPostamble
+ #@TestResult Success if OpenDS returns 0
+ -->
+ <testcase name="getTestCaseName('Test 1')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend ExportTasks1: Export the data in OpenDS by scheduling a task'
+ </message>
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : '1',
+ 'ldifFile' : '%s/backends/ExportTasks1.ldif' % remote.data
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: LDIF Default
+ #@TestID LDIF Default
+ #@TestPurpose Verify an export task of a LDIF file on the default backend.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: LDIF Non Default
+ #@TestID LDIF Non Default
+ #@TestPurpose Verify an export task of a LDIF file on a differrent backend to the default.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Include Branch
+ #@TestID Fractional Include Branch
+ #@TestPurpose Verify an export task of a LDIF file specifying a branch that should be included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Include Branches
+ #@TestID Fractional Include Branches
+ #@TestPurpose Verify an export task of a LDIF file specifying multiple branches that should be included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Exclude Branch
+ #@TestID Fractional Exclude Branch
+ #@TestPurpose Verify an export task of a LDIF file specifying a branch that should be excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Exclude Branches
+ #@TestID Fractional Exclude Branches
+ #@TestPurpose Verify an export task of a LDIF file specifying multiple branches that should be excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Branches Mix
+ #@TestID Fractional Branches Mix
+ #@TestPurpose Verify an export task of a LDIF file specifying a mix of include and exclude branches.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Include Attribute
+ #@TestID Fractional Include Attribute
+ #@TestPurpose Verify an export task of a LDIF file specifying an attribute that should be included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Include Attributes
+ #@TestID Fractional Include Attributes
+ #@TestPurpose Verify an export task of a LDIF file specifying multiple attributes that should be included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Exclude Attribute
+ #@TestID Fractional Exclude Attribute
+ #@TestPurpose Verify an export task of a LDIF file specifying an attribute that should be excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Exclude Attributes
+ #@TestID Fractional Exclude Attributes
+ #@TestPurpose Verify an export task of a LDIF file specifying multiple attribute that should be excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Mix
+ #@TestID Fractional Mix
+ #@TestPurpose Verify an export task of a LDIF file specifying a mix of fractional attributes and branches.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Filtered Include
+ #@TestID Filtered Include
+ #@TestPurpose Verify an export task of a LDIF file specifying a search filter control which entries are included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Filtered Includes
+ #@TestID Filtered Includes
+ #@TestPurpose Verify an export task of a LDIF file specifying a search filter control which entries are included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Filtered Excludes
+ #@TestID Filtered Excludes
+ #@TestPurpose Verify an export task of a LDIF file specifying multiple search filters control which entries are excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Filtered Includes
+ #@TestID Filtered Includes
+ #@TestPurpose Verify an export task of a LDIF file specifying multiple search filters control which entries are included in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Filtered Excludes Complex
+ #@TestID Filtered Excludes Complex
+ #@TestPurpose Verify an export task of a LDIF file specifying complex search filters control which entries are excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Filtered Excludes Complex
+ #@TestID Filtered Excludes Complex
+ #@TestPurpose Verify an export task of a LDIF file specifying complex search filters control which entries are excluded in the export task.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Fractional Filtered Mix
+ #@TestID Fractional Filtered Mix
+ #@TestPurpose Verify an export task of a LDIF file specifying a mix of fractional and filtered.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Append To LDIF
+ #@TestID Append To LDIF
+ #@TestPurpose Verify an export task of a LDIF file specifying that the export task process should append to the existing LDIF file.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Compress LDIF
+ #@TestID Compress LDIF
+ #@TestPurpose Verify an export task where the LDIF file is compressed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Encrypt LDIF
+ #@TestID Encrypt LDIF
+ #@TestPurpose Verify an export task where the LDIF file is encrypted.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Hash Signed LDIF
+ #@TestID Hash Signed LDIF
+ #@TestPurpose Verify an export task where the LDIF file is hashed/signed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Wrap Column
+ #@TestID Wrap Column
+ #@TestPurpose Verify an export task of a LDIF file containing wrapped columns
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tasks Tests
+ #@TestName Export Tasks: Error Codes
+ #@TestID Error Codes
+ #@TestPurpose Verify an export task fails with an error code.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ </sequence>
+
</sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'"/>
- <call function="'testSuite_Postamble'"/>
- </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export.xml
index 01e9179..b182197 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/export.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -31,2014 +31,2033 @@
<function name="main_export">
<sequence>
<block name="'export'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'"/>
- <!--- Test Suite information
- #@TestSuiteName Backend: Export: Export Tests
- #@TestSuitePurpose Verify that the export functionality is working in the Directory Server.
- #@TestSuiteID Backend Export Tests
- #@TestSuiteGroup Export
- #@TestGroup Backend
- #@TestScript export.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'">
- { 'startDS' : False,
- 'loadBackend' : True
- }
- </call>
-
- <!-- Create a second instance to import data that was exported from the first instance -->
- <message>
- 'Creating another instance for verifing the exports'
- </message>
-
- <script>
- DsInstancePort = int(DIRECTORY_INSTANCE_PORT)+1
- DsInstanceAdminPort = int(DIRECTORY_INSTANCE_ADMIN_PORT)+1
- DsInstanceDir = '%s/server2' % DIRECTORY_INSTANCE_DIR
- </script>
-
- <call function="'createInstance'">
- { 'dsHost' : '%s' % DIRECTORY_INSTANCE_HOST,
- 'dsDir' : DsInstanceDir,
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : '%s' % DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : '%s' % DIRECTORY_INSTANCE_PSWD,
- 'dsBaseDN' : '%s' % DIRECTORY_INSTANCE_SFX
- }
- </call>
-
- <!-- Set the server backup the way it was before the backend tests -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/quickstart/quickstart.xml' % (TESTS_DIR)"/>
- <call function="'main_quickstart'" />
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: LDIF Default
- #@TestID LDIF Default
- #@TestPurpose Verify an export of a LDIF file on the default backend.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export default backend')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <message>
- 'Backend: Export: Export default backend'
- </message>
- <call function="'exportLdif'">
- {
- 'ldifFile' : '%s/backends/Export_default.ldif' % remote.data,
- 'backEnd' : '%s' % DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_default.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: LDIF Non Default
- #@TestID LDIF Non Default
- #@TestPurpose Verify an export of a LDIF file on a differrent backend to the default.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- non-default backend, and ldifFile
- #@TestPostamble
- #@TestResult Success if Success if exportLDIF, importLDIF returns 0
- -->
- <testcase name="getTestCaseName('Export non-default backend')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export non-default backend'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_schema.ldif' % remote.data,
- 'backEnd' : 'schema'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_schema.ldif' % remote.data,
- 'backEnd' : 'schema',
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'knownIssue' : '2173'
- }
- </call>
+ <try>
+ <sequence>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'"/>
+ <!--- Test Suite information
+ #@TestSuiteName Backend: Export: Export Tests
+ #@TestSuitePurpose Verify that the export functionality is working in the Directory Server.
+ #@TestSuiteID Backend Export Tests
+ #@TestSuiteGroup Export
+ #@TestGroup Backend
+ #@TestScript export.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Include Branch
- #@TestID Fractional Include Branch
- #@TestPurpose Verify an export of a LDIF file specifying a branch that should be included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and -b option. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Include Branch')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Include Branch'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeBranch.ldif' % remote.data,
- 'extraParams' : '-b "dc=com"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeBranch.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Include Branches
- #@TestID Fractional Include Branches
- #@TestPurpose Verify an export of a LDIF file specifying multiple branches that should be included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and two -b options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Include Branches')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Include Branches'
- </message>
- <call function="'exportLdif'">
- {
- 'ldifFile' : '%s/backends/Export_IncludeBranches.ldif' % remote.data,
- 'extraParams' : '-b "dc=com" -b "dc=example,dc=com"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeBranches.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Exclude Branch
- #@TestID Fractional Exclude Branch
- #@TestPurpose Verify an export of a LDIF file specifying a branch that should be excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and -B option. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Exclude Branch')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Exclude Branch'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeBranch.ldif' % remote.data,
- 'extraParams' : '-B "dc=example,dc=com"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeBranch.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'missingEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com'],
- 'expectedEntries' : ['dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Exclude Branches
- #@TestID Fractional Exclude Branches
- #@TestPurpose Verify an export of a LDIF file specifying multiple branches that should be excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and two -B options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Exclude Branches')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Exclude Branches'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeBranches.ldif' % remote.data,
- 'extraParams' : '-B "ou=People,dc=example,dc=com" -B "dc=example,dc=com"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeBranches.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'missingEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com'],
- 'expectedEntries' : ['dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Branches Mix
- #@TestID Fractional Branches Mix
- #@TestPurpose Verify an export of a LDIF file specifying a mix of include and exclude branches.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, both -b and -B options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Branches Mix')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Branches Mix'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_MixBranches.ldif' % remote.data,
- 'extraParams' : '-b "dc=com" -B "ou=People,dc=example,dc=com"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_MixBranches.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort}
- </call>
-
- <call function="'checkImport'">
- { 'missingEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com'],
- 'expectedEntries' : ['dc=com','dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'}
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Include Attribute
- #@TestID Fractional Include Attribute
- #@TestPurpose Verify an export of a LDIF file specifying an attribute that should be included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and -i option. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Include Attribute')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Include Attribute'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeAttr.ldif' % remote.data,
- 'extraParams' : '-i dc'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeAttr.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=com','dc=example,dc=com'],
- 'missingEntries' : ['ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Include Attributes
- #@TestID Fractional Include Attributes
- #@TestPurpose Verify an export of a LDIF file specifying multiple attributes that should be included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and five -i options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Include Attributes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Include Attributes'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeAttrs.ldif' % remote.data,
- 'extraParams' : '-i dc -i cn -i ou -i sn -i uid'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_IncludeAttrs.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Exclude Attribute
- #@TestID Fractional Exclude Attribute
- #@TestPurpose Verify an export of a LDIF file specifying an attribute that should be excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and -e option. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Exclude Attribute')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Exclude Attribute'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeAttr.ldif' % remote.data,
- 'extraParams' : '-e userpassword'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeAttr.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Exclude Attributes
- #@TestID Fractional Exclude Attributes
- #@TestPurpose Verify an export of a LDIF file specifying multiple attribute that should be excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and three -e options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Exclude Attributes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Exclude Attributes'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeAttrs.ldif' % remote.data,
- 'extraParams' : '-e userpassword -e mail -e roomnumber'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_ExcludeAttrs.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword','mail','roomnumber'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Mix
- #@TestID Fractional Mix
- #@TestPurpose Verify an export of a LDIF file specifying a mix of fractional attributes and branches.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and mixed -i, -b, and -B options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Mix')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Mix'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FractionalMix.ldif' % remote.data,
- 'extraParams' : '-i dc -i cn -i ou -i sn -i uid -b "dc=com" -b "dc=example,dc=com" -b "ou=People,dc=example,dc=com" -B "ou=Departed,ou=People,dc=example,dc=com"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FractionalMix.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Include
- #@TestID Filtered Include
- #@TestPurpose Verify an export of a LDIF file specifying a search filter control which entries are included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and -I option. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Include')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Include'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredInclude.ldif' % remote.data,
- 'extraParams' : '-I "objectclass=*"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredInclude.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Includes
- #@TestID Filtered Includes
- #@TestPurpose Verify an export of a LDIF file specifying a search filter control which entries are included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and two -I options. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Includes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Includes'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
- 'extraParams' : '-I "objectclass=domain" -I "objectclass=organizationalunit"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com', 'dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'}
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Exclude
- #@TestID Filtered Exclude
- #@TestPurpose Verify an export of a LDIF file specifying search filter control which entries are excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, an ldifFile, and -E option. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Exclude')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Exclude'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredExclude.ldif' % remote.data,
- 'extraParams' : '-E "objectclass=person"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredExclude.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Excludes
- #@TestID Filtered Excludes
- #@TestPurpose Verify an export of a LDIF file specifying multiple search filters control which entries are excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Excludes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Excludes'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredExcludes.ldif' % remote.data,
- 'extraParams' : '-E "objectclass=person" -E "objectclass=organizationalunit"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredExcludes.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Includes
- #@TestID Filtered Includes
- #@TestPurpose Verify an export of a LDIF file specifying multiple search filters control which entries are included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Includes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Includes'
- </message>
- <call function="'exportLdif'">
- {
- 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
- 'extraParams' : '-I "objectclass=domain" -I "objectclass=organizationalunit"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort}
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'}
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd}
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Includes Complex
- #@TestID Filtered Includes Complex
- #@TestPurpose Verify an export of a LDIF file specifying complex search filters control which entries are included in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Includes Complex')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Includes Complex'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredComplexIncludes.ldif' % remote.data,
- 'extraParams' : '-I "|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)"'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredComplexIncludes.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd}
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Filtered Excludes Complex
- #@TestID Filtered Excludes Complex
- #@TestPurpose Verify an export of a LDIF file specifying complex search filters control which entries are excluded in the export.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Filtered Excludes Complex')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Filtered Excludes Complex'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredComplexExcludes.ldif' % remote.data,
- 'extraParams' : '-E "&(objectclass=person)(ou=Departed)"'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredComplexExcludes.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Fractional Filtered Mix
- #@TestID Fractional Filtered Mix
- #@TestPurpose Verify an export of a LDIF file specifying a mix of fractional and filtered.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Fractional Filtered Mix')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Fractional Filtered Mix'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
- 'extraParams' : '-E "&(objectclass=person)(ou=Departed)" -b "dc=com" -e userpassword'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Append To LDIF
- #@TestID Append To LDIF
- #@TestPurpose Verify an export of a LDIF file specifying that the export process should append to the existing LDIF file.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Append To LDIF')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Append To LDIF'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
- 'extraParams' : '-a'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Compress LDIF
- #@TestID Compress LDIF
- #@TestPurpose Verify an export where the LDIF file is compressed.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Compress LDIF')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Compress LDIF'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/ExportCompressed.ldif' % remote.data,
- 'extraParams' : '-c'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/ExportCompressed.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'extraParams' : '-c'}
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
- </call>
-
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
-
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Encrypt LDIF
- #@TestID Encrypt LDIF
- #@TestPurpose Verify an export where the LDIF file is encrypted.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Encrypt LDIF')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Encrypt LDIF'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/ExportEncrypted.ldif' % remote.data,
- 'extraParams' : '-y'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC,
- 'result' : STAXResult
- }
- </call>
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/ExportEncrypted.ldif' % remote.data,
- 'extraParams' : '-y',
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Export: Hash Signed LDIF
- #@TestID Hash Signed LDIF
- #@TestPurpose Verify an export where the LDIF file is hashed/signed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Wrap Column
- #@TestID Wrap Column
- #@TestPurpose Verify an export of a LDIF file containing wrapped columns
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <testcase name="getTestCaseName('Export Wrap Column')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend: Export: Export Wrap Column'
- </message>
- <call function="'exportLdif'">
- { 'ldifFile' : '%s/backends/ExportWrapCol.ldif' % remote.data,
- 'extraParams' : '--wrapColumn 25'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/ExportWrapCol.ldif' % remote.data,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <!-- StartDS -->
- <call function="'StartDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
- }
- </call>
- <!-- Wait for DS to start -->
- <call function="'isAlive'">
- { 'location' : mylocation,
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsInstancePort' : DsInstancePort
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
- 'uid=kvaughan,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsPort' : DsInstancePort,
- 'dsAdminPort' : DsInstanceAdminPort,
- 'startDS' : 'no'
- }
- </call>
- <!-- StopDS -->
- <call function="'StopDsWithScript'">
- { 'location' : mylocation,
- 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
- 'dsAdminPort' : DsInstanceAdminPort,
- 'dsBindDN' : mydn,
- 'dsBindPwd' : mypswd
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : False ,
+ 'loadData' : False ,
+ 'stopServer' : False
+ }
+ </call>
- <!--- Test Case information
- #@TestMarker Backend Export Tests
- #@TestName Backend: Export: Error Codes
- #@TestID Error Codes
- #@TestPurpose Verify an export fails with an error code.
- #@TestPreamble
- #@TestSteps Client calls exportLDIF with the parameters
- default backend, and ldifFile. Import the ldifFile to
- a second instance, then do a search to verify the import.
- #@TestPostamble
- #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
- -->
- <!-- Need to know what the error codes are -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'"> { 'stopDS' : False } </call>
-
- <call function="'testSuite_Postamble'"/>
- </sequence>
+ <!-- Create a second instance to import data that was exported from the first instance -->
+ <message>
+ 'Creating another instance for verifing the exports'
+ </message>
+
+ <script>
+ DsInstancePort = int(DIRECTORY_INSTANCE_PORT)+1
+ DsInstanceAdminPort = int(DIRECTORY_INSTANCE_ADMIN_PORT)+1
+ DsInstanceDir = '%s/server2' % DIRECTORY_INSTANCE_DIR
+ </script>
+
+ <call function="'createInstance'">
+ { 'dsHost' : '%s' % DIRECTORY_INSTANCE_HOST,
+ 'dsDir' : DsInstanceDir,
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : '%s' % DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : '%s' % DIRECTORY_INSTANCE_PSWD,
+ 'dsBaseDN' : '%s' % DIRECTORY_INSTANCE_SFX
+ }
+ </call>
+
+ <!-- Set the server backup the way it was before the backend tests -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/quickstart/quickstart.xml' % (TESTS_DIR)"/>
+ <call function="'main_quickstart'" />
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: LDIF Default
+ #@TestID LDIF Default
+ #@TestPurpose Verify an export of a LDIF file on the default backend.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export default backend')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ 'Backend: Export: Export default backend'
+ </message>
+ <call function="'exportLdif'">
+ {
+ 'ldifFile' : '%s/backends/Export_default.ldif' % remote.data,
+ 'backEnd' : '%s' % DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_default.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: LDIF Non Default
+ #@TestID LDIF Non Default
+ #@TestPurpose Verify an export of a LDIF file on a differrent backend to the default.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ non-default backend, and ldifFile
+ #@TestPostamble
+ #@TestResult Success if Success if exportLDIF, importLDIF returns 0
+ -->
+ <testcase name="getTestCaseName('Export non-default backend')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export non-default backend'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_schema.ldif' % remote.data,
+ 'backEnd' : 'schema'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_schema.ldif' % remote.data,
+ 'backEnd' : 'schema',
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'knownIssue' : '2173'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Include Branch
+ #@TestID Fractional Include Branch
+ #@TestPurpose Verify an export of a LDIF file specifying a branch that should be included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and -b option. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Include Branch')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Include Branch'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeBranch.ldif' % remote.data,
+ 'extraParams' : '-b "dc=com"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeBranch.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Include Branches
+ #@TestID Fractional Include Branches
+ #@TestPurpose Verify an export of a LDIF file specifying multiple branches that should be included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and two -b options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Include Branches')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Include Branches'
+ </message>
+ <call function="'exportLdif'">
+ {
+ 'ldifFile' : '%s/backends/Export_IncludeBranches.ldif' % remote.data,
+ 'extraParams' : '-b "dc=com" -b "dc=example,dc=com"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeBranches.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Exclude Branch
+ #@TestID Fractional Exclude Branch
+ #@TestPurpose Verify an export of a LDIF file specifying a branch that should be excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and -B option. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Exclude Branch')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Exclude Branch'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeBranch.ldif' % remote.data,
+ 'extraParams' : '-B "dc=example,dc=com"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeBranch.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'missingEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com'],
+ 'expectedEntries' : ['dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Exclude Branches
+ #@TestID Fractional Exclude Branches
+ #@TestPurpose Verify an export of a LDIF file specifying multiple branches that should be excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and two -B options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Exclude Branches')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Exclude Branches'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeBranches.ldif' % remote.data,
+ 'extraParams' : '-B "ou=People,dc=example,dc=com" -B "dc=example,dc=com"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeBranches.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'missingEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com'],
+ 'expectedEntries' : ['dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Branches Mix
+ #@TestID Fractional Branches Mix
+ #@TestPurpose Verify an export of a LDIF file specifying a mix of include and exclude branches.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, both -b and -B options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Branches Mix')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Branches Mix'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_MixBranches.ldif' % remote.data,
+ 'extraParams' : '-b "dc=com" -B "ou=People,dc=example,dc=com"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_MixBranches.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort}
+ </call>
+
+ <call function="'checkImport'">
+ { 'missingEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com'],
+ 'expectedEntries' : ['dc=com','dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'}
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Include Attribute
+ #@TestID Fractional Include Attribute
+ #@TestPurpose Verify an export of a LDIF file specifying an attribute that should be included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and -i option. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Include Attribute')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Include Attribute'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeAttr.ldif' % remote.data,
+ 'extraParams' : '-i dc'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeAttr.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=com','dc=example,dc=com'],
+ 'missingEntries' : ['ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Include Attributes
+ #@TestID Fractional Include Attributes
+ #@TestPurpose Verify an export of a LDIF file specifying multiple attributes that should be included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and five -i options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Include Attributes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Include Attributes'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeAttrs.ldif' % remote.data,
+ 'extraParams' : '-i dc -i cn -i ou -i sn -i uid'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_IncludeAttrs.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Exclude Attribute
+ #@TestID Fractional Exclude Attribute
+ #@TestPurpose Verify an export of a LDIF file specifying an attribute that should be excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and -e option. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Exclude Attribute')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Exclude Attribute'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeAttr.ldif' % remote.data,
+ 'extraParams' : '-e userpassword'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeAttr.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Exclude Attributes
+ #@TestID Fractional Exclude Attributes
+ #@TestPurpose Verify an export of a LDIF file specifying multiple attribute that should be excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and three -e options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Exclude Attributes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Exclude Attributes'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeAttrs.ldif' % remote.data,
+ 'extraParams' : '-e userpassword -e mail -e roomnumber'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_ExcludeAttrs.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword','mail','roomnumber'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Mix
+ #@TestID Fractional Mix
+ #@TestPurpose Verify an export of a LDIF file specifying a mix of fractional attributes and branches.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and mixed -i, -b, and -B options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Mix')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Mix'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FractionalMix.ldif' % remote.data,
+ 'extraParams' : '-i dc -i cn -i ou -i sn -i uid -b "dc=com" -b "dc=example,dc=com" -b "ou=People,dc=example,dc=com" -B "ou=Departed,ou=People,dc=example,dc=com"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FractionalMix.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Include
+ #@TestID Filtered Include
+ #@TestPurpose Verify an export of a LDIF file specifying a search filter control which entries are included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and -I option. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Include')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Include'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredInclude.ldif' % remote.data,
+ 'extraParams' : '-I "objectclass=*"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredInclude.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Includes
+ #@TestID Filtered Includes
+ #@TestPurpose Verify an export of a LDIF file specifying a search filter control which entries are included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and two -I options. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Includes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Includes'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
+ 'extraParams' : '-I "objectclass=domain" -I "objectclass=organizationalunit"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com', 'dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'}
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Exclude
+ #@TestID Filtered Exclude
+ #@TestPurpose Verify an export of a LDIF file specifying search filter control which entries are excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, an ldifFile, and -E option. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Exclude')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Exclude'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredExclude.ldif' % remote.data,
+ 'extraParams' : '-E "objectclass=person"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredExclude.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Excludes
+ #@TestID Filtered Excludes
+ #@TestPurpose Verify an export of a LDIF file specifying multiple search filters control which entries are excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Excludes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Excludes'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredExcludes.ldif' % remote.data,
+ 'extraParams' : '-E "objectclass=person" -E "objectclass=organizationalunit"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredExcludes.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Includes
+ #@TestID Filtered Includes
+ #@TestPurpose Verify an export of a LDIF file specifying multiple search filters control which entries are included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Includes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Includes'
+ </message>
+ <call function="'exportLdif'">
+ {
+ 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
+ 'extraParams' : '-I "objectclass=domain" -I "objectclass=organizationalunit"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredIncludes.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort}
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'}
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd}
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Includes Complex
+ #@TestID Filtered Includes Complex
+ #@TestPurpose Verify an export of a LDIF file specifying complex search filters control which entries are included in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Includes Complex')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Includes Complex'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredComplexIncludes.ldif' % remote.data,
+ 'extraParams' : '-I "|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)"'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredComplexIncludes.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd}
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Filtered Excludes Complex
+ #@TestID Filtered Excludes Complex
+ #@TestPurpose Verify an export of a LDIF file specifying complex search filters control which entries are excluded in the export.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Filtered Excludes Complex')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Filtered Excludes Complex'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredComplexExcludes.ldif' % remote.data,
+ 'extraParams' : '-E "&(objectclass=person)(ou=Departed)"'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredComplexExcludes.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Fractional Filtered Mix
+ #@TestID Fractional Filtered Mix
+ #@TestPurpose Verify an export of a LDIF file specifying a mix of fractional and filtered.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Fractional Filtered Mix')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Fractional Filtered Mix'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
+ 'extraParams' : '-E "&(objectclass=person)(ou=Departed)" -b "dc=com" -e userpassword'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Append To LDIF
+ #@TestID Append To LDIF
+ #@TestPurpose Verify an export of a LDIF file specifying that the export process should append to the existing LDIF file.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Append To LDIF')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Append To LDIF'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
+ 'extraParams' : '-a'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Export_FilteredMix.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Compress LDIF
+ #@TestID Compress LDIF
+ #@TestPurpose Verify an export where the LDIF file is compressed.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Compress LDIF')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Compress LDIF'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/ExportCompressed.ldif' % remote.data,
+ 'extraParams' : '-c'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/ExportCompressed.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'extraParams' : '-c'}
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)}
+ </call>
+
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Encrypt LDIF
+ #@TestID Encrypt LDIF
+ #@TestPurpose Verify an export where the LDIF file is encrypted.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Encrypt LDIF')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Encrypt LDIF'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/ExportEncrypted.ldif' % remote.data,
+ 'extraParams' : '-y'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/ExportEncrypted.ldif' % remote.data,
+ 'extraParams' : '-y',
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Export: Hash Signed LDIF
+ #@TestID Hash Signed LDIF
+ #@TestPurpose Verify an export where the LDIF file is hashed/signed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Wrap Column
+ #@TestID Wrap Column
+ #@TestPurpose Verify an export of a LDIF file containing wrapped columns
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <testcase name="getTestCaseName('Export Wrap Column')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend: Export: Export Wrap Column'
+ </message>
+ <call function="'exportLdif'">
+ { 'ldifFile' : '%s/backends/ExportWrapCol.ldif' % remote.data,
+ 'extraParams' : '--wrapColumn 25'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/ExportWrapCol.ldif' % remote.data,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <!-- StartDS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME)
+ }
+ </call>
+ <!-- Wait for DS to start -->
+ <call function="'isAlive'">
+ { 'location' : mylocation,
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsInstancePort' : DsInstancePort
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=tmorris,ou=People,dc=example,dc=com',
+ 'uid=kvaughan,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsPort' : DsInstancePort,
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'startDS' : 'no'
+ }
+ </call>
+ <!-- StopDS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : mylocation,
+ 'dsPath' : '%s/%s' % (DsInstanceDir, OPENDSNAME),
+ 'dsAdminPort' : DsInstanceAdminPort,
+ 'dsBindDN' : mydn,
+ 'dsBindPwd' : mypswd
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Export Tests
+ #@TestName Backend: Export: Error Codes
+ #@TestID Error Codes
+ #@TestPurpose Verify an export fails with an error code.
+ #@TestPreamble
+ #@TestSteps Client calls exportLDIF with the parameters
+ default backend, and ldifFile. Import the ldifFile to
+ a second instance, then do a search to verify the import.
+ #@TestPostamble
+ #@TestResult Success if exportLDIF, importLDIF, and checkImport returns 0
+ -->
+ <!-- Need to know what the error codes are -->
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import-tasks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import-tasks.xml
index 61c83a2..2543674 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import-tasks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import-tasks.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -31,1012 +31,337 @@
<function name="main_import-tasks">
<sequence>
<block name="'import-tasks'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'"/>
+
+ <try>
- <!--- Test Suite information
- #@TestSuiteName Backend Import Tasks Tests
- #@TestSuitePurpose Verify that the basic import using the task based functionality is working in the Directory Server.
- #@TestSuiteID Import Tasks Tests
- #@TestSuiteGroup Import-Tasks
- #@TestGroup Backend
- #@TestScript import-tasks.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'" />
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Import Tasks: LDIF Default
- #@TestID LDIF Default
- #@TestPurpose Verify an import task of a LDIF file using the default backend.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('LDIF Default')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Example.ldif' % remote.data
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Include Branch
- #@TestID Fractional Include Branch
- #@TestPurpose Verify an import task of a LDIF file specifying a branch that should be included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Include Branch')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeBranches' : ['dc=com'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Include Branches
- #@TestID Fractional Include Branches
- #@TestPurpose Verify an import task of a LDIF file specifying multiple branches that should be included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Include Branches')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeBranches' : ['dc=com','dc=example,dc=com']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Exclude Branch
- #@TestID Fractional Exclude Branch
- #@TestPurpose Verify an import task of a LDIF file specifying a branch that should be excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Exclude Branch')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Exclude Branches
- #@TestID Fractional Exclude Branches
- #@TestPurpose Verify an import task of a LDIF file specifying multiple branches that should be excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Exclude Branches')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com',
- 'cn=QA Managers,ou=groups,dc=example,dc=com']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=bbaret,cn=QA Managers,ou=groups,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Branches Mix
- #@TestID Fractional Branches Mix
- #@TestPurpose Verify an import task of a LDIF file specifying a mix of include and exclude branches.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Branches Mix')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'includeBranches' : ['dc=com'],
- 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Include Attribute
- #@TestID Fractional Include Attribute
- #@TestPurpose Verify an import task of a LDIF file specifying an attribute that should be included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Include Attribute')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeAttributes' : ['dc'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=com','dc=example,dc=com'],
- 'missingEntries' : ['ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Include Attributes
- #@TestID Fractional Include Attributes
- #@TestPurpose Verify an import task of a LDIF file specifying multiple attributes that should be included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Include Attributes')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeAttributes' : ['dc','cn','ou','sn']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Exclude Attribute
- #@TestID Fractional Exclude Attribute
- #@TestPurpose Verify an import task of a LDIF file specifying an attribute that should be excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Exclude Attribute')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeAttributes' : ['userpassword']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Exclude Attributes
- #@TestID Fractional Exclude Attributes
- #@TestPurpose Verify an import task of a LDIF file specifying multiple attribute that should be excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Exclude Attributes')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeAttributes' : ['userpassword','mail','roomnumber']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword','mail','roomnumber'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Mix
- #@TestID Fractional Mix
- #@TestPurpose Verify an import task of a LDIF file specifying a mix of fractional attributes and branches.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Mix')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'includeBranches' : ['dc=com','dc=example,dc=com','ou=People,dc=example,dc=com'],
- 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
- 'includeAttributes' : ['dc','cn','ou','sn'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Filtered Include
- #@TestID Filtered Include
- #@TestPurpose Verify an import task of a LDIF file specifying a search filter control which entries are included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Filtered Include')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeFilters' : ['objectclass=*'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Filtered Exclude
- #@TestID Filtered Exclude
- #@TestPurpose Verify an import task of a LDIF file specifying a search filter control which entries are excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Filtered Exclude')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeFilters' : ['objectclass=person'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Filtered Includes
- #@TestID Filtered Includes
- #@TestPurpose Verify an import task of a LDIF file specifying multiple search filters control which entries are included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Filtered Includes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeFilters' : ['objectclass=domain*','objectclass=organizationalunit']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Filtered Excludes
- #@TestID Filtered Excludes
- #@TestPurpose Verify an import task of a LDIF file specifying multiple search filters control which entries are excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Filtered Excludes')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeFilters' : ['objectclass=person','objectclass=organizationalunit'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com'],
- 'missingEntries' : ['ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Filtered Includes Complex
- #@TestID Filtered Includes Complex
- #@TestPurpose Verify an import task of a LDIF file specifying complex search filters control which entries are included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Filtered Includes Complex')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
- 'includeFilters' : ['|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Filtered Excludes Complex
- #@TestID Filtered Excludes Complex
- #@TestPurpose Verify an import task of a LDIF file specifying complex search filters control which entries are excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Filtered Excludes Complex')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeFilters' : ['&(objectclass=person)(ou=Departed)'],
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Fractional Filtered Mix
- #@TestID Fractional Filtered Mix
- #@TestPurpose Verify an import task of a LDIF file specifying a mix of fractional and filtered.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Fractional Filtered Mix')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'excludeFilters' : ['&(objectclass=person)(ou=Departed)'],
- 'includeBranches' : ['dc=com'],
- 'excludeAttributes' : ['userpassword']
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Append
- #@TestID Append
- #@TestPurpose Verify an import task of a LDIF file specifying that the import process should append to the existing database.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Append')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Append.ldif' % remote.data,
- 'append' : 'TRUE'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
- 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks:Append Replace Existing
- #@TestID Append Replace Existing
- #@TestPurpose Verify an import task of a LDIF file specifying that an existing entry should be replaced when appending to an existing database.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Append Replace Existing')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Append.ldif' % remote.data,
- 'append' : 'TRUE',
- 'replaceExisting' : 'TRUE'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
- 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Compressed
- #@TestID Compressed
- #@TestPurpose Verify an import task of a LDIF file specifying the data to import is compressed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Compressed')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Example.ldif.gz' % remote.data,
- 'isCompressed' : 'TRUE'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Encrypted
- #@TestID Encrypted
- #@TestPurpose Verify an import task of a LDIF file specifying the data to import is encrypted.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Encrypted')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
- 'isEncrypted' : 'TRUE'
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : 1 ,
- 'expected' : 0 ,
- 'result' : 'Encrypted LDIF export is not implemented',
- 'issue' : '839'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Hashed Signed
- #@TestID Hashed Signed
- #@TestPurpose Verify an import task of a LDIF file specifying the data to import is hashed/signed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <!-- Test Not Implemented. Feature not avaliable -->
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Rejects File
- #@TestID Rejects File
- #@TestPurpose Verify an import task of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is not overwritten.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Rejects File')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
- 'rejectsFile' : './rejects'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <!-- Should check there is a rejects file and the contents are correct -->
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Rejects File Overwrite
- #@TestID Rejects File Overwrite
- #@TestPurpose Verify an import task of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is overwritten.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Overwrite Rejects File')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
- 'rejectsFile' : './rejects',
- 'overwriteRejectsFile' : 'TRUE'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <!-- Should check there is a rejects file and the contents are correct -->
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Skip Schema Validation Accept
- #@TestID Skip Schema Validation Accept
- #@TestPurpose Verify an import task of a LDIF file containing invalided schema is accepted when skip schema validation is specified
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Skip Schema Validation Accept')">
+ <sequence>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'"/>
+
+ <!--- Test Suite information
+ #@TestSuiteName Backend Import Tasks Tests
+ #@TestSuitePurpose Verify that the basic import using the task based functionality is working in the Directory Server.
+ #@TestSuiteID Import Tasks Tests
+ #@TestSuiteGroup Import-Tasks
+ #@TestGroup Backend
+ #@TestScript import-tasks.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Import Tasks: LDIF Default
+ #@TestID LDIF Default
+ #@TestPurpose Verify an import task of a LDIF file using the default backend.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('LDIF Default')">
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Schema.ldif' % remote.data,
- 'skipSchemaValidation' : 'TRUE'
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Example.ldif' % remote.data
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Include Branch
+ #@TestID Fractional Include Branch
+ #@TestPurpose Verify an import task of a LDIF file specifying a branch that should be included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Include Branch')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeBranches' : ['dc=com'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Include Branches
+ #@TestID Fractional Include Branches
+ #@TestPurpose Verify an import task of a LDIF file specifying multiple branches that should be included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Include Branches')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeBranches' : ['dc=com','dc=example,dc=com']
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Exclude Branch
+ #@TestID Fractional Exclude Branch
+ #@TestPurpose Verify an import task of a LDIF file specifying a branch that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Exclude Branch')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Exclude Branches
+ #@TestID Fractional Exclude Branches
+ #@TestPurpose Verify an import task of a LDIF file specifying multiple branches that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Exclude Branches')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com',
+ 'cn=QA Managers,ou=groups,dc=example,dc=com']
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=bbaret,cn=QA Managers,ou=groups,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Branches Mix
+ #@TestID Fractional Branches Mix
+ #@TestPurpose Verify an import task of a LDIF file specifying a mix of include and exclude branches.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Branches Mix')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'includeBranches' : ['dc=com'],
+ 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Include Attribute
+ #@TestID Fractional Include Attribute
+ #@TestPurpose Verify an import task of a LDIF file specifying an attribute that should be included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Include Attribute')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeAttributes' : ['dc'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=com','dc=example,dc=com'],
+ 'missingEntries' : ['ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Include Attributes
+ #@TestID Fractional Include Attributes
+ #@TestPurpose Verify an import task of a LDIF file specifying multiple attributes that should be included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Include Attributes')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeAttributes' : ['dc','cn','ou','sn']
}
</call>
<call function="'checktestRC'">
@@ -1047,7 +372,7 @@
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
'startDS' : 'no'
}
</call>
@@ -1057,60 +382,762 @@
<!--- Test Case information
#@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Skip Schema Validation Reject
- #@TestID Skip Schema Validation Reject
- #@TestPurpose Verify an import task of a LDIF file containing invalided schema is rejected when skip schema validation is not specified
+ #@TestName Backend: Import Tasks: Fractional Exclude Attribute
+ #@TestID Fractional Exclude Attribute
+ #@TestPurpose Verify an import task of a LDIF file specifying an attribute that should be excluded in the import.
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
-->
- <testcase name="getTestCaseName('Skip Schema Validation Reject')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/backends/Schema.ldif' % remote.data,
- 'skipSchemaValidation' : 'FALSE'
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=dmiller,ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com'],
- 'startDS' : 'no'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
+ <testcase name="getTestCaseName('Fractional Exclude Attribute')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeAttributes' : ['userpassword']
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Exclude Attributes
+ #@TestID Fractional Exclude Attributes
+ #@TestPurpose Verify an import task of a LDIF file specifying multiple attribute that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Exclude Attributes')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeAttributes' : ['userpassword','mail','roomnumber']
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword','mail','roomnumber'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Mix
+ #@TestID Fractional Mix
+ #@TestPurpose Verify an import task of a LDIF file specifying a mix of fractional attributes and branches.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Mix')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'includeBranches' : ['dc=com','dc=example,dc=com','ou=People,dc=example,dc=com'],
+ 'excludeBranches' : ['ou=Departed,ou=People,dc=example,dc=com'],
+ 'includeAttributes' : ['dc','cn','ou','sn'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Filtered Include
+ #@TestID Filtered Include
+ #@TestPurpose Verify an import task of a LDIF file specifying a search filter control which entries are included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Filtered Include')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeFilters' : ['objectclass=*'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Filtered Exclude
+ #@TestID Filtered Exclude
+ #@TestPurpose Verify an import task of a LDIF file specifying a search filter control which entries are excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Filtered Exclude')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeFilters' : ['objectclass=person'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Filtered Includes
+ #@TestID Filtered Includes
+ #@TestPurpose Verify an import task of a LDIF file specifying multiple search filters control which entries are included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Filtered Includes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeFilters' : ['objectclass=domain*','objectclass=organizationalunit']
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Filtered Excludes
+ #@TestID Filtered Excludes
+ #@TestPurpose Verify an import task of a LDIF file specifying multiple search filters control which entries are excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Filtered Excludes')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeFilters' : ['objectclass=person','objectclass=organizationalunit'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com'],
+ 'missingEntries' : ['ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Filtered Includes Complex
+ #@TestID Filtered Includes Complex
+ #@TestPurpose Verify an import task of a LDIF file specifying complex search filters control which entries are included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Filtered Includes Complex')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'includeFilters' : ['|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Filtered Excludes Complex
+ #@TestID Filtered Excludes Complex
+ #@TestPurpose Verify an import task of a LDIF file specifying complex search filters control which entries are excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Filtered Excludes Complex')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeFilters' : ['&(objectclass=person)(ou=Departed)'],
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Fractional Filtered Mix
+ #@TestID Fractional Filtered Mix
+ #@TestPurpose Verify an import task of a LDIF file specifying a mix of fractional and filtered.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Fractional Filtered Mix')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'excludeFilters' : ['&(objectclass=person)(ou=Departed)'],
+ 'includeBranches' : ['dc=com'],
+ 'excludeAttributes' : ['userpassword']
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Append
+ #@TestID Append
+ #@TestPurpose Verify an import task of a LDIF file specifying that the import process should append to the existing database.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Append')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Append.ldif' % remote.data,
+ 'append' : 'TRUE'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks:Append Replace Existing
+ #@TestID Append Replace Existing
+ #@TestPurpose Verify an import task of a LDIF file specifying that an existing entry should be replaced when appending to an existing database.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Append Replace Existing')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Append.ldif' % remote.data,
+ 'append' : 'TRUE',
+ 'replaceExisting' : 'TRUE'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Compressed
+ #@TestID Compressed
+ #@TestPurpose Verify an import task of a LDIF file specifying the data to import is compressed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Compressed')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Example.ldif.gz' % remote.data,
+ 'isCompressed' : 'TRUE'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Encrypted
+ #@TestID Encrypted
+ #@TestPurpose Verify an import task of a LDIF file specifying the data to import is encrypted.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Encrypted')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'isEncrypted' : 'TRUE'
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : 1 ,
+ 'expected' : 0 ,
+ 'result' : 'Encrypted LDIF export is not implemented',
+ 'issue' : '839'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Hashed Signed
+ #@TestID Hashed Signed
+ #@TestPurpose Verify an import task of a LDIF file specifying the data to import is hashed/signed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <!-- Test Not Implemented. Feature not avaliable -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Rejects File
+ #@TestID Rejects File
+ #@TestPurpose Verify an import task of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is not overwritten.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Rejects File')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'rejectsFile' : './rejects'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <!-- Should check there is a rejects file and the contents are correct -->
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Rejects File Overwrite
+ #@TestID Rejects File Overwrite
+ #@TestPurpose Verify an import task of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is overwritten.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Overwrite Rejects File')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'rejectsFile' : './rejects',
+ 'overwriteRejectsFile' : 'TRUE'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <!-- Should check there is a rejects file and the contents are correct -->
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Skip Schema Validation Accept
+ #@TestID Skip Schema Validation Accept
+ #@TestPurpose Verify an import task of a LDIF file containing invalided schema is accepted when skip schema validation is specified
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Skip Schema Validation Accept')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Schema.ldif' % remote.data,
+ 'skipSchemaValidation' : 'TRUE'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
#@TestMarker Backend Import Tasks Tests
- #@TestName Backend: Import Tasks: Error Codes
- #@TestID Error Codes
- #@TestPurpose Verify an import task fails with an error code.
+ #@TestName Backend: Import Tasks: Skip Schema Validation Reject
+ #@TestID Skip Schema Validation Reject
+ #@TestPurpose Verify an import task of a LDIF file containing invalided schema is rejected when skip schema validation is not specified
#@TestPreamble
#@TestSteps
#@TestPostamble
#@TestResult
- -->
- <!-- Need to know what the error codes are -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'" />
- <call function="'testSuite_Postamble'"/>
- </sequence>
+ -->
+ <testcase name="getTestCaseName('Skip Schema Validation Reject')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/backends/Schema.ldif' % remote.data,
+ 'skipSchemaValidation' : 'FALSE'
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=dmiller,ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com'],
+ 'startDS' : 'no'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tasks Tests
+ #@TestName Backend: Import Tasks: Error Codes
+ #@TestID Error Codes
+ #@TestPurpose Verify an import task fails with an error code.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <!-- Need to know what the error codes are -->
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import.xml
index 88b49be..163f8b8 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/import.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -35,1279 +35,1297 @@
<sequence>
<block name="'import'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Suite information
- #@TestSuiteName Backend Import Tests
- #@TestSuitePurpose Verify that the basic import functionality is working in the Directory Server.
- #@TestSuiteID Import Tests
- #@TestSuiteGroup Import
- #@TestGroup Backend
- #@TestScript import.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'"> { 'startDS' : False } </call>
-
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: LDIF Default
- #@TestID LDIF Default
- #@TestPurpose Verify an import of a LDIF file using the default backend.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -l ../ldif/Example.ldif -n "userRoot"
- #@TestPostamble
- #@TestResult
- -->
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
- <testcase name="getTestCaseName('LDIF Default')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: LDIF Non Default
- #@TestID LDIF Non Default
- #@TestPurpose Verify an import of a LDIF file using a differrent backend to the default.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -n "nonDefault" -l ../ldif/Example.ldif
- #@TestPostamble
- #@TestResult
- -->
-
- <!-- Not clear how to create a second backend
- <testcase name="getTestCaseName('LDIF Non Default')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'importLdif'">
- { 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
- 'backEnd' : 'nonDefault' }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com','uid=dmiller, ou=People, dc=example,dc=com','uid=rhunt, ou=People, dc=example,dc=com'] }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
- -->
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Include Branch
- #@TestID Fractional Include Branch
- #@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Include Branch')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeBranch' : ['dc=com'] }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Include Branch with backend ID
- #@TestID Fractional Include Branch
- #@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import
- along with the backendID.
-
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Include Branch with backend ID')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeBranch' : ['dc=com'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Include Branches
- #@TestID Fractional Include Branches
- #@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Include Branches')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeBranch' : ['dc=com','dc=example,dc=com']
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Exclude Branch
- #@TestID Fractional Exclude Branch
- #@TestPurpose Verify an import of a LDIF file specifying a branch that should be excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Exclude Branch')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] ,
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Exclude Branches
- #@TestID Fractional Exclude Branches
- #@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Exclude Branches')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] ,
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Branches Mix
- #@TestID Fractional Branches Mix
- #@TestPurpose Verify an import of a LDIF file specifying a mix of include and exclude branches.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Branches Mix')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsIncludeBranch' : ['dc=com'],
- 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'] ,
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Include Attribute
- #@TestID Fractional Include Attribute
- #@TestPurpose Verify an import of a LDIF file specifying an attribute that should be included in the import.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -n "userRoot" -i dc -l Include.ldif
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Include Attribute')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeAttribute' : ['dc'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=com','dc=example,dc=com'],
- 'missingEntries' : ['ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Include Attributes
- #@TestID Fractional Include Attributes
- #@TestPurpose Verify an import of a LDIF file specifying multiple attributes that should be included in the import.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -n "userRoot" -i cn -i dc -i ou -i sn -l Include.ldif
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Include Attributes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeAttribute' : ['dc','cn','ou','sn'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Exclude Attribute
- #@TestID Fractional Exclude Attribute
- #@TestPurpose Verify an import of a LDIF file specifying an attribute that should be excluded in the import.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -n "userRoot" -e userpassword -l Example.ldif
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Exclude Attribute')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeAttribute' : ['userpassword'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Exclude Attributes
- #@TestID Fractional Exclude Attributes
- #@TestPurpose Verify an import of a LDIF file specifying multiple attribute that should be excluded in the import.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -n "userRoot" -e userpassword -e mail -e roomnumber -l Example.ldif
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Exclude Attributes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeAttribute' : ['userpassword','mail','roomnumber'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
- 'missingAttributes' : ['userpassword']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Mix
- #@TestID Fractional Mix
- #@TestPurpose Verify an import of a LDIF file specifying a mix of fractional attributes and branches.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Mix')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
- 'dsIncludeAttribute' : ['dc','cn','ou','sn'],
- 'dsIncludeBranch' : ['dc=com','dc=example,dc=com','ou=People,dc=example,dc=com'],
- 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller, ou=People, dc=example,dc=com',
- 'uid=rhunt, ou=People, dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Filtered Include
- #@TestID Filtered Include
- #@TestPurpose Verify an import of a LDIF file specifying a search filter control which entries are included in the import.
- #@TestPreamble
- #@TestSteps ./import-ldif.sh -n "userRoot" -I "objectclass=*" -l Include.ldif
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Filtered Include')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeFilter' : ['objectclass=*'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Filtered Exclude
- #@TestID Filtered Exclude
- #@TestPurpose Verify an import of a LDIF file specifying a search filter control which entries are excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Filtered Exclude')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeFilter' : ['objectclass=person'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Filtered Includes
- #@TestID Filtered Includes
- #@TestPurpose Verify an import of a LDIF file specifying multiple search filters control which entries are included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Filtered Includes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeFilter' : ['objectclass=domain','objectclass=organizationalunit'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com',
- 'ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Filtered Excludes
- #@TestID Filtered Excludes
- #@TestPurpose Verify an import of a LDIF file specifying multiple search filters control which entries are excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Filtered Excludes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeFilter' : ['objectclass=person','objectclass=organizationalunit'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['dc=example,dc=com'],
- 'missingEntries' : ['ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Filtered Includes Complex
- #@TestID Filtered Includes Complex
- #@TestPurpose Verify an import of a LDIF file specifying complex search filters control which entries are included in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Filtered Includes Complex')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
- 'dsIncludeFilter' : ['|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Filtered Excludes Complex
- #@TestID Filtered Excludes Complex
- #@TestPurpose Verify an import of a LDIF file specifying complex search filters control which entries are excluded in the import.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Filtered Excludes Complex')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeFilter' : ['&(objectclass=person)(ou=Departed)'],
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Fractional Filtered Mix
- #@TestID Fractional Filtered Mix
- #@TestPurpose Verify an import of a LDIF file specifying a mix of fractional and filtered.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Fractional Filtered Mix')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
- 'dsExcludeFilter' : ['&(objectclass=person)(ou=Departed)'],
- 'dsIncludeBranch' : ['dc=com'],
- 'dsExcludeAttribute' : ['userpassword']
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Append
- #@TestID Append
- #@TestPurpose Verify an import of a LDIF file specifying that the import process should append to the existing database.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Append')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Append.ldif' % remote.data,
- 'dsAppend' : 'TRUE',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
- 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Append Replace Existing
- #@TestID Append Replace Existing
- #@TestPurpose Verify an import of a LDIF file specifying that an existing entry should be replaced when appending to an existing database.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Append Replace Existing')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Append.ldif' % remote.data,
- 'dsAppend' : 'TRUE',
- 'dsReplaceExisting' : 'TRUE',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
- 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
- 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Compressed
- #@TestID Compressed
- #@TestPurpose Verify an import of a LDIF file specifying the data to import is compressed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Compressed')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Example.ldif.gz' % remote.data,
- 'dsIsCompressed' : 'TRUE',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Encrypted
- #@TestID Encrypted
- #@TestPurpose Verify an import of a LDIF file specifying the data to import is encrypted.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Encrypted')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
- 'dsIsEncrypted' : 'TRUE',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <!-- Known issue -->
- <call function="'checktestRC'">
- { 'returncode' : 1 ,
- 'expected' : 0 ,
- 'result' : 'Encrypted LDIF export is not implemented',
- 'issue' : '839'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Hashed Signed
- #@TestID Hashed Signed
- #@TestPurpose Verify an import of a LDIF file specifying the data to import is hashed/signed.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!-- Test Not Implemented. Feature not avaliable -->
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Rejects File
- #@TestID Rejects File
- #@TestPurpose Verify an import of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is not overwritten.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Rejects File')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
- 'dsRejectFile' : '%s/rejects.txt' % remote.temp,
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Rejects File Overwrite
- #@TestID Rejects File Overwrite
- #@TestPurpose Verify an import of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is overwritten.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Rejects File Overwrite')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
- 'dsRejectFile' : '%s/rejects.txt' % remote.temp,
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=rhunt,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Skip Schema Validation Accept
- #@TestID Skip Schema Validation Accept
- #@TestPurpose Verify an import of a LDIF file containing invalided schema is accepted when skip schema validation is specified
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Skip Schema Validation Accept')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Schema.ldif' % remote.data,
- 'dsSkipSchemaValidation' : 'TRUE',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=dmiller,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Skip Schema Validation Reject
- #@TestID skip schema validation reject
- #@TestPurpose Verify an import of a LDIF file containing invalided schema is rejected when skip schema validation is not specified
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('Skip Schema Validation Reject')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsLdifFile' : '%s/backends/Schema.ldif' % remote.data,
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=dmiller,ou=People,dc=example,dc=com'],
- 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
- 'uid=kwinters,ou=People,dc=example,dc=com']
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Backend Import Tests
- #@TestName Backend: Import: Error Codes
- #@TestID Error Codes
- #@TestPurpose Verify an import fails with an error code.
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-
- <!-- Need to know what the error codes are -->
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'"> { 'stopDS' : False } </call>
-
-
- <call function="'testSuite_Postamble'"/>
+ <!--- Test Suite information
+ #@TestSuiteName Backend Import Tests
+ #@TestSuitePurpose Verify that the basic import functionality is working in the Directory Server.
+ #@TestSuiteID Import Tests
+ #@TestSuiteGroup Import
+ #@TestGroup Backend
+ #@TestScript import.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- </sequence>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : False ,
+ 'loadData' : False ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: LDIF Default
+ #@TestID LDIF Default
+ #@TestPurpose Verify an import of a LDIF file using the default backend.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -l ../ldif/Example.ldif -n "userRoot"
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('LDIF Default')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: LDIF Non Default
+ #@TestID LDIF Non Default
+ #@TestPurpose Verify an import of a LDIF file using a differrent backend to the default.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -n "nonDefault" -l ../ldif/Example.ldif
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!-- Not clear how to create a second backend
+ <testcase name="getTestCaseName('LDIF Non Default')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'importLdif'">
+ { 'ldifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'backEnd' : 'nonDefault' }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com','uid=dmiller, ou=People, dc=example,dc=com','uid=rhunt, ou=People, dc=example,dc=com'] }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Include Branch
+ #@TestID Fractional Include Branch
+ #@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Include Branch')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeBranch' : ['dc=com'] }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Include Branch with backend ID
+ #@TestID Fractional Include Branch
+ #@TestPurpose Verify an import of a LDIF file specifying a branch that should be included in the import
+ along with the backendID.
+
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Include Branch with backend ID')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeBranch' : ['dc=com'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Include Branches
+ #@TestID Fractional Include Branches
+ #@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Include Branches')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeBranch' : ['dc=com','dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Exclude Branch
+ #@TestID Fractional Exclude Branch
+ #@TestPurpose Verify an import of a LDIF file specifying a branch that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Exclude Branch')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] ,
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Exclude Branches
+ #@TestID Fractional Exclude Branches
+ #@TestPurpose Verify an import of a LDIF file specifying multiple branches that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Exclude Branches')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] ,
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Branches Mix
+ #@TestID Fractional Branches Mix
+ #@TestPurpose Verify an import of a LDIF file specifying a mix of include and exclude branches.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Branches Mix')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsIncludeBranch' : ['dc=com'],
+ 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'] ,
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Include Attribute
+ #@TestID Fractional Include Attribute
+ #@TestPurpose Verify an import of a LDIF file specifying an attribute that should be included in the import.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -n "userRoot" -i dc -l Include.ldif
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Include Attribute')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeAttribute' : ['dc'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=com','dc=example,dc=com'],
+ 'missingEntries' : ['ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Include Attributes
+ #@TestID Fractional Include Attributes
+ #@TestPurpose Verify an import of a LDIF file specifying multiple attributes that should be included in the import.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -n "userRoot" -i cn -i dc -i ou -i sn -l Include.ldif
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Include Attributes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeAttribute' : ['dc','cn','ou','sn'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Exclude Attribute
+ #@TestID Fractional Exclude Attribute
+ #@TestPurpose Verify an import of a LDIF file specifying an attribute that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -n "userRoot" -e userpassword -l Example.ldif
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Exclude Attribute')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeAttribute' : ['userpassword'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Exclude Attributes
+ #@TestID Fractional Exclude Attributes
+ #@TestPurpose Verify an import of a LDIF file specifying multiple attribute that should be excluded in the import.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -n "userRoot" -e userpassword -e mail -e roomnumber -l Example.ldif
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Exclude Attributes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeAttribute' : ['userpassword','mail','roomnumber'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com'],
+ 'missingAttributes' : ['userpassword']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Mix
+ #@TestID Fractional Mix
+ #@TestPurpose Verify an import of a LDIF file specifying a mix of fractional attributes and branches.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Mix')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'dsIncludeAttribute' : ['dc','cn','ou','sn'],
+ 'dsIncludeBranch' : ['dc=com','dc=example,dc=com','ou=People,dc=example,dc=com'],
+ 'dsExcludeBranch' : ['ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller, ou=People, dc=example,dc=com',
+ 'uid=rhunt, ou=People, dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Filtered Include
+ #@TestID Filtered Include
+ #@TestPurpose Verify an import of a LDIF file specifying a search filter control which entries are included in the import.
+ #@TestPreamble
+ #@TestSteps ./import-ldif.sh -n "userRoot" -I "objectclass=*" -l Include.ldif
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Filtered Include')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeFilter' : ['objectclass=*'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Filtered Exclude
+ #@TestID Filtered Exclude
+ #@TestPurpose Verify an import of a LDIF file specifying a search filter control which entries are excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Filtered Exclude')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeFilter' : ['objectclass=person'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Filtered Includes
+ #@TestID Filtered Includes
+ #@TestPurpose Verify an import of a LDIF file specifying multiple search filters control which entries are included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Filtered Includes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeFilter' : ['objectclass=domain','objectclass=organizationalunit'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com',
+ 'ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Filtered Excludes
+ #@TestID Filtered Excludes
+ #@TestPurpose Verify an import of a LDIF file specifying multiple search filters control which entries are excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Filtered Excludes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeFilter' : ['objectclass=person','objectclass=organizationalunit'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['dc=example,dc=com'],
+ 'missingEntries' : ['ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Filtered Includes Complex
+ #@TestID Filtered Includes Complex
+ #@TestPurpose Verify an import of a LDIF file specifying complex search filters control which entries are included in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Filtered Includes Complex')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Include.ldif' % remote.data,
+ 'dsIncludeFilter' : ['|(objectclass=person)(objectclass=domain)(objectclass=organizationalunit)'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Filtered Excludes Complex
+ #@TestID Filtered Excludes Complex
+ #@TestPurpose Verify an import of a LDIF file specifying complex search filters control which entries are excluded in the import.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Filtered Excludes Complex')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeFilter' : ['&(objectclass=person)(ou=Departed)'],
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Fractional Filtered Mix
+ #@TestID Fractional Filtered Mix
+ #@TestPurpose Verify an import of a LDIF file specifying a mix of fractional and filtered.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Fractional Filtered Mix')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Exclude.ldif' % remote.data,
+ 'dsExcludeFilter' : ['&(objectclass=person)(ou=Departed)'],
+ 'dsIncludeBranch' : ['dc=com'],
+ 'dsExcludeAttribute' : ['userpassword']
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=rhunt,ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=fvinker,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Append
+ #@TestID Append
+ #@TestPurpose Verify an import of a LDIF file specifying that the import process should append to the existing database.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Append')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Append.ldif' % remote.data,
+ 'dsAppend' : 'TRUE',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Append Replace Existing
+ #@TestID Append Replace Existing
+ #@TestPurpose Verify an import of a LDIF file specifying that an existing entry should be replaced when appending to an existing database.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Append Replace Existing')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Append.ldif' % remote.data,
+ 'dsAppend' : 'TRUE',
+ 'dsReplaceExisting' : 'TRUE',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=fvinker,ou=Departed,ou=People,dc=example,dc=com',
+ 'uid=brammage,ou=Departed,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Compressed
+ #@TestID Compressed
+ #@TestPurpose Verify an import of a LDIF file specifying the data to import is compressed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Compressed')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Example.ldif.gz' % remote.data,
+ 'dsIsCompressed' : 'TRUE',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Encrypted
+ #@TestID Encrypted
+ #@TestPurpose Verify an import of a LDIF file specifying the data to import is encrypted.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Encrypted')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'dsIsEncrypted' : 'TRUE',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <!-- Known issue -->
+ <call function="'checktestRC'">
+ { 'returncode' : 1 ,
+ 'expected' : 0 ,
+ 'result' : 'Encrypted LDIF export is not implemented',
+ 'issue' : '839'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Hashed Signed
+ #@TestID Hashed Signed
+ #@TestPurpose Verify an import of a LDIF file specifying the data to import is hashed/signed.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!-- Test Not Implemented. Feature not avaliable -->
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Rejects File
+ #@TestID Rejects File
+ #@TestPurpose Verify an import of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is not overwritten.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Rejects File')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'dsRejectFile' : '%s/rejects.txt' % remote.temp,
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Rejects File Overwrite
+ #@TestID Rejects File Overwrite
+ #@TestPurpose Verify an import of a LDIF file specifying the a path to a file into which rejected entries may be written if they are not accepted during the import process, when the rejects file is overwritten.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Rejects File Overwrite')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Example.ldif' % remote.data,
+ 'dsRejectFile' : '%s/rejects.txt' % remote.temp,
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=rhunt,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Skip Schema Validation Accept
+ #@TestID Skip Schema Validation Accept
+ #@TestPurpose Verify an import of a LDIF file containing invalided schema is accepted when skip schema validation is specified
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Skip Schema Validation Accept')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Schema.ldif' % remote.data,
+ 'dsSkipSchemaValidation' : 'TRUE',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=dmiller,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Skip Schema Validation Reject
+ #@TestID skip schema validation reject
+ #@TestPurpose Verify an import of a LDIF file containing invalided schema is rejected when skip schema validation is not specified
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Skip Schema Validation Reject')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsLdifFile' : '%s/backends/Schema.ldif' % remote.data,
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=dmiller,ou=People,dc=example,dc=com'],
+ 'missingEntries' : ['uid=scarter,ou=People,dc=example,dc=com',
+ 'uid=kwinters,ou=People,dc=example,dc=com']
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backend Import Tests
+ #@TestName Backend: Import: Error Codes
+ #@TestID Error Codes
+ #@TestPurpose Verify an import fails with an error code.
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <!-- Need to know what the error codes are -->
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks.xml
index 7157075..b258c0b 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore-tasks.xml
@@ -23,73 +23,96 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_restore-tasks"/>
<function name="main_restore-tasks">
<sequence>
<block name="'restore-tasks'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'"/>
- <!--- Test Suite information
- #@TestSuiteName Backend Restore Tasks Tests
- #@TestSuitePurpose Verify that the basic restore task functionality is working in the Directory Server.
- #@TestSuiteID Restore Tasks Tests
- #@TestSuiteGroup Restore Tasks
- #@TestGroup Backend
- #@TestScript restore-tasks.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'"> { 'loadBackend' : True } </call>
-
- <!--- Test Case information
- #@TestMarker Backend Restore Tasks Tests
- #@TestName Restore Tasks: Restore Tasks 1
- #@TestID RestoreTasks1
- #@TestPurpose Verify an restore task of a LDIF file on the default backend.
- #@TestPreamble
- #@TestSteps An ldif file is created that describes the restore task to be
- scheduled. The task is scheduled by adding the ldif file
- with the static ldapmodify.
- #@TestPostamble
- #@TestResult Success if OpenDS returns 0
- -->
- <testcase name="getTestCaseName('Test 1')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend RestoreTasks1: Restore the data in OpenDS by scheduling a task'
- </message>
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : '4',
- 'backupDir' : '%s/backends/' % remote.data
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <call function="'testCase_Postamble'"/>
+ <try>
+ <sequence>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'"/>
+ <!--- Test Suite information
+ #@TestSuiteName Backend Restore Tasks Tests
+ #@TestSuitePurpose Verify that the basic restore task functionality is working in the Directory Server.
+ #@TestSuiteID Restore Tasks Tests
+ #@TestSuiteGroup Restore Tasks
+ #@TestGroup Backend
+ #@TestScript restore-tasks.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker Backend Restore Tasks Tests
+ #@TestName Restore Tasks: Restore Tasks 1
+ #@TestID RestoreTasks1
+ #@TestPurpose Verify an restore task of a LDIF file on the default backend.
+ #@TestPreamble
+ #@TestSteps An ldif file is created that describes the restore task to be
+ scheduled. The task is scheduled by adding the ldif file
+ with the static ldapmodify.
+ #@TestPostamble
+ #@TestResult Success if OpenDS returns 0
+ -->
+ <testcase name="getTestCaseName('Test 1')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend RestoreTasks1: Restore the data in OpenDS by scheduling a task'
+ </message>
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : '4',
+ 'backupDir' : '%s/backends/' % remote.data
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
</sequence>
</testcase>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'backend_cleanup'"/>
- <call function="'testSuite_Postamble'"/>
- </sequence>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore.xml
index 69ac59a..0d6f1f8 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/backends/restore.xml
@@ -23,38 +23,40 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_restore"/>
<function name="main_restore">
<sequence>
<block name="'restore'">
- <sequence>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='backends'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'"/>
- <!--- Test Suite information
- #@TestSuiteName Backend Restore Tests
- #@TestSuitePurpose Test the restore functionality for OpenDS.
- #@TestSuiteID Restore Tests
- #@TestSuiteGroup Restore
- #@TestGroup Backend
- #@TestScript restore.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
- <call function="'backend_setup'">
- { 'startDS' : True,
- 'loadBackend' : True
- }
- </call>
+ <try>
<sequence>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='backends'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+ <call function="'testSuite_Preamble'"/>
+ <!--- Test Suite information
+ #@TestSuiteName Backend Restore Tests
+ #@TestSuitePurpose Test the restore functionality for OpenDS.
+ #@TestSuiteID Restore Tests
+ #@TestSuiteGroup Restore
+ #@TestGroup Backend
+ #@TestScript restore.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : False ,
+ 'loadData' : False ,
+ 'stopServer' : False
+ }
+ </call>
+
<message>
'Create a backup of the data in OpenDS to be used in the restore testcase'
</message>
@@ -67,147 +69,164 @@
'result' : STAXResult
}
</call>
+
+ <!--- Test Case information
+ #@TestMarker Backend Restore Tests
+ #@TestName Export: Restore 1
+ #@TestID Restore1
+ #@TestPurpose Restore data to OpenDS.
+ #@TestPreamble
+ #@TestSteps Client calls restore with the parameters
+ default backendID, and backupDirectory
+ #@TestPostamble
+ #@TestResult Success if restore returns 0
+ -->
+ <testcase name="getTestCaseName('Test 1')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend Restore1: Restore data to OpenDS'
+ </message>
+
+ <!-- Stop DS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
+ }
+ </call>
+
+ <call function="'checkRC'">
+ { 'returncode' : RC,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'restore'">
+ { 'backupDir' : '%s/backends/backup1' % remote.data
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!-- Start DS -->
+ <message>
+ 'Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT
+ </message>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <call function="'checkRC'">
+ { 'returncode' : RC,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ <!--- Test Case information
+ #@TestMarker Backend Restore Tests
+ #@TestName Export: Restore 2
+ #@TestID Restore2
+ #@TestPurpose Restore compressed data to OpenDS.
+ #@TestPreamble
+ #@TestSteps Client calls restore with the parameters
+ default backendID, backupDirectory, and uncompress
+ is automatically done
+ #@TestPostamble
+ #@TestResult Success if restore returns 0
+ -->
+ <testcase name="getTestCaseName('Test 2')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ 'Backend Restore2: Restore compressed data to OpenDS'
+ </message>
+
+ <!-- Stop DS -->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
+ }
+ </call>
+
+ <call function="'checkRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'backup'">
+ { 'backupDir' : '%s/restore.compressed' % remote.data
+ }
+ </call>
+ <call function="'checktestRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+ <!-- Start DS -->
+ <message>
+ 'Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT
+ </message>
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+ <call function="'checkRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+
</sequence>
- <!--- Test Case information
- #@TestMarker Backend Restore Tests
- #@TestName Export: Restore 1
- #@TestID Restore1
- #@TestPurpose Restore data to OpenDS.
- #@TestPreamble
- #@TestSteps Client calls restore with the parameters
- default backendID, and backupDirectory
- #@TestPostamble
- #@TestResult Success if restore returns 0
- -->
- <testcase name="getTestCaseName('Test 1')">
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend Restore1: Restore data to OpenDS'
- </message>
-
- <!-- Stop DS -->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'restore'">
- { 'backupDir' : '%s/backends/backup1' % remote.data
- }
- </call>
-
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!-- Start DS -->
- <message>
- 'Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT
- </message>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC,
- 'result' : STAXResult
- }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Backup Cleanup.'</message>
+ <try>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ </try>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
- <!--- Test Case information
- #@TestMarker Backend Restore Tests
- #@TestName Export: Restore 2
- #@TestID Restore2
- #@TestPurpose Restore compressed data to OpenDS.
- #@TestPreamble
- #@TestSteps Client calls restore with the parameters
- default backendID, backupDirectory, and uncompress
- is automatically done
- #@TestPostamble
- #@TestResult Success if restore returns 0
- -->
- <testcase name="getTestCaseName('Test 2')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- 'Backend Restore2: Restore compressed data to OpenDS'
- </message>
-
- <!-- Stop DS -->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'backup'">
- { 'backupDir' : '%s/restore.compressed' % remote.data
- }
- </call>
- <call function="'checktestRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- <!-- Start DS -->
- <message>
- 'Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT
- </message>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)" />
- <call function="'backend_cleanup'"> { 'stopDS' : True } </call>
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu.xml
index 90a2d50..d830e23 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -36,7 +36,9 @@
</function-list-args>
<sequence>
-
+
+ <try>
+
<block name="'clu'">
<sequence>
@@ -54,10 +56,11 @@
-->
<script>
CurrentTestPath['group'] = 'clu'
+ _group=CurrentTestPath['group']
</script>
<call function="'testGroup_Preamble'"/>
-
+
<!---
Links between tests:
- clu_ldapsearch_checkbehavior add a new suffix
@@ -68,51 +71,71 @@
clu_verify-index_checkbehavior and clu_dbtest_checkbehavior
-->
<script>
- testList = []
- testList.append(['.','clu_setup'])
- testList.append(['.','clu_ldapsearch_checkoptions'])
- testList.append(['.','clu_ldapsearch_checkbehavior'])
- testList.append(['.','clu_ldapmodify_checkoptions'])
- testList.append(['.','clu_ldapmodify_checkbehavior'])
- testList.append(['.','clu_ldapcompare_checkbehavior'])
- testList.append(['.','clu_ldapdelete_checkbehavior'])
- testList.append(['.','clu_base64_checkbehavior'])
- testList.append(['.','clu_status_checkbehavior'])
- testList.append(['.','clu_ldappasswordmodify_checkbehavior'])
- testList.append(['.','clu_ldifsearch_checkbehavior'])
- testList.append(['.','clu_verify-index_checkbehavior'])
- testList.append(['.','clu_rebuild-index_checkbehavior'])
- testList.append(['.','clu_encode-password_checkbehavior'])
- testList.append(['.','clu_make-ldif_checkbehavior'])
- testList.append(['.','clu_list-backends_checkbehavior'])
- testList.append(['.','clu_manage-tasks_checkbehavior'])
- testList.append(['.','clu_dbtest_checkbehavior'])
- testList.append(['.','clu_ldifmodify_checkbehavior'])
- testList.append(['.','clu_ldif-diff_checkbehavior'])
- testList.append(['.','clu_cleanup'])
+ suiteList = []
+ suiteList.append('clu_ldapsearch_checkoptions')
+ suiteList.append('clu_ldapsearch_checkbehavior')
+ suiteList.append('clu_ldapmodify_checkoptions')
+ suiteList.append('clu_ldapmodify_checkbehavior')
+ suiteList.append('clu_ldapcompare_checkbehavior')
+ suiteList.append('clu_ldapdelete_checkbehavior')
+ suiteList.append('clu_base64_checkbehavior')
+ suiteList.append('clu_status_checkbehavior')
+ suiteList.append('clu_ldappasswordmodify_checkbehavior')
+ suiteList.append('clu_ldifsearch_checkbehavior')
+ suiteList.append('clu_verify-index_checkbehavior')
+ suiteList.append('clu_rebuild-index_checkbehavior')
+ suiteList.append('clu_encode-password_checkbehavior')
+ suiteList.append('clu_make-ldif_checkbehavior')
+ suiteList.append('clu_list-backends_checkbehavior')
+ suiteList.append('clu_manage-tasks_checkbehavior')
+ suiteList.append('clu_dbtest_checkbehavior')
+ suiteList.append('clu_ldifmodify_checkbehavior')
+ suiteList.append('clu_ldif-diff_checkbehavior')
</script>
-
- <iterate var="_test" in="testList">
- <sequence>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/clu/%s/%s.xml' %
- (TESTS_DIR,_test[0],_test[1])"/>
-
- <call function="'%s' % _test[1]" />
-
- </sequence>
-
- </iterate>
-
- <call function="'testGroup_Postamble'"/>
-
+
+ <!-- Data global to this test group -->
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s.xml' % (TESTS_DIR,_group,_suite)"/>
+ <call function="'%s' % _suite" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
</sequence>
-
- </block>
-
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
+
</sequence>
-
</function>
-
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_base64_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_base64_checkbehavior.xml
index b62463d..bf2f157 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_base64_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_base64_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,177 +34,207 @@
<sequence>
<block name="'clu_base64_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName base64 check behavior tests
- #@TestSuitePurpose Test the results of the base64 command.
- #@TestSuiteGroup base64 check behavior tests
- #@TestScript clu_base64_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
-
- <!--- Test Case information
- #@TestMarker base64 check behavior tests
- #@TestName base64: encode option
- #@TestIssue none
- #@TestPurpose Test base64 encode option.
- #@TestPreamble none
- #@TestStep Do an base64 with encode option.
- #@TestPostamble none
- #@TestResult Success if base64 returns 0.
- -->
- <testcase name="getTestCaseName('base64: encode option')">
+
+ <try>
+
+ <sequence>
- <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName base64 check behavior tests
+ #@TestSuitePurpose Test the results of the base64 command.
+ #@TestSuiteGroup base64 check behavior tests
+ #@TestScript clu_base64_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker base64 check behavior tests
+ #@TestName base64: encode option
+ #@TestIssue none
+ #@TestPurpose Test base64 encode option.
+ #@TestPreamble none
+ #@TestStep Do an base64 with encode option.
+ #@TestPostamble none
+ #@TestResult Success if base64 returns 0.
+ -->
+ <testcase name="getTestCaseName('base64: encode option')">
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'base64: encode option'
- </message>
-
- <call function="'Base64WithScript'">
- {
- 'subcommand' : 'encode',
- 'rawData' : 'hello world'
- }
- </call>
-
- <!-- STAXResult is not always a list-->
- <script>
- try:
- RC,Result=STAXResult[0]
- except AttributeError,details:
- Result='AttributeError: can not parse STAXResult %s' % details
- RC='1'
- </script>
-
- <script>
- pattern=re.compile('aGVsbG8gd29ybGQ=')
- </script>
-
- <if expr="pattern.match(Result)">
+ <sequence>
- <sequence>
-
- <message log="1">
- 'SUCCESS: RC=%s, Results %s' % (RC,Result)
- </message>
-
- <tcstatus result="'pass'"></tcstatus>
-
- </sequence>
+ <call function="'testCase_Preamble'"/>
- <else>
+ <message>
+ 'base64: encode option'
+ </message>
+
+ <call function="'Base64WithScript'">
+ {
+ 'subcommand' : 'encode',
+ 'rawData' : 'hello world'
+ }
+ </call>
+
+ <!-- STAXResult is not always a list-->
+ <script>
+ try:
+ RC,Result=STAXResult[0]
+ except AttributeError,details:
+ Result='AttributeError: can not parse STAXResult %s' % details
+ RC='1'
+ </script>
+
+ <script>
+ pattern=re.compile('aGVsbG8gd29ybGQ=')
+ </script>
+
+ <if expr="pattern.match(Result)">
<sequence>
- <message log="1" level="'Error'">
- 'ERROR : RC=%s, Result=%s' % (RC,Result)
+ <message log="1">
+ 'SUCCESS: RC=%s, Results %s' % (RC,Result)
</message>
- <tcstatus result="'fail'"></tcstatus>
+ <tcstatus result="'pass'"></tcstatus>
</sequence>
- </else>
+ <else>
+
+ <sequence>
+
+ <message log="1" level="'Error'">
+ 'ERROR : RC=%s, Result=%s' % (RC,Result)
+ </message>
+
+ <tcstatus result="'fail'"></tcstatus>
+
+ </sequence>
+
+ </else>
+
+ </if>
- </if>
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker base64 check behavior tests
- #@TestName base64: decode
- #@TestIssue none
- #@TestPurpose Test base64 decode option.
- #@TestPreamble none
- #@TestStep Do an base64 with decode option.
- #@TestPostamble none
- #@TestResult Success if base64 returns 0.
- -->
- <testcase name="getTestCaseName('base64: decode option')">
-
- <sequence>
+ <!--- Test Case information
+ #@TestMarker base64 check behavior tests
+ #@TestName base64: decode
+ #@TestIssue none
+ #@TestPurpose Test base64 decode option.
+ #@TestPreamble none
+ #@TestStep Do an base64 with decode option.
+ #@TestPostamble none
+ #@TestResult Success if base64 returns 0.
+ -->
+ <testcase name="getTestCaseName('base64: decode option')">
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'base64: decode option'
- </message>
-
- <call function="'Base64WithScript'">
- {
- 'subcommand' : 'decode',
- 'encodedData' : 'aGVsbG8gd29ybGQ='
- }
- </call>
-
- <!-- STAXResult is not always a list-->
- <script>
- try:
- RC,Result=STAXResult[0]
- except AttributeError,details:
- Result='AttributeError: can not parse STAXResult %s' % details
- RC='1'
- </script>
-
- <script>
- pattern=re.compile('hello world')
- </script>
-
- <if expr="pattern.match(Result)">
+ <sequence>
- <sequence>
-
- <message log="1">
- 'SUCCESS: RC=%s, Results %s' % (RC,Result)
- </message>
-
- <tcstatus result="'pass'"></tcstatus>
-
- </sequence>
+ <call function="'testCase_Preamble'"/>
- <else>
+ <message>
+ 'base64: decode option'
+ </message>
+
+ <call function="'Base64WithScript'">
+ {
+ 'subcommand' : 'decode',
+ 'encodedData' : 'aGVsbG8gd29ybGQ='
+ }
+ </call>
+
+ <!-- STAXResult is not always a list-->
+ <script>
+ try:
+ RC,Result=STAXResult[0]
+ except AttributeError,details:
+ Result='AttributeError: can not parse STAXResult %s' % details
+ RC='1'
+ </script>
+
+ <script>
+ pattern=re.compile('hello world')
+ </script>
+
+ <if expr="pattern.match(Result)">
<sequence>
- <message log="1" level="'Error'">
- 'ERROR : RC=%s, Result=%s' % (RC,Result)
+ <message log="1">
+ 'SUCCESS: RC=%s, Results %s' % (RC,Result)
</message>
- <tcstatus result="'fail'"></tcstatus>
+ <tcstatus result="'pass'"></tcstatus>
</sequence>
- </else>
+ <else>
+
+ <sequence>
+
+ <message log="1" level="'Error'">
+ 'ERROR : RC=%s, Result=%s' % (RC,Result)
+ </message>
+
+ <tcstatus result="'fail'"></tcstatus>
+
+ </sequence>
+
+ </else>
+
+ </if>
- </if>
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_dbtest_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_dbtest_checkbehavior.xml
index dc758c9..e2ffaa1 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_dbtest_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_dbtest_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,406 +34,437 @@
<sequence>
<block name="'clu_dbtest_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName dbtest check behavior tests
- #@TestSuitePurpose Test the results of the dbtest command.
- #@TestSuiteGroup dbtest check behavior tests
- #@TestScript clu_dbtest_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Case information
- #@TestMarker dbtest check behavior tests
- #@TestName dbtest: list root containers
- #@TestIssue none
- #@TestPurpose Test dbtest with list-root-containers option
- #@TestPreamble none
- #@TestStep Do an dbtest with list-root-containers option.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if dbtest returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName('dbtest: list root containers')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName dbtest check behavior tests
+ #@TestSuitePurpose Test the results of the dbtest command.
+ #@TestSuiteGroup dbtest check behavior tests
+ #@TestScript clu_dbtest_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker dbtest check behavior tests
+ #@TestName dbtest: list root containers
+ #@TestIssue none
+ #@TestPurpose Test dbtest with list-root-containers option
+ #@TestPreamble none
+ #@TestStep Do an dbtest with list-root-containers option.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if dbtest returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('dbtest: list root containers')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'dbtest: list root containers'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'list-root-containers'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s db' % DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total: 1'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker dbtest check behavior tests
+ #@TestName dbtest: list entry containers
+ #@TestIssue none
+ #@TestPurpose Test dbtest with list-entry-containers option
+ for backend userRoot
+ #@TestPreamble none
+ #@TestStep Do an dbtest with list-entry-containers option
+ for backend userRoot.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if dbtest returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('dbtest: list entry containers')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'dbtest: list entry containers for backend userRoot'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'list-entry-containers' ,
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'dc=com dc_com 1048'
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'dc=mycom dc_mycom 11'
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total: 2'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker dbtest check behavior tests
+ #@TestName dbtest: list index status
+ #@TestIssue none
+ #@TestPurpose Test dbtest with list-index-status option
+ for backend userRoot and baseDN dc=com
+ #@TestPreamble none
+ #@TestStep Do an dbtest with list-index-status option
+ for backend userRoot and baseDN dc=com.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if dbtest returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('dbtest: list index status')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'dbtest: list index status for backend userRoot and \
+ baseDN dc=com'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'list-index-status' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'uid.equality Index'
+ msg2 = 'dc_com_uid.equality true'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <script>
+ msg1 = 'st.equality Index'
+ msg2 = 'dc_com_st.equality true'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total: 20'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker dbtest check behavior tests
+ #@TestName dbtest: list database containers
+ #@TestIssue none
+ #@TestPurpose Test dbtest with list-database-containers
+ option for backend userRoot and baseDN dc=com
+ #@TestPreamble none
+ #@TestStep Do an dbtest with list-root-containers option.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if dbtest returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('dbtest: list database containers')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'dbtest: list database containers for backend userRoot \
+ and baseDN dc=com'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'list-database-containers' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'dn2id DN2ID'
+ msg2 = 'dc_com_dn2id 1048'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <script>
+ msg1 = 'id2entry ID2Entry'
+ msg2 = 'dc_com_id2entry 1048'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total: 24'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker dbtest check behavior tests
+ #@TestName dbtest: dump database container
+ #@TestIssue none
+ #@TestPurpose Test dbtest with dump database container
+ option for backend userRoot, baseDN dc=com
+ and database st.equality
+ #@TestPreamble none
+ #@TestStep Do an dbtest with dump database container
+ option for backend userRoot, baseDN dc=com
+ and database dn2entry.
+ #@TestStep Check the output of the command.
+ #@TestStep Do an dbtest with dump database container
+ option for backend userRoot, baseDN dc=com,
+ database st.equality, minSize 176
+ and maxSize 184.
+ #@TestStep Check the output of the command.
+ #@TestStep Do an dbtest with dump database container
+ option for backend userRoot, baseDN dc=com,
+ database st.equality, minKey wv
+ and maxKey wy.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if dbtest returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('dbtest: dump database container')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'dbtest: dump database container for backend userRoot, \
+ baseDN dc=com and database dn2entry'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'dump-database-container' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
+ 'dsDatabaseName' : 'dn2id'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total Records: 1048'
+ }
+ </call>
+
+ <message>
+ 'dbtest: dump database container for backend userRoot, \
+ baseDN dc=com, database st.equality, minSize 176, maxSize 184'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'dump-database-container' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
+ 'dsDatabaseName' : 'st.equality' ,
+ 'dsMinDataSize' : 176 ,
+ 'dsMaxDataSize' : 184
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total Records: 6'
+ }
+ </call>
+
+ <message>
+ 'dbtest: dump database container for backend userRoot, \
+ baseDN dc=com, database st.equality, minKey wv, maxKey wy'
+ </message>
+
+ <call function="'dbtestWithScript'">
+ {
+ 'subcommand' : 'dump-database-container' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
+ 'dsDatabaseName' : 'st.equality' ,
+ 'dsMinKeyValue' : 'wv' ,
+ 'dsMaxKeyValue' : 'wy'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total Records: 2'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'dbtest: list root containers'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'list-root-containers'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s db' % DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total: 1'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker dbtest check behavior tests
- #@TestName dbtest: list entry containers
- #@TestIssue none
- #@TestPurpose Test dbtest with list-entry-containers option
- for backend userRoot
- #@TestPreamble none
- #@TestStep Do an dbtest with list-entry-containers option
- for backend userRoot.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if dbtest returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName('dbtest: list entry containers')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'dbtest: list entry containers for backend userRoot'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'list-entry-containers' ,
- 'dsBackendID' : DIRECTORY_INSTANCE_BE
- }
- </call>
+ </finally>
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'dc=com dc_com 1208'
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'dc=mycom dc_mycom 11'
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total: 2'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker dbtest check behavior tests
- #@TestName dbtest: list index status
- #@TestIssue none
- #@TestPurpose Test dbtest with list-index-status option
- for backend userRoot and baseDN dc=com
- #@TestPreamble none
- #@TestStep Do an dbtest with list-index-status option
- for backend userRoot and baseDN dc=com.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if dbtest returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName('dbtest: list index status')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'dbtest: list index status for backend userRoot and \
- baseDN dc=com'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'list-index-status' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsBackendID' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
+ </try>
- <script>
- msg1 = 'uid.equality Index'
- msg2 = 'dc_com_uid.equality true'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <script>
- msg1 = 'st.equality Index'
- msg2 = 'dc_com_st.equality true'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total: 20'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker dbtest check behavior tests
- #@TestName dbtest: list database containers
- #@TestIssue none
- #@TestPurpose Test dbtest with list-database-containers
- option for backend userRoot and baseDN dc=com
- #@TestPreamble none
- #@TestStep Do an dbtest with list-root-containers option.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if dbtest returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName('dbtest: list database containers')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'dbtest: list database containers for backend userRoot \
- and baseDN dc=com'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'list-database-containers' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsBackendID' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'dn2id DN2ID'
- msg2 = 'dc_com_dn2id 1208'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <script>
- msg1 = 'id2entry ID2Entry'
- msg2 = 'dc_com_id2entry 1208'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total: 24'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker dbtest check behavior tests
- #@TestName dbtest: dump database container
- #@TestIssue none
- #@TestPurpose Test dbtest with dump database container
- option for backend userRoot, baseDN dc=com
- and database st.equality
- #@TestPreamble none
- #@TestStep Do an dbtest with dump database container
- option for backend userRoot, baseDN dc=com
- and database dn2entry.
- #@TestStep Check the output of the command.
- #@TestStep Do an dbtest with dump database container
- option for backend userRoot, baseDN dc=com,
- database st.equality, minSize 176
- and maxSize 184.
- #@TestStep Check the output of the command.
- #@TestStep Do an dbtest with dump database container
- option for backend userRoot, baseDN dc=com,
- database st.equality, minKey wv
- and maxKey wy.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if dbtest returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName('dbtest: dump database container')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'dbtest: dump database container for backend userRoot, \
- baseDN dc=com and database dn2entry'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'dump-database-container' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
- 'dsDatabaseName' : 'dn2id'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total Records: 1208'
- }
- </call>
-
- <message>
- 'dbtest: dump database container for backend userRoot, \
- baseDN dc=com, database st.equality, minSize 176, maxSize 184'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'dump-database-container' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
- 'dsDatabaseName' : 'st.equality' ,
- 'dsMinDataSize' : 176 ,
- 'dsMaxDataSize' : 184
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total Records: 6'
- }
- </call>
-
- <message>
- 'dbtest: dump database container for backend userRoot, \
- baseDN dc=com, database st.equality, minKey wv, maxKey wy'
- </message>
-
- <call function="'dbtestWithScript'">
- {
- 'subcommand' : 'dump-database-container' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
- 'dsDatabaseName' : 'st.equality' ,
- 'dsMinKeyValue' : 'wv' ,
- 'dsMaxKeyValue' : 'wy'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total Records: 2'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_encode-password_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_encode-password_checkbehavior.xml
index 31944b9..7a6374e 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_encode-password_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_encode-password_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,501 +34,532 @@
<sequence>
<block name="'clu_encode-password_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName encode-password check behavior tests
- #@TestSuitePurpose Test the results of the encode-password command.
- #@TestSuiteGroup encode-password check behavior tests
- #@TestScript clu_encode-password_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for clearFile and encodedFile -->
- <script>
- clearFile = '%s/clu/clear_password.ref' % remote.data
- encodedFile = '%s/clu/encoded_password.ref' % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: list available schemes
- #@TestIssue none
- #@TestPurpose Test encode-password with listSchemes option.
- #@TestPreamble none
- #@TestStep Do an encode-password with listSchemes option.
- #@TestPostamble none
- #@TestResult Success if encode-password returns 0.
- -->
- <testcase name="getTestCaseName
- ('encode-password: list available schemes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: list available schemes'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'listSchemes' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'SSHA'
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'MD5'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: list available
- authPasswordSyntax schemes
- #@TestIssue none
- #@TestPurpose Test encode-password with listSchemes and
- authPasswordSyntax options.
- #@TestPreamble none
- #@TestStep Do an encode-password with listSchemes and
- authPasswordSyntax options.
- #@TestPostamble none
- #@TestResult Success if encode-password returns 0.
- -->
- <testcase name="getTestCaseName
- ('encode-password: list available authPasswordSyntax schemes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: list available authPasswordSyntax schemes'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'listSchemes' : 'True' ,
- 'authPwdSyntax' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'SHA1'
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'MD5'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: encode clear-text pwd
- #@TestIssue none
- #@TestPurpose Test encode-password to encode clear-text pwd.
- #@TestPreamble none
- #@TestStep Do an encode-password to encode clear-text pwd
- #@TestStep Remove schemes tag from pwd for next testcases
- #@TestPostamble none
- #@TestResult Success if encode-password returns 0.
- -->
- <testcase name="getTestCaseName
- ('encode-password: encode clear-text pwd')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: encode clear-text pwd'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'mypassword' ,
- 'storageScheme' : 'SSHA'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- cmdResult = returnString.split(':')
- pwd = cmdResult[1].strip().replace('{SSHA}', '')
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Encoded Password:'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: encode clear-text pwd using
- authPasswordSyntax
- #@TestIssue none
- #@TestPurpose Test encode-password to encode clear-text pwd
- using authPasswordSyntax.
- #@TestPreamble none
- #@TestStep Do an encode-password to encode clear-text
- with -a option.
- #@TestPostamble none
- #@TestResult Success if encode-password returns 0.
- -->
- <testcase name="getTestCaseName
- ('encode-password: encode clear-text pwd using authPasswordSyntax')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: encode clear-text pwd using \
- authPasswordSyntax'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'mypassword' ,
- 'storageScheme' : 'SHA1' ,
- 'authPwdSyntax' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- cmdResult = returnString.split(':')
- pwd2 = cmdResult[1].strip().replace('"', '')
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Encoded Password:'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: compare pwds
- #@TestIssue none
- #@TestPurpose Test encode-password to compare pwds.
- #@TestPreamble none
- #@TestStep Do an encode-password to compare pwds without
- storageScheme option
- #@TestStep Do an encode-password to compare good pwds with
- storageSchema option
- #@TestStep Do an encode-password to compare bad pws with
- storageSchema option
- #@TestPostamble none
- #@TestResult Success if encode-password returns 1 for the
- fisrt test and 0 otherwise, and if the outputs
- are corrects.
- -->
- <testcase name="getTestCaseName
- ('encode-password: compare pwd')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: comparison error'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'mypassword' ,
- 'encodedPwd' : pwd ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'No password storage scheme was specified'
- }
- </call>
-
- <message>
- 'encode-password: comparison successful'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'mypassword' ,
- 'encodedPwd' : pwd ,
- 'storageScheme' : 'SSHA'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg = 'The provided clear-text and encoded passwords match'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <message>
- 'encode-password: comparison unsuccessful'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'password' ,
- 'encodedPwd' : pwd ,
- 'storageScheme' : 'SSHA'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg='The provided clear-text and encoded passwords do not match'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: compare pwds encoded with
- -a option
- #@TestIssue none
- #@TestPurpose Test encode-password to compare pwds encoded
- with -a option.
- #@TestPreamble none
- #@TestStep Do an encode-password to compare pwds without
- -a option and with -r option
- #@TestStep Do an encode-password to compare good pwds with
- -a and -r options
- #@TestStep Do an encode-password to compare bad pws with
- -a and -r options
- #@TestPostamble none
- #@TestResult Success if encode-password returns 1 for the
- fisrt test, 6 when the comparison is successful,
- 5 when the comparison is unsuccessful, and if the
- outputs are corrects.
- -->
- <testcase name="getTestCaseName
- ('encode-password: compare pwd with -r option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: comparison error'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'mypassword' ,
- 'encodedPwd' : pwd2 ,
- 'useCmpRC' : 'True' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'No password storage scheme was specified'
- }
- </call>
-
- <message>
- 'encode-password: comparison successful'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'mypassword' ,
- 'encodedPwd' : pwd2 ,
- 'authPwdSyntax' : 'True' ,
- 'useCmpRC' : 'True' ,
- 'expectedRC' : 6
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg = 'The provided clear-text and encoded passwords match'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <message>
- 'encode-password: comparison unsuccessful'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwd' : 'password' ,
- 'encodedPwd' : pwd2 ,
- 'authPwdSyntax' : 'True' ,
- 'useCmpRC' : 'True' ,
- 'expectedRC' : 5
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg='The provided clear-text and encoded passwords do not match'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker encode-password check behavior tests
- #@TestName encode-password: compare pwds using files
- #@TestIssue none
- #@TestPurpose Test encode-password to compare password using
- files.
- #@TestPreamble none
- #@TestStep Do an encode-password to compare good pwds
- stored in files and using -r option.
- #@TestPostamble none
- #@TestResult Success if encode-password returns 6 and the
- output is correct.
- -->
- <testcase name="getTestCaseName
- ('encode-password: compare pwd using file')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'encode-password: comparison successful'
- </message>
-
- <call function="'encodePasswordWithScript'">
- {
- 'clearPwdFile' : clearFile ,
- 'encodedPwdFile' : encodedFile ,
- 'useCmpRC' : 'True' ,
- 'expectedRC' : 6
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg = 'The provided clear-text and encoded passwords match'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ <try>
+ <sequence>
+
+ <!--- Test Suite information
+ #@TestSuiteName encode-password check behavior tests
+ #@TestSuitePurpose Test the results of the encode-password command.
+ #@TestSuiteGroup encode-password check behavior tests
+ #@TestScript clu_encode-password_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for clearFile and encodedFile -->
+ <script>
+ clearFile = '%s/clu/clear_password.ref' % remote.data
+ encodedFile = '%s/clu/encoded_password.ref' % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: list available schemes
+ #@TestIssue none
+ #@TestPurpose Test encode-password with listSchemes option.
+ #@TestPreamble none
+ #@TestStep Do an encode-password with listSchemes option.
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: list available schemes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: list available schemes'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'listSchemes' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'SSHA'
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'MD5'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: list available
+ authPasswordSyntax schemes
+ #@TestIssue none
+ #@TestPurpose Test encode-password with listSchemes and
+ authPasswordSyntax options.
+ #@TestPreamble none
+ #@TestStep Do an encode-password with listSchemes and
+ authPasswordSyntax options.
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: list available authPasswordSyntax schemes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: list available authPasswordSyntax schemes'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'listSchemes' : 'True' ,
+ 'authPwdSyntax' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'SHA1'
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'MD5'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: encode clear-text pwd
+ #@TestIssue none
+ #@TestPurpose Test encode-password to encode clear-text pwd.
+ #@TestPreamble none
+ #@TestStep Do an encode-password to encode clear-text pwd
+ #@TestStep Remove schemes tag from pwd for next testcases
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: encode clear-text pwd')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: encode clear-text pwd'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'mypassword' ,
+ 'storageScheme' : 'SSHA'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ cmdResult = returnString.split(':')
+ pwd = cmdResult[1].strip().replace('{SSHA}', '')
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Encoded Password:'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: encode clear-text pwd using
+ authPasswordSyntax
+ #@TestIssue none
+ #@TestPurpose Test encode-password to encode clear-text pwd
+ using authPasswordSyntax.
+ #@TestPreamble none
+ #@TestStep Do an encode-password to encode clear-text
+ with -a option.
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: encode clear-text pwd using authPasswordSyntax')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: encode clear-text pwd using \
+ authPasswordSyntax'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'mypassword' ,
+ 'storageScheme' : 'SHA1' ,
+ 'authPwdSyntax' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ cmdResult = returnString.split(':')
+ pwd2 = cmdResult[1].strip().replace('"', '')
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Encoded Password:'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: compare pwds
+ #@TestIssue none
+ #@TestPurpose Test encode-password to compare pwds.
+ #@TestPreamble none
+ #@TestStep Do an encode-password to compare pwds without
+ storageScheme option
+ #@TestStep Do an encode-password to compare good pwds with
+ storageSchema option
+ #@TestStep Do an encode-password to compare bad pws with
+ storageSchema option
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 1 for the
+ fisrt test and 0 otherwise, and if the outputs
+ are corrects.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: compare pwd')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: comparison error'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'mypassword' ,
+ 'encodedPwd' : pwd ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'No password storage scheme was specified'
+ }
+ </call>
+
+ <message>
+ 'encode-password: comparison successful'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'mypassword' ,
+ 'encodedPwd' : pwd ,
+ 'storageScheme' : 'SSHA'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg = 'The provided clear-text and encoded passwords match'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <message>
+ 'encode-password: comparison unsuccessful'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'password' ,
+ 'encodedPwd' : pwd ,
+ 'storageScheme' : 'SSHA'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg='The provided clear-text and encoded passwords do not match'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: compare pwds encoded with
+ -a option
+ #@TestIssue none
+ #@TestPurpose Test encode-password to compare pwds encoded
+ with -a option.
+ #@TestPreamble none
+ #@TestStep Do an encode-password to compare pwds without
+ -a option and with -r option
+ #@TestStep Do an encode-password to compare good pwds with
+ -a and -r options
+ #@TestStep Do an encode-password to compare bad pws with
+ -a and -r options
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 1 for the
+ fisrt test, 6 when the comparison is successful,
+ 5 when the comparison is unsuccessful, and if the
+ outputs are corrects.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: compare pwd with -r option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: comparison error'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'mypassword' ,
+ 'encodedPwd' : pwd2 ,
+ 'useCmpRC' : 'True' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'No password storage scheme was specified'
+ }
+ </call>
+
+ <message>
+ 'encode-password: comparison successful'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'mypassword' ,
+ 'encodedPwd' : pwd2 ,
+ 'authPwdSyntax' : 'True' ,
+ 'useCmpRC' : 'True' ,
+ 'expectedRC' : 6
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg = 'The provided clear-text and encoded passwords match'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <message>
+ 'encode-password: comparison unsuccessful'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwd' : 'password' ,
+ 'encodedPwd' : pwd2 ,
+ 'authPwdSyntax' : 'True' ,
+ 'useCmpRC' : 'True' ,
+ 'expectedRC' : 5
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg='The provided clear-text and encoded passwords do not match'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker encode-password check behavior tests
+ #@TestName encode-password: compare pwds using files
+ #@TestIssue none
+ #@TestPurpose Test encode-password to compare password using
+ files.
+ #@TestPreamble none
+ #@TestStep Do an encode-password to compare good pwds
+ stored in files and using -r option.
+ #@TestPostamble none
+ #@TestResult Success if encode-password returns 6 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('encode-password: compare pwd using file')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'encode-password: comparison successful'
+ </message>
+
+ <call function="'encodePasswordWithScript'">
+ {
+ 'clearPwdFile' : clearFile ,
+ 'encodedPwdFile' : encodedFile ,
+ 'useCmpRC' : 'True' ,
+ 'expectedRC' : 6
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg = 'The provided clear-text and encoded passwords match'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml
index 29a20a1..2cbff65 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapcompare_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,114 +34,145 @@
<sequence>
<block name="'clu_ldapcompare_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldapcompare check behavior tests
- #@TestSuitePurpose Test the results of the ldapcompare command.
- #@TestSuiteGroup ldapcompare check behavior tests
- #@TestScript clu_ldapcompare_checkresults.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for dsdn -->
- <script>
- dsdn = 'uid=user.0,ou=ldapcompare,o=clu tests,dc=example,dc=com'
- </script>
-
- <!--- Test Case information
- #@TestMarker ldapcompare check behavior tests
- #@TestName ldapcompare: comparison successful
- #@TestIssue 2761
- #@TestPurpose Verify that the operation is successful and
- that the comparison is successful.
- #@TestPreamble none
- #@TestStep Do an ldapcompare with correct options.
- #@TestPostamble none
- #@TestResult Success if ldapcompare returns 6.
- -->
- <testcase name="getTestCaseName
- ('ldapcompare: comparison successful')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldapcompare check behavior tests
+ #@TestSuitePurpose Test the results of the ldapcompare command.
+ #@TestSuiteGroup ldapcompare check behavior tests
+ #@TestScript clu_ldapcompare_checkresults.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for dsdn -->
+ <script>
+ dsdn = 'uid=user.0,ou=ldapcompare,o=clu tests,dc=example,dc=com'
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldapcompare check behavior tests
+ #@TestName ldapcompare: comparison successful
+ #@TestIssue 2761
+ #@TestPurpose Verify that the operation is successful and
+ that the comparison is successful.
+ #@TestPreamble none
+ #@TestStep Do an ldapcompare with correct options.
+ #@TestPostamble none
+ #@TestResult Success if ldapcompare returns 6.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapcompare: comparison successful')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapcompare: comparison successful'
+ </message>
+
+ <call function="'ldapCompareWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDn' : ['postalCode:63792' ,
+ '%s' % dsdn] ,
+ 'expectedRC' : 6,
+ 'knownIssue' : '2761'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapcompare check behavior tests
+ #@TestName ldapcompare: comparison unsuccessful
+ #@TestIssue 2761
+ #@TestPurpose Verify that the operation is successful and
+ that the comparison is unsuccessful.
+ #@TestPreamble none
+ #@TestStep Do an ldapcompare with correct options.
+ #@TestPostamble none
+ #@TestResult Success if ldapcompare returns 5.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapcompare: comparison unsuccessful')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapcompare: comparison unsuccessful'
+ </message>
+
+ <call function="'ldapCompareWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDn' : ['postalCode:00000' ,
+ '%s' % dsdn] ,
+ 'expectedRC' : 5,
+ 'knownIssue' : '2761'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapcompare: comparison successful'
- </message>
-
- <call function="'ldapCompareWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDn' : ['postalCode:63792' ,
- '%s' % dsdn] ,
- 'expectedRC' : 6,
- 'knownIssue' : '2761'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
+ </finally>
- <!--- Test Case information
- #@TestMarker ldapcompare check behavior tests
- #@TestName ldapcompare: comparison unsuccessful
- #@TestIssue 2761
- #@TestPurpose Verify that the operation is successful and
- that the comparison is unsuccessful.
- #@TestPreamble none
- #@TestStep Do an ldapcompare with correct options.
- #@TestPostamble none
- #@TestResult Success if ldapcompare returns 5.
- -->
- <testcase name="getTestCaseName
- ('ldapcompare: comparison unsuccessful')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapcompare: comparison unsuccessful'
- </message>
-
- <call function="'ldapCompareWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDn' : ['postalCode:00000' ,
- '%s' % dsdn] ,
- 'expectedRC' : 5,
- 'knownIssue' : '2761'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapdelete_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapdelete_checkbehavior.xml
index 8278f84..5272e1d 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapdelete_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapdelete_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,123 +34,154 @@
<sequence>
<block name="'clu_ldapdelete_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldapdelete check behavior tests
- #@TestSuitePurpose Test the results of the ldapdelete command.
- #@TestSuiteGroup ldapdelete check behavior tests
- #@TestScript clu_ldapdelete_checkresults.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for basedn, dsfilter and dsdn -->
- <script>
- basedn = 'ou=ldapdelete,o=clu tests,dc=example,dc=com'
- dsfilter = 'uid=user.0'
- dsdn = '%s,%s' % (dsfilter , basedn)
- </script>
-
- <!--- Test Case information
- #@TestMarker ldapdelete check behavior tests
- #@TestName ldapdelete: delete an entry
- #@TestIssue none
- #@TestPurpose Test ldapdelete with correct options.
- #@TestPreamble none
- #@TestStep Check using ldapsearch that "uid=user.0"
- entry is present.
- #@TestStep Delete this entry using ldapdelete.
- #@TestStep Check using ldapsearch that this entry is no
- more present.
- #@TestPostamble none
- #@TestResult Success if the "uid=user.0" entry is deleted.
- -->
- <!-- Active RC check once the TDB issue will be fixed -->
- <testcase name="getTestCaseName('ldapdelete: delete an entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapdelete: delete an entry'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 1'
- }
- </call>
-
- <call function="'ldapDeleteWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDn' : ['%s' % dsdn]
- }
- </call>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 'noCheck'
- }
- </call>
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 0'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <try>
+
+ <sequence>
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldapdelete check behavior tests
+ #@TestSuitePurpose Test the results of the ldapdelete command.
+ #@TestSuiteGroup ldapdelete check behavior tests
+ #@TestScript clu_ldapdelete_checkresults.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for basedn, dsfilter and dsdn -->
+ <script>
+ basedn = 'ou=ldapdelete,o=clu tests,dc=example,dc=com'
+ dsfilter = 'uid=user.0'
+ dsdn = '%s,%s' % (dsfilter , basedn)
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldapdelete check behavior tests
+ #@TestName ldapdelete: delete an entry
+ #@TestIssue none
+ #@TestPurpose Test ldapdelete with correct options.
+ #@TestPreamble none
+ #@TestStep Check using ldapsearch that "uid=user.0"
+ entry is present.
+ #@TestStep Delete this entry using ldapdelete.
+ #@TestStep Check using ldapsearch that this entry is no
+ more present.
+ #@TestPostamble none
+ #@TestResult Success if the "uid=user.0" entry is deleted.
+ -->
+ <!-- Active RC check once the TDB issue will be fixed -->
+ <testcase name="getTestCaseName('ldapdelete: delete an entry')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapdelete: delete an entry'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 1'
+ }
+ </call>
+
+ <call function="'ldapDeleteWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDn' : ['%s' % dsdn]
+ }
+ </call>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 0'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkbehavior.xml
index a89bea0..00fda16 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,122 +34,153 @@
<sequence>
<block name="'clu_ldapmodify_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldapmodify check behavior tests
- #@TestSuitePurpose Test the results of the ldapmodify command.
- #@TestSuiteGroup ldapmodify check bahavior tests
- #@TestScript clu_ldapmodify_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for basedn and dsfilename -->
- <script>
- basedn = 'ou=ldapmodify,o=clu tests,dc=example,dc=com'
- dsfilename = '%s/clu/ldapmodify_checkbehavior.ldif' \
- % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check behavior tests
- #@TestName ldapmodify: change attribute value
- #@TestIssue none
- #@TestPurpose Verify that the operation is successful and
- that the attribute value has been modified.
- #@TestPreamble none
- #@TestStep Check that the "postCode" value for "uid=user.1"
- is 93520.
- #@TestStep Modify the "postalCode" value using ldapmodify.
- #@TestStep Check that the "postCode" value for "uid=user.1"
- is 70000.
- #@TestPostamble none
- #@TestResult Success if the "postalCode" value is 70000.
- -->
- <testcase name="getTestCaseName
- ('ldapmodify: change attribute value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: change attribute value'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1' ,
- 'dsAttributes' : 'postalCode'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'postalCode: 93520'
- }
- </call>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename
- }
- </call>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1' ,
- 'dsAttributes' : 'postalCode'
- }
- </call>
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'postalCode: 70000'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <try>
+
+ <sequence>
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldapmodify check behavior tests
+ #@TestSuitePurpose Test the results of the ldapmodify command.
+ #@TestSuiteGroup ldapmodify check bahavior tests
+ #@TestScript clu_ldapmodify_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for basedn and dsfilename -->
+ <script>
+ basedn = 'ou=ldapmodify,o=clu tests,dc=example,dc=com'
+ dsfilename = '%s/clu/ldapmodify_checkbehavior.ldif' \
+ % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldapmodify check behavior tests
+ #@TestName ldapmodify: change attribute value
+ #@TestIssue none
+ #@TestPurpose Verify that the operation is successful and
+ that the attribute value has been modified.
+ #@TestPreamble none
+ #@TestStep Check that the "postCode" value for "uid=user.1"
+ is 93520.
+ #@TestStep Modify the "postalCode" value using ldapmodify.
+ #@TestStep Check that the "postCode" value for "uid=user.1"
+ is 70000.
+ #@TestPostamble none
+ #@TestResult Success if the "postalCode" value is 70000.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapmodify: change attribute value')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: change attribute value'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1' ,
+ 'dsAttributes' : 'postalCode'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'postalCode: 93520'
+ }
+ </call>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename
+ }
+ </call>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1' ,
+ 'dsAttributes' : 'postalCode'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'postalCode: 70000'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkoptions.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkoptions.xml
index 3f14d04..aa9141f 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkoptions.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapmodify_checkoptions.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,605 +34,636 @@
<sequence>
<block name="'clu_ldapmodify_checkoptions'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldapmodify check options tests
- #@TestSuitePurpose Check the ldapmodify command with
- common options and input/output options.
- #@TestSuiteGroup ldapmodify check options tests
- #@TestScript clu_ldapmodify_checkoptions.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for dsfilename -->
- <script>
- dsfilename = '%s/clu/ldapmodify_checkoptions.ldif' \
- % remote.data
- </script>
-
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: correct options
- #@TestIssue none
- #@TestPurpose Test ldapmodify with correct options.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with correct options.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 0.
- -->
- <testcase name="getTestCaseName('ldapmodify: correct options')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: correct options'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldapmodify check options tests
+ #@TestSuitePurpose Check the ldapmodify command with
+ common options and input/output options.
+ #@TestSuiteGroup ldapmodify check options tests
+ #@TestScript clu_ldapmodify_checkoptions.xml
+ -->
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: empty hostname
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an empty hostname.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 89.
- -->
- <testcase name="getTestCaseName('ldapmodify: empty hostname')">
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: empty hostname'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : ' ',
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 89,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <call function="'testSuite_Preamble'"/>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: invalid hostname
- #@TestIssue none
- #@TestPurpose Verify a connection error doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an invalid hostname.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 91.
- -->
- <testcase name="getTestCaseName('ldapmodify: invalid hostname')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: invalid hostname'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : 'bad_host' ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsAdd' : '' ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 91
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: invalid port (bad_port)
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an invalid port.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 89.
- -->
- <testcase name="getTestCaseName
- ('ldapmodify: invalid port (bad_port)')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: invalid port (bad_port)'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : 'bad_port' ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: invalid port (-1)
- #@TestIssue 2762
- #@TestPurpose Verify a parameter error doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an invalid port.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 89.
- -->
- <testcase name="getTestCaseName('ldapmodify: invalid port (-1)')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: invalid port (-1)'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : -1 ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2762'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: no binddn
- #@TestIssue none
- #@TestPurpose Verify an insufficient access rights error
- doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with no binddn.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 50.
- -->
- <testcase name="getTestCaseName('ldapmodify: no binddn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: no binddn'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: invalid binddn
- #@TestIssue none
- #@TestPurpose Verify an invalid credentials error
- doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an invalid binddn.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 49.
- -->
- <testcase name="getTestCaseName('ldapmodify: invalid binddn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: invalid binddn'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=bad dn' ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 49
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: no password
- #@TestIssue 2624
- #@TestPurpose Verify an inappropriate authentication error
- doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify without a password.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 48.
- -->
- <!-- This test is prompting for the password -->
- <!--- Comment out this testcase as it hangs on some platform -->
- <!---
- <testcase name="getTestCaseName('ldapmodify: no password')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: no password'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 48 ,
- 'knownIssue' : '2624'
- }
- </call>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <!--- Define default value for dsfilename -->
+ <script>
+ dsfilename = '%s/clu/ldapmodify_checkoptions.ldif' \
+ % remote.data
+ </script>
- </testcase>
- -->
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: invalid password
- #@TestIssue none
- #@TestPurpose Verify an invalid credentials error
- doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an invalid password.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 49.
- -->
- <testcase name="getTestCaseName('ldapmodify: invalid password')">
- <sequence>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: correct options
+ #@TestIssue none
+ #@TestPurpose Test ldapmodify with correct options.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with correct options.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: correct options')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: correct options'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldapmodify: invalid password'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : 'bad_password' ,
- 'dsFilename' : dsfilename ,
- 'expectedRC' : 49
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: empty filename
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with an empty filename.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 89.
- -->
- <testcase name="getTestCaseName('ldapmodify: empty filename')">
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: empty hostname
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an empty hostname.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: empty hostname')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: empty hostname'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : ' ',
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 89,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
- <sequence>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: invalid hostname
+ #@TestIssue none
+ #@TestPurpose Verify a connection error doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an invalid hostname.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 91.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: invalid hostname')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: invalid hostname'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : 'bad_host' ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsAdd' : '' ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 91
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldapmodify: empty filename'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : ' ' ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: bad filename
- #@TestIssue 2763
- #@TestPurpose Verify a parameter error doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with a bad filename.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 89.
- -->
- <testcase name="getTestCaseName('ldapmodify: bad filename')">
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: invalid port (bad_port)
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an invalid port.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 89.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapmodify: invalid port (bad_port)')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: invalid port (bad_port)'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : 'bad_port' ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
- <sequence>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: invalid port (-1)
+ #@TestIssue 2762
+ #@TestPurpose Verify a parameter error doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an invalid port.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: invalid port (-1)')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: invalid port (-1)'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : -1 ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2762'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldapmodify: bad filename'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : 'bad' ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2763'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: add entries option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with the add entries option.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 0.
- -->
- <testcase name="getTestCaseName('ldapmodify: add entries option')">
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: no binddn
+ #@TestIssue none
+ #@TestPurpose Verify an insufficient access rights error
+ doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with no binddn.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 50.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: no binddn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: no binddn'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
- <sequence>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: invalid binddn
+ #@TestIssue none
+ #@TestPurpose Verify an invalid credentials error
+ doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an invalid binddn.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 49.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: invalid binddn')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: invalid binddn'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=bad dn' ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 49
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldapmodify: add entries option'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsAdd' : 'True' ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : dsfilename
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: verbose option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with the verbose option.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 0.
- -->
- <testcase name="getTestCaseName('ldapmodify: verbose option')">
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: no password
+ #@TestIssue 2624
+ #@TestPurpose Verify an inappropriate authentication error
+ doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify without a password.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 48.
+ -->
+ <!-- This test is prompting for the password -->
+ <!--- Comment out this testcase as it hangs on some platform -->
+ <!---
+ <testcase name="getTestCaseName('ldapmodify: no password')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: no password'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 48 ,
+ 'knownIssue' : '2624'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+ -->
+
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: invalid password
+ #@TestIssue none
+ #@TestPurpose Verify an invalid credentials error
+ doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an invalid password.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 49.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: invalid password')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: invalid password'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : 'bad_password' ,
+ 'dsFilename' : dsfilename ,
+ 'expectedRC' : 49
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
- <sequence>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: empty filename
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with an empty filename.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: empty filename')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: empty filename'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : ' ' ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldapmodify: verbose option'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsVerbose' : 'True',
- 'dsFilename' : dsfilename
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: continueOnError option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with the continueOnError
- option.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapmodify: continueOnError option')">
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: bad filename
+ #@TestIssue 2763
+ #@TestPurpose Verify a parameter error doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with a bad filename.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: bad filename')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: bad filename'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : 'bad' ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2763'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
- <sequence>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: add entries option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with the add entries option.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: add entries option')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: add entries option'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsAdd' : 'True' ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : dsfilename
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldapmodify: continueOnError option'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsContinueOnError' : 'True',
- 'dsFilename' : dsfilename
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ </testcase>
- </testcase>
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: verbose option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with the verbose option.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: verbose option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: verbose option'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsVerbose' : 'True',
+ 'dsFilename' : dsfilename
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: continueOnError option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with the continueOnError
+ option.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapmodify: continueOnError option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: continueOnError option'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsContinueOnError' : 'True',
+ 'dsFilename' : dsfilename
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapmodify check options tests
+ #@TestName ldapmodify: help option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapmodify.
+ #@TestPreamble none
+ #@TestStep Do an ldapmodify with the help option.
+ #@TestPostamble none
+ #@TestResult Success if ldapmodify returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapmodify: help option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapmodify: help option'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsHelp' : 'True',
+ 'dsFilename' : dsfilename
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
- <!--- Test Case information
- #@TestMarker ldapmodify check options tests
- #@TestName ldapmodify: help option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapmodify.
- #@TestPreamble none
- #@TestStep Do an ldapmodify with the help option.
- #@TestPostamble none
- #@TestResult Success if ldapmodify returns 0.
- -->
- <testcase name="getTestCaseName('ldapmodify: help option')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapmodify: help option'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsHelp' : 'True',
- 'dsFilename' : dsfilename
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldappasswordmodify_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldappasswordmodify_checkbehavior.xml
index e14e74c..40ad728 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldappasswordmodify_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldappasswordmodify_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,240 +34,271 @@
<sequence>
<block name="'clu_ldappasswordmodify_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldappasswordmodify check behavior tests
- #@TestSuitePurpose Test the results of ldappasswordmodify
- command.
- #@TestSuiteGroup ldappasswordmodify check behavior tests
- #@TestScript clu_ldappasswordmodify_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for basedn -->
- <script>
- basedn = 'ou=ldappasswordmodify,o=clu tests,dc=example,dc=com'
- </script>
-
- <!--- Test Case information
- #@TestMarker ldappasswordmodify check behavior tests
- #@TestName ldappasswordmodify: user can change his
- own pwd
- #@TestIssue none
- #@TestPurpose Verify that a user can change his own
- password.
- #@TestPreamble none
- #@TestStep Check that user.0 can do an ldapsearch.
- #@TestStep Do an ldappasswordmodify to change user
- password.
- #@TestStep Check that user.0 can't do an ldapsearch with
- his old password.
- #@TestStep Check that user.0 can do an ldapsearch with
- his new password.
- #@TestPostamble none
- #@TestResult Success if ldappasswordmodify returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldappasswordmodify: user can change his own pwd')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldappasswordmodify: user can change his own pwd'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
- 'dsInstancePswd' : 'password' ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.*'
- }
- </call>
-
- <call function="'ldapPasswordModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsAuthzID' : 'dn:uid=user.0,%s' % basedn ,
- 'dsCurrentPassword' : 'password' ,
- 'dsNewPassword' : 'newpassword'
- }
- </call>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
- 'dsInstancePswd' : 'password' ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.*' ,
- 'expectedRC' : 49
- }
- </call>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
- 'dsInstancePswd' : 'newpassword' ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.*'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
- <!--- Test Case information
- #@TestMarker ldappasswordmodify check behavior tests
- #@TestName ldappasswordmodify: user cannot modify pwd for
- another user
- #@TestIssue none
- #@TestPurpose Verify that a user cannot modify the password
- for another user.
- #@TestPreamble none
- #@TestStep Do an ldappasswordmodify to change user
- password.
- #@TestPostamble none
- #@TestResult Success if ldappasswordmodify returns 50.
- -->
- <testcase name="getTestCaseName
- ('ldappasswordmodify: user cannot modify pwd for another user')">
+ <try>
+
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldappasswordmodify check behavior tests
+ #@TestSuitePurpose Test the results of ldappasswordmodify
+ command.
+ #@TestSuiteGroup ldappasswordmodify check behavior tests
+ #@TestScript clu_ldappasswordmodify_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for basedn -->
+ <script>
+ basedn = 'ou=ldappasswordmodify,o=clu tests,dc=example,dc=com'
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldappasswordmodify check behavior tests
+ #@TestName ldappasswordmodify: user can change his
+ own pwd
+ #@TestIssue none
+ #@TestPurpose Verify that a user can change his own
+ password.
+ #@TestPreamble none
+ #@TestStep Check that user.0 can do an ldapsearch.
+ #@TestStep Do an ldappasswordmodify to change user
+ password.
+ #@TestStep Check that user.0 can't do an ldapsearch with
+ his old password.
+ #@TestStep Check that user.0 can do an ldapsearch with
+ his new password.
+ #@TestPostamble none
+ #@TestResult Success if ldappasswordmodify returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldappasswordmodify: user can change his own pwd')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldappasswordmodify: user can change his own pwd'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
+ 'dsInstancePswd' : 'password' ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.*'
+ }
+ </call>
+
+ <call function="'ldapPasswordModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsAuthzID' : 'dn:uid=user.0,%s' % basedn ,
+ 'dsCurrentPassword' : 'password' ,
+ 'dsNewPassword' : 'newpassword'
+ }
+ </call>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
+ 'dsInstancePswd' : 'password' ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.*' ,
+ 'expectedRC' : 49
+ }
+ </call>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
+ 'dsInstancePswd' : 'newpassword' ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.*'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldappasswordmodify check behavior tests
+ #@TestName ldappasswordmodify: user cannot modify pwd for
+ another user
+ #@TestIssue none
+ #@TestPurpose Verify that a user cannot modify the password
+ for another user.
+ #@TestPreamble none
+ #@TestStep Do an ldappasswordmodify to change user
+ password.
+ #@TestPostamble none
+ #@TestResult Success if ldappasswordmodify returns 50.
+ -->
+ <testcase name="getTestCaseName
+ ('ldappasswordmodify: user cannot modify pwd for another user')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldappasswordmodify: user cannot modify pwd for another user'
+ </message>
+
+ <call function="'ldapPasswordModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
+ 'dsInstancePswd' : 'newpassword' ,
+ 'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
+ 'dsNewPassword' : 'newpassword' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldappasswordmodify check behavior tests
+ #@TestName ldappasswordmodify: DM can modify pwd for
+ another user
+ #@TestIssue none
+ #@TestPurpose Verify that Directory Manager can change the
+ password of a user.
+ #@TestPreamble none
+ #@TestStep Check that user.0 can do an ldapsearch.
+ #@TestStep Do an ldappasswordmodify to change user
+ password.
+ #@TestStep Check that user.0 can't do an ldapsearch with
+ his old password.
+ #@TestStep Check that user.0 can do an ldapsearch with
+ his new password.
+ #@TestPostamble none
+ #@TestResult Success if ldappasswordmodify returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldappasswordmodify: DM can modify pwd for another user')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldappasswordmodify: DM can modify pwd for another user'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.1,%s' % basedn ,
+ 'dsInstancePswd' : 'password' ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.*'
+ }
+ </call>
+
+ <call function="'ldapPasswordModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
+ 'dsNewPassword' : 'newpassword'
+ }
+ </call>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.,%s' % basedn ,
+ 'dsInstancePswd' : 'password' ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.*' ,
+ 'expectedRC' : 49
+ }
+ </call>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.1,%s' % basedn ,
+ 'dsInstancePswd' : 'newpassword' ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.*'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldappasswordmodify: user cannot modify pwd for another user'
- </message>
-
- <call function="'ldapPasswordModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,%s' % basedn ,
- 'dsInstancePswd' : 'newpassword' ,
- 'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
- 'dsNewPassword' : 'newpassword' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldappasswordmodify check behavior tests
- #@TestName ldappasswordmodify: DM can modify pwd for
- another user
- #@TestIssue none
- #@TestPurpose Verify that Directory Manager can change the
- password of a user.
- #@TestPreamble none
- #@TestStep Check that user.0 can do an ldapsearch.
- #@TestStep Do an ldappasswordmodify to change user
- password.
- #@TestStep Check that user.0 can't do an ldapsearch with
- his old password.
- #@TestStep Check that user.0 can do an ldapsearch with
- his new password.
- #@TestPostamble none
- #@TestResult Success if ldappasswordmodify returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldappasswordmodify: DM can modify pwd for another user')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldappasswordmodify: DM can modify pwd for another user'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.1,%s' % basedn ,
- 'dsInstancePswd' : 'password' ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.*'
- }
- </call>
-
- <call function="'ldapPasswordModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsAuthzID' : 'dn:uid=user.1,%s' % basedn ,
- 'dsNewPassword' : 'newpassword'
- }
- </call>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.,%s' % basedn ,
- 'dsInstancePswd' : 'password' ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.*' ,
- 'expectedRC' : 49
- }
- </call>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.1,%s' % basedn ,
- 'dsInstancePswd' : 'newpassword' ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.*'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml
index d55951c..b6c6dfc 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,669 +34,687 @@
<sequence>
<block name="'clu_ldapsearch_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldapsearch check behavior tests
- #@TestSuitePurpose Test the results of ldapsearch command.
- #@TestSuiteGroup ldapsearch check behavior tests
- #@TestScript clu_ldapsearch_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for dsdn -->
- <script>
- basedn = 'ou=ldapsearch,o=clu tests,dc=example,dc=com'
- ldifFile = '%s/clu/ldapsearch_checkbehavior.ldif' \
- % remote.data
- filterfile = '%s/clu/filters.ldif' % remote.data
- mfilterfile = '%s/clu/multiple_filters.ldif' % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check behavior tests
- #@TestName ldapsearch: check number of entries
- #@TestIssue 2764
- #@TestPurpose Verify that the operation is successful and
- the number of returned entries is correct.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with countEntries option.
- #@TestPostamble none
- #@TestResult Success if the number of entries is 111.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: check number of entries')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldapsearch check behavior tests
+ #@TestSuitePurpose Test the results of ldapsearch command.
+ #@TestSuiteGroup ldapsearch check behavior tests
+ #@TestScript clu_ldapsearch_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for dsdn -->
+ <script>
+ basedn = 'ou=ldapsearch,o=clu tests,dc=example,dc=com'
+ ldifFile = '%s/clu/ldapsearch_checkbehavior.ldif' \
+ % remote.data
+ filterfile = '%s/clu/filters.ldif' % remote.data
+ mfilterfile = '%s/clu/multiple_filters.ldif' % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check behavior tests
+ #@TestName ldapsearch: check number of entries
+ #@TestIssue 2764
+ #@TestPurpose Verify that the operation is successful and
+ the number of returned entries is correct.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with countEntries option.
+ #@TestPostamble none
+ #@TestResult Success if the number of entries is 111.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: check number of entries')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: check number of entries'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'knownIssue' : '2764'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 111'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check behavior tests
+ #@TestName ldapsearch: check behavior with default basedn
+ #@TestIssue 2934
+ #@TestPurpose Verify that the number of returned entries is
+ correct with a base DN of "".
+ #@TestPreamble none
+ #@TestStep Add a new basedn (dc=mycom) to userRoot
+ backend.
+ #@TestStep Import data into this new basedn.
+ #@TestStep Do an ldapsearch with a basedn of dc=com and
+ check that the number of entries is correct
+ #@TestStep Do an ldapsearch with a basedn of dc=mycom and
+ check that the number of entries is correct
+ #@TestStep Do an ldapsearch with a basedn of "" and check
+ that the number of entries is correct (equal
+ to: entries of dc=com + entries of dc=mycom)
+ #@TestStep Set value of subordinate-base-dn to dc=com
+ #@TestStep Do an ldapsearch with a basedn of "" and check
+ that the number of entries is correct (equal
+ to: entries of dc=com)
+ #@TestStep Set value of subordinate-base-dn to dc=mycom
+ #@TestStep Do an ldapsearch with a basedn of "" and check
+ that the number of entries is correct (equal
+ to: entries of dc=mycom)
+ #@TestStep Reset value of subordinate-base-dn
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all ldap
+ operations, and if the number entries retuned
+ is correct with a basedn of "".
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: check default basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: add a new base dn to userRoot backend'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'backend' ,
+ 'propertyType' : 'backend' ,
+ 'propertyName' : DIRECTORY_INSTANCE_BE ,
+ 'attributeName' : 'base-dn' ,
+ 'attributeValue' : 'dc=mycom' ,
+ 'modifyType' : 'add'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: import data into this new base dn'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ { 'dsAdd' : 'True',
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilename' : ldifFile,
+ 'dsContinueOnError' : 'true',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: check number of entries with a basedn of dc=com'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'dn' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 1048'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: check number of entries with a basedn of dc=mycom'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : 'dc=mycom' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'dn' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 11'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: check number of entries with a basedn of ""'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'dn' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 1059'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: set value of subordinate-base-dn to dc=com'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'root-dse-backend' ,
+ 'attributeName' : 'subordinate-base-dn' ,
+ 'attributeValue' : 'dc=com'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: check number of entries with a basedn of ""'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'dn' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 1048'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: set value of subordinate-base-dn to dc=mycom'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'root-dse-backend' ,
+ 'attributeName' : 'subordinate-base-dn' ,
+ 'attributeValue' : 'dc=mycom'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: check number of entries with a basedn of ""'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'dn' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 11',
+ 'issue' : '2934'
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: reset value of subordinate-base-dn'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'root-dse-backend' ,
+ 'modifyType' : 'reset' ,
+ 'attributeName' : 'subordinate-base-dn'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check behavior tests
+ #@TestName ldapsearch: check behavior with a scope of
+ base and a basedn of ''
+ #@TestIssue none
+ #@TestPurpose Verify that the Root DSE entry is returned.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with a scope of "base" and
+ a basedn of "" and check that the number of
+ entries is correct
+ #@TestPostamble none
+ #@TestResult Success if only one entry is returned and if
+ this entry is the Root DSE entry.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: check with scope of base and empty basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: check number of entries with scope \
+ of base and basedn of ""'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsScope' : 'base' ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 1'
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'objectClass: ds-root-dse'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check behavior tests
+ #@TestName ldapsearch: check behavior with a simple
+ page size of 30 and 1
+ #@TestIssue none
+ #@TestPurpose Verify the output of ldapsearch with
+ simplePageSize option.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with a simple page size of 30
+ #@TestStep Compare the output of the previous command to
+ a reference file
+ #@TestStep Do an ldapsearch with a simple page size of 1
+ #@TestStep Compare the output of the previous command to
+ a reference file
+ #@TestPostamble none
+ #@TestResult Success if the outputs for ldapsearch matche
+ the refenrence outputs.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: check output with simplePageSize of 30 and 1')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: check output with simplePageSize of 30'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsSimplePageSize' : '30' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'expectedRC' : 'noCheck' ,
+ 'outputFile' : 'ldapsearch_simplepagesize_30.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ldapsearch_simplepagesize_30.out' \
+ % remote.temp ,
+ 'targetLdif' : '%s/clu/ldapsearch_simplepagesize_30.ref' \
+ % remote.data ,
+ 'outputLdif' : '%s/ldapsearch_simplepagesize_30.diff' \
+ % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <message>
+ 'ldapsearch: check output with simplePageSize of 1'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsSimplePageSize' : '1' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'expectedRC' : 'noCheck' ,
+ 'outputFile' : 'ldapsearch_simplepagesize_1.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ldapsearch_simplepagesize_1.out' \
+ % remote.temp ,
+ 'targetLdif' : '%s/clu/ldapsearch_simplepagesize_1.ref' \
+ % remote.data ,
+ 'outputLdif' : '%s/ldapsearch_simplepagesize_1.diff' \
+ % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check behavior tests
+ #@TestName ldapsearch: check behavior with a filter file
+ (containing one filter) and search attribute
+ #@TestIssue none
+ #@TestPurpose Verify the output of ldapsearch with
+ filter option.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with filter file option and
+ a search attribute, and check that the number
+ of entries is correct
+ #@TestStep Compare the output of the previous command to
+ a reference file
+ #@TestPostamble none
+ #@TestResult Success if the outputs for ldapsearch matche
+ the refenrence outputs.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: check output using --filename and a search attribute')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: check output using --filename and a \
+ search attribute'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilename' : filterfile ,
+ 'dsAttributes' : 'dn' ,
+ 'outputFile' : 'ldapsearch_filterfile_and_attribute.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'CheckMatches'">
+ {
+ 'string2find' : 'dn: ' ,
+ 'mainString' : returnString ,
+ 'nbExpected' : 8
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ldapsearch_filterfile_and_attribute.out' \
+ % remote.temp ,
+ 'targetLdif' : '%s/clu/ldapsearch_filterfile_and_attribute.ref'\
+ % remote.data ,
+ 'outputLdif' : '%s/ldapsearch_filterfile_and_attribute.diff' \
+ % remote.temp
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check behavior tests
+ #@TestName ldapsearch: check behavior with a filter file
+ containing multiple filters
+ #@TestIssue none
+ #@TestPurpose Verify the output of ldapsearch with
+ filter option.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with filter file option and
+ check that the number of entries is correct
+ #@TestPostamble none
+ #@TestResult Success if the number of entries is 222.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: check with a filter file containing multiple filters')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: check with a filter file containing multiple \
+ filters'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilename' : mfilterfile ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 222'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: check number of entries'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsTypesOnly' : 'True' ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'knownIssue' : '2764'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 111'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check behavior tests
- #@TestName ldapsearch: check behavior with default basedn
- #@TestIssue 2934
- #@TestPurpose Verify that the number of returned entries is
- correct with a base DN of "".
- #@TestPreamble none
- #@TestStep Add a new basedn (dc=mycom) to userRoot
- backend.
- #@TestStep Import data into this new basedn.
- #@TestStep Do an ldapsearch with a basedn of dc=com and
- check that the number of entries is correct
- #@TestStep Do an ldapsearch with a basedn of dc=mycom and
- check that the number of entries is correct
- #@TestStep Do an ldapsearch with a basedn of "" and check
- that the number of entries is correct (equal
- to: entries of dc=com + entries of dc=mycom)
- #@TestStep Set value of subordinate-base-dn to dc=com
- #@TestStep Do an ldapsearch with a basedn of "" and check
- that the number of entries is correct (equal
- to: entries of dc=com)
- #@TestStep Set value of subordinate-base-dn to dc=mycom
- #@TestStep Do an ldapsearch with a basedn of "" and check
- that the number of entries is correct (equal
- to: entries of dc=mycom)
- #@TestStep Reset value of subordinate-base-dn
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all ldap
- operations, and if the number entries retuned
- is correct with a basedn of "".
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: check default basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
+ </finally>
- <message>
- 'ldapsearch: add a new base dn to userRoot backend'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'backend' ,
- 'propertyType' : 'backend' ,
- 'propertyName' : DIRECTORY_INSTANCE_BE ,
- 'attributeName' : 'base-dn' ,
- 'attributeValue' : 'dc=mycom' ,
- 'modifyType' : 'add'
- }
- </call>
-
- <message>
- 'ldapsearch: import data into this new base dn'
- </message>
-
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <call function="'ImportLdifWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsAppend' : 'True' ,
- 'dsLdifFile' : ldifFile ,
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'ldapsearch: check number of entries with a basedn of dc=com'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'dn' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 1048'
- }
- </call>
-
- <message>
- 'ldapsearch: check number of entries with a basedn of dc=mycom'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : 'dc=mycom' ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'dn' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 11'
- }
- </call>
-
- <message>
- 'ldapsearch: check number of entries with a basedn of ""'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'dn' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 1059'
- }
- </call>
-
- <message>
- 'ldapsearch: set value of subordinate-base-dn to dc=com'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'root-dse-backend' ,
- 'attributeName' : 'subordinate-base-dn' ,
- 'attributeValue' : 'dc=com'
- }
- </call>
-
- <message>
- 'ldapsearch: check number of entries with a basedn of ""'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'dn' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 1048'
- }
- </call>
-
- <message>
- 'ldapsearch: set value of subordinate-base-dn to dc=mycom'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'root-dse-backend' ,
- 'attributeName' : 'subordinate-base-dn' ,
- 'attributeValue' : 'dc=mycom'
- }
- </call>
-
- <message>
- 'ldapsearch: check number of entries with a basedn of ""'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'dn' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 11',
- 'issue' : '2934'
- }
- </call>
-
- <message>
- 'ldapsearch: reset value of subordinate-base-dn'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'root-dse-backend' ,
- 'modifyType' : 'reset' ,
- 'attributeName' : 'subordinate-base-dn'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check behavior tests
- #@TestName ldapsearch: check behavior with a scope of
- base and a basedn of ''
- #@TestIssue none
- #@TestPurpose Verify that the Root DSE entry is returned.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with a scope of "base" and
- a basedn of "" and check that the number of
- entries is correct
- #@TestPostamble none
- #@TestResult Success if only one entry is returned and if
- this entry is the Root DSE entry.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: check with scope of base and empty basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: check number of entries with scope \
- of base and basedn of ""'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsScope' : 'base' ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 1'
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'objectClass: ds-root-dse'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check behavior tests
- #@TestName ldapsearch: check behavior with a simple
- page size of 30 and 1
- #@TestIssue none
- #@TestPurpose Verify the output of ldapsearch with
- simplePageSize option.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with a simple page size of 30
- #@TestStep Compare the output of the previous command to
- a reference file
- #@TestStep Do an ldapsearch with a simple page size of 1
- #@TestStep Compare the output of the previous command to
- a reference file
- #@TestPostamble none
- #@TestResult Success if the outputs for ldapsearch matche
- the refenrence outputs.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: check output with simplePageSize of 30 and 1')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: check output with simplePageSize of 30'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsSimplePageSize' : '30' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'expectedRC' : 'noCheck' ,
- 'outputFile' : 'ldapsearch_simplepagesize_30.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ldapsearch_simplepagesize_30.out' \
- % remote.temp ,
- 'targetLdif' : '%s/clu/ldapsearch_simplepagesize_30.ref' \
- % remote.data ,
- 'outputLdif' : '%s/ldapsearch_simplepagesize_30.diff' \
- % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <message>
- 'ldapsearch: check output with simplePageSize of 1'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsSimplePageSize' : '1' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'expectedRC' : 'noCheck' ,
- 'outputFile' : 'ldapsearch_simplepagesize_1.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ldapsearch_simplepagesize_1.out' \
- % remote.temp ,
- 'targetLdif' : '%s/clu/ldapsearch_simplepagesize_1.ref' \
- % remote.data ,
- 'outputLdif' : '%s/ldapsearch_simplepagesize_1.diff' \
- % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check behavior tests
- #@TestName ldapsearch: check behavior with a filter file
- (containing one filter) and search attribute
- #@TestIssue none
- #@TestPurpose Verify the output of ldapsearch with
- filter option.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with filter file option and
- a search attribute, and check that the number
- of entries is correct
- #@TestStep Compare the output of the previous command to
- a reference file
- #@TestPostamble none
- #@TestResult Success if the outputs for ldapsearch matche
- the refenrence outputs.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: check output using --filename and a search attribute')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: check output using --filename and a \
- search attribute'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilename' : filterfile ,
- 'dsAttributes' : 'dn' ,
- 'outputFile' : 'ldapsearch_filterfile_and_attribute.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'CheckMatches'">
- {
- 'string2find' : 'dn: ' ,
- 'mainString' : returnString ,
- 'nbExpected' : 8
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ldapsearch_filterfile_and_attribute.out' \
- % remote.temp ,
- 'targetLdif' : '%s/clu/ldapsearch_filterfile_and_attribute.ref'\
- % remote.data ,
- 'outputLdif' : '%s/ldapsearch_filterfile_and_attribute.diff' \
- % remote.temp
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check behavior tests
- #@TestName ldapsearch: check behavior with a filter file
- containing multiple filters
- #@TestIssue none
- #@TestPurpose Verify the output of ldapsearch with
- filter option.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with filter file option and
- check that the number of entries is correct
- #@TestPostamble none
- #@TestResult Success if the number of entries is 222.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: check with a filter file containing multiple filters')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: check with a filter file containing multiple \
- filters'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilename' : mfilterfile ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 222'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkoptions.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkoptions.xml
index 12fdac7..17561ad 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkoptions.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldapsearch_checkoptions.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -35,1138 +35,1169 @@
<block name="'clu_ldapsearch_checkoptions'">
- <sequence>
+ <try>
- <!--- Test Suite information
- #@TestSuiteName ldapsearch check options tests
- #@TestSuitePurpose Test the ldapsearch command with
- common options and input/output options.
- #@TestSuiteGroup ldapsearch check options tests
- #@TestScript clu_ldapsearch_checkoptions.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
+ <sequence>
+
+ <!--- Test Suite information
+ #@TestSuiteName ldapsearch check options tests
+ #@TestSuitePurpose Test the ldapsearch command with
+ common options and input/output options.
+ #@TestSuiteGroup ldapsearch check options tests
+ #@TestScript clu_ldapsearch_checkoptions.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
- <call function="'testSuite_Preamble'"/>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for basedn and dsfilter -->
+ <script>
+ basedn = 'ou=ldapsearch,o=clu tests,dc=example,dc=com'
+ dsfilter = 'uid=user.10*'
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: correct options
+ #@TestIssue none
+ #@TestPurpose Test ldapsearch with correct options.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with correct options.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: correct options')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: correct options'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: empty hostname
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an empty hostname.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: empty hostname')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: empty hostname'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : ' ' ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid hostname
+ #@TestIssue none
+ #@TestPurpose Verify a connection error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an invalid hostname.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 91.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: invalid hostname')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid hostname'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : 'bad_host' ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 91
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: no port and no basedn
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with no port and no basedn.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: no port and no basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: no port and no basedn'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid port number and no basedn
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with invalid port number
+ and no basedn used.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: invalid port number and no basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid port number and no basedn'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : '-1' ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid binddn
+ #@TestIssue none
+ #@TestPurpose Verify an invalid credentials error
+ doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an invalid binddn.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 49.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: invalid binddn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid binddn'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=bad dn' ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 49
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: no password provided
+ #@TestIssue 2624
+ #@TestPurpose Verify an inappropriate authentication error
+ doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch without a password.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 48.
+ -->
+ <!-- This test is prompting for the password -->
+ <!--- Comment out this testcase as it hangs on some platform -->
+ <!---
+ <testcase name="getTestCaseName('ldapsearch: no password provided')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: no password provided'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 48 ,
+ 'knownIssue' : '2624'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+ -->
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid password
+ #@TestIssue none
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an invalid password.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 49.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: invalid password')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid password'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : 'bad_password' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 49
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: scope with no option-argument
+ #@TestIssue 2619
+ #@TestPurpose Verify an invalid credentials error
+ doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with a scope and no value.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: scope with no option-argument')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: scope with no option-argument'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsScope' : ' ' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid scope
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an invalid scope.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: invalid scope')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid scope'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsScope' : 'bad_scope' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: empty basedn
+ #@TestIssue none
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an empty basedn.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: empty basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: empty basedn'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : ' ' ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid basedn
+ #@TestIssue none
+ #@TestPurpose Verify a no such object error
+ doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with an invalid basedn.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 32.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: invalid basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid basedn'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'o=bad dn' ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: no filter
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch without a filter.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: no filter')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: no filter'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: dry run option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with dry run option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: dry run option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: dry run option'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDryRun' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: verbose option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the verbose option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: verbose option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: verbose option'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsVerbose' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: timelimit of 20 seconds
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with timelimit of 20
+ seconds option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: timelimit of 20 seconds')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: timelimit of 20 seconds'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsTimeLimit' : '20' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : '(&(uid=*)(mobile=*))' ,
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: timelimit of 1 second
+ #@TestIssue none
+ #@TestPurpose Verify a time limit error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with timelimit of 1 second.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 3.
+ -->
+ <!---
+ <testcase name="getTestCaseName
+ ('ldapsearch: timelimit of 1 second')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: timelimit of 1 second'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsTimeLimit' : '1' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : '(&(uid=*)(mobile=*))' ,
+ 'expectedRC' : 3
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+ -->
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: sizelimit of 100 entries
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with sizelimit option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: sizelimit of 100 entries')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: sizelimit of 100 entries'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsSizeLimit' : '100' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: sizelimit of 1 entries
+ #@TestIssue none
+ #@TestPurpose Verify a size limit error doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the sizelimit option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 4.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: sizelimit of 1 entries')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: sizelimit of 1 entries'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsSizeLimit' : '1' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 4
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: help option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the help option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: help option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: help option'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsHelp' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: don't wrap option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the do do not wrap
+ long lines option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName(
+ 'ldapsearch: do not wrap long lines option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: do not wrap long lines option'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDontWrap' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: attribute value only option
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the attribute value
+ only option.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: attribute value only option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: attribute value only option'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsTypesOnly' : 'True' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: sort order option of uid
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the a sort order of uid.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: sort order option of uid')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: sort order option of uid'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsSortOrder' : 'uid' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: sort order option of bad
+ #@TestIssue 2623
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the a sort order of bad.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: sort order option of bad')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: sort order option of bad '
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsSortOrder' : 'bad_sort' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'knownIssue' : '2623'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: dereference policy of always
+ #@TestIssue none
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the a dereference
+ policy of always.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: dereference policy of always')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: dereference policy of always'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDereferencePolicy' : 'always' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: dereference policy of bad
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the a dereference
+ policy of bad.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: dereference policy of bad')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: dereference policy of bad'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsDereferencePolicy' : 'bad_ref' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : dsfilter ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: invalid basedn
+ #@TestIssue none
+ #@TestPurpose Verify a no such object error
+ doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the a bad base dn.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 32.
+ -->
+ <testcase name="getTestCaseName('ldapsearch: invalid basedn')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: invalid basedn'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=bad,cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldapsearch check options tests
+ #@TestName ldapsearch: simple page size of 0
+ #@TestIssue 2619
+ #@TestPurpose Verify a parameter doing an ldapsearch.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with the a simple page size
+ of 0
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns 89.
+ -->
+ <testcase name="getTestCaseName
+ ('ldapsearch: simple page size of 0')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldapsearch: simple page size of 0'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsSimplePageSize' : '0' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 89 ,
+ 'knownIssue' : '2619'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
- <!--- Define default value for basedn and dsfilter -->
- <script>
- basedn = 'ou=ldapsearch,o=clu tests,dc=example,dc=com'
- dsfilter = 'uid=user.10*'
- </script>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: correct options
- #@TestIssue none
- #@TestPurpose Test ldapsearch with correct options.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with correct options.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName('ldapsearch: correct options')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: correct options'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
+ </finally>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: empty hostname
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an empty hostname.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName('ldapsearch: empty hostname')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: empty hostname'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : ' ' ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid hostname
- #@TestIssue none
- #@TestPurpose Verify a connection error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an invalid hostname.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 91.
- -->
- <testcase name="getTestCaseName('ldapsearch: invalid hostname')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid hostname'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : 'bad_host' ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 91
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: no port and no basedn
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with no port and no basedn.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName('ldapsearch: no port and no basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: no port and no basedn'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid port number and no basedn
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with invalid port number
- and no basedn used.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: invalid port number and no basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid port number and no basedn'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : '-1' ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid binddn
- #@TestIssue none
- #@TestPurpose Verify an invalid credentials error
- doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an invalid binddn.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 49.
- -->
- <testcase name="getTestCaseName('ldapsearch: invalid binddn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid binddn'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=bad dn' ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 49
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: no password provided
- #@TestIssue 2624
- #@TestPurpose Verify an inappropriate authentication error
- doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch without a password.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 48.
- -->
- <!-- This test is prompting for the password -->
- <!--- Comment out this testcase as it hangs on some platform -->
- <!---
- <testcase name="getTestCaseName('ldapsearch: no password provided')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: no password provided'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 48 ,
- 'knownIssue' : '2624'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
- -->
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid password
- #@TestIssue none
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an invalid password.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 49.
- -->
- <testcase name="getTestCaseName('ldapsearch: invalid password')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid password'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : 'bad_password' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 49
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: scope with no option-argument
- #@TestIssue 2619
- #@TestPurpose Verify an invalid credentials error
- doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with a scope and no value.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: scope with no option-argument')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: scope with no option-argument'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsScope' : ' ' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid scope
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an invalid scope.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName('ldapsearch: invalid scope')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid scope'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsScope' : 'bad_scope' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: empty basedn
- #@TestIssue none
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an empty basedn.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName('ldapsearch: empty basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: empty basedn'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : ' ' ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid basedn
- #@TestIssue none
- #@TestPurpose Verify a no such object error
- doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with an invalid basedn.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 32.
- -->
- <testcase name="getTestCaseName('ldapsearch: invalid basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid basedn'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'o=bad dn' ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 32
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: no filter
- #@TestIssue 2619
- #@TestPurpose Verify a parameter error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch without a filter.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName('ldapsearch: no filter')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: no filter'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: dry run option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with dry run option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName('ldapsearch: dry run option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: dry run option'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDryRun' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: verbose option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the verbose option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName('ldapsearch: verbose option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: verbose option'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsVerbose' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: timelimit of 20 seconds
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with timelimit of 20
- seconds option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: timelimit of 20 seconds')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: timelimit of 20 seconds'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsTimeLimit' : '20' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : '(&(uid=*)(mobile=*))' ,
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: timelimit of 1 second
- #@TestIssue none
- #@TestPurpose Verify a time limit error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with timelimit of 1 second.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 3.
- -->
- <!---
- <testcase name="getTestCaseName
- ('ldapsearch: timelimit of 1 second')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: timelimit of 1 second'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsTimeLimit' : '1' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : '(&(uid=*)(mobile=*))' ,
- 'expectedRC' : 3
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
- -->
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: sizelimit of 100 entries
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with sizelimit option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: sizelimit of 100 entries')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: sizelimit of 100 entries'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsSizeLimit' : '100' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: sizelimit of 1 entries
- #@TestIssue none
- #@TestPurpose Verify a size limit error doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the sizelimit option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 4.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: sizelimit of 1 entries')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: sizelimit of 1 entries'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsSizeLimit' : '1' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 4
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: help option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the help option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName('ldapsearch: help option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: help option'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsHelp' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: don't wrap option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the do do not wrap
- long lines option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName(
- 'ldapsearch: do not wrap long lines option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: do not wrap long lines option'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDontWrap' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: attribute value only option
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the attribute value
- only option.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: attribute value only option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: attribute value only option'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: sort order option of uid
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the a sort order of uid.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: sort order option of uid')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: sort order option of uid'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsSortOrder' : 'uid' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: sort order option of bad
- #@TestIssue 2623
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the a sort order of bad.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: sort order option of bad')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: sort order option of bad '
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsSortOrder' : 'bad_sort' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'knownIssue' : '2623'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: dereference policy of always
- #@TestIssue none
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the a dereference
- policy of always.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: dereference policy of always')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: dereference policy of always'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDereferencePolicy' : 'always' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: dereference policy of bad
- #@TestIssue 2619
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the a dereference
- policy of bad.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: dereference policy of bad')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: dereference policy of bad'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDereferencePolicy' : 'bad_ref' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : dsfilter ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: invalid basedn
- #@TestIssue none
- #@TestPurpose Verify a no such object error
- doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the a bad base dn.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 32.
- -->
- <testcase name="getTestCaseName('ldapsearch: invalid basedn')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: invalid basedn'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=bad,cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 32
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldapsearch check options tests
- #@TestName ldapsearch: simple page size of 0
- #@TestIssue 2619
- #@TestPurpose Verify a parameter doing an ldapsearch.
- #@TestPreamble none
- #@TestStep Do an ldapsearch with the a simple page size
- of 0
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns 89.
- -->
- <testcase name="getTestCaseName
- ('ldapsearch: simple page size of 0')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldapsearch: simple page size of 0'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsSimplePageSize' : '0' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 89 ,
- 'knownIssue' : '2619'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ </try>
+
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml
index 5eb3ced..d39b4d9 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldif-diff_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,205 +34,236 @@
<sequence>
<block name="'clu_ldif-diff_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldif-diff check behavior tests
- #@TestSuitePurpose Test the results of the ldif-diff command.
- #@TestSuiteGroup ldif-diff check behavior tests
- #@TestScript clu_ldif-diff_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for sourceldif -->
- <script>
- sourceldif = '%s/clu/clu_start.ldif' % remote.data
- targetldif = '%s/clu/ldif-diff_checkbehavior.ldif' \
- % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker ldif-diff check behavior tests
- #@TestName ldif-diff: compare ldif files with no diffs
- #@TestIssue 3111
- #@TestPurpose Test ldif-diff to compare ldif files with
- no diffs
- #@TestPreamble none
- #@TestStep Do an ldif-diff to compare ldif files with
- no diffs
- #@TestPostamble none
- #@TestResult Success if ldif-diff returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldif-diff: compare ldif files with no diffs')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldif-diff: compare ldif files with no diffs'
- </message>
-
- <call function="'LdifDiffWithScript-new'">
- {
- 'sourceLdif' : sourceldif ,
- 'targetLdif' : sourceldif ,
- 'outputLdif' : '%s/ldif-diff_nodiffs.out' % remote.temp
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldif-diff check behavior tests
+ #@TestSuitePurpose Test the results of the ldif-diff command.
+ #@TestSuiteGroup ldif-diff check behavior tests
+ #@TestScript clu_ldif-diff_checkbehavior.xml
+ -->
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldif-diff check behavior tests
- #@TestName ldif-diff: compare ldif files with diffs
- #@TestIssue 2641
- #@TestPurpose Test ldif-diff to compare ldif files with
- diffs
- #@TestPreamble none
- #@TestStep Do an ldif-diff to compare ldif files with
- diffs
- #@TestPostamble none
- #@TestResult Success if ldif-diff returns 1.
- -->
- <testcase name="getTestCaseName
- ('ldif-diff: compare ldif files with diffs')">
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldif-diff: compare ldif files with diffs'
- </message>
-
- <call function="'LdifDiffWithScript-new'">
- {
- 'sourceLdif' : sourceldif ,
- 'targetLdif' : targetldif ,
- 'outputLdif' : '%s/ldif-diff_withdiffs.out' % remote.temp ,
- 'expectedRC' : 1 ,
- 'knownIssue' : '2641'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <call function="'testSuite_Preamble'"/>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldif-diff check behavior tests
- #@TestName ldif-diff: check diff file
- #@TestIssue 3111
- #@TestPurpose Check ldif file generated by ldif-diff
- #@TestPreamble none
- #@TestStep Do an ldif-diff to compare ldif files with
- diffs
- #@TestStep Check this ldif file using compareFile
- #@TestPostamble none
- #@TestResult Success if compareFile returns 0.
- -->
- <testcase name="getTestCaseName('ldif-diff: check diff file')">
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
- <sequence>
+ <!--- Define default value for sourceldif -->
+ <script>
+ sourceldif = '%s/clu/clu_start.ldif' % remote.data
+ targetldif = '%s/clu/ldif-diff_checkbehavior.ldif' \
+ % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldif-diff check behavior tests
+ #@TestName ldif-diff: compare ldif files with no diffs
+ #@TestIssue 3111
+ #@TestPurpose Test ldif-diff to compare ldif files with
+ no diffs
+ #@TestPreamble none
+ #@TestStep Do an ldif-diff to compare ldif files with
+ no diffs
+ #@TestPostamble none
+ #@TestResult Success if ldif-diff returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldif-diff: compare ldif files with no diffs')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldif-diff: compare ldif files with no diffs'
+ </message>
+
+ <call function="'LdifDiffWithScript-new'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'targetLdif' : sourceldif ,
+ 'outputLdif' : '%s/ldif-diff_nodiffs.out' % remote.temp
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldif-diff: check diff file'
- </message>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldif-diff check behavior tests
+ #@TestName ldif-diff: compare ldif files with diffs
+ #@TestIssue 2641
+ #@TestPurpose Test ldif-diff to compare ldif files with
+ diffs
+ #@TestPreamble none
+ #@TestStep Do an ldif-diff to compare ldif files with
+ diffs
+ #@TestPostamble none
+ #@TestResult Success if ldif-diff returns 1.
+ -->
+ <testcase name="getTestCaseName
+ ('ldif-diff: compare ldif files with diffs')">
- <call function="'LdifDiffWithScript-new'">
- {
- 'sourceLdif' : sourceldif ,
- 'targetLdif' : targetldif ,
- 'outputLdif' : '%s/ldif-diff.out' % remote.temp ,
- 'expectedRC' : 'noCheck'
- }
- </call>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldif-diff: compare ldif files with diffs'
+ </message>
+
+ <call function="'LdifDiffWithScript-new'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'targetLdif' : targetldif ,
+ 'outputLdif' : '%s/ldif-diff_withdiffs.out' % remote.temp ,
+ 'expectedRC' : 1 ,
+ 'knownIssue' : '2641'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <call function="'compareFile'">
- {
- 'outputFile' : 'ldif-diff.out' ,
- 'outputPath' : remote.temp ,
- 'refFile' : 'ldif-diff.ref',
- 'knownIssue' : '3111'
- }
- </call>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldif-diff check behavior tests
+ #@TestName ldif-diff: check diff file
+ #@TestIssue 3111
+ #@TestPurpose Check ldif file generated by ldif-diff
+ #@TestPreamble none
+ #@TestStep Do an ldif-diff to compare ldif files with
+ diffs
+ #@TestStep Check this ldif file using compareFile
+ #@TestPostamble none
+ #@TestResult Success if compareFile returns 0.
+ -->
+ <testcase name="getTestCaseName('ldif-diff: check diff file')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldif-diff: check diff file'
+ </message>
+
+ <call function="'LdifDiffWithScript-new'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'targetLdif' : targetldif ,
+ 'outputLdif' : '%s/ldif-diff.out' % remote.temp ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <call function="'compareFile'">
+ {
+ 'outputFile' : 'ldif-diff.out' ,
+ 'outputPath' : remote.temp ,
+ 'refFile' : 'ldif-diff.ref',
+ 'knownIssue' : '3111'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldif-diff check behavior tests
+ #@TestName ldif-diff: check diff file
+ #@TestIssue 3111
+ #@TestPurpose Check ldif file generated by ldif-diff
+ #@TestPreamble none
+ #@TestStep Do an ldif-diff to compare ldif files with
+ diffs
+ #@TestStep Check this ldif file using compareFile
+ #@TestPostamble none
+ #@TestResult Success if compareFile returns 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldif-diff: check diff files with single value changes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldif-diff: check diff file with single value changes'
+ </message>
+
+ <call function="'LdifDiffWithScript-new'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'targetLdif' : targetldif ,
+ 'outputLdif' : '%s/ldif-diff_singlevalue.out' \
+ % remote.temp ,
+ 'singleValueChanges' : 'True' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <call function="'compareFile'">
+ {
+ 'outputFile' : 'ldif-diff_singlevalue.out' ,
+ 'outputPath' : remote.temp ,
+ 'refFile' : 'ldif-diff_singlevalue.ref' ,
+ 'knownIssue' : '3111'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldif-diff check behavior tests
- #@TestName ldif-diff: check diff file
- #@TestIssue 3111
- #@TestPurpose Check ldif file generated by ldif-diff
- #@TestPreamble none
- #@TestStep Do an ldif-diff to compare ldif files with
- diffs
- #@TestStep Check this ldif file using compareFile
- #@TestPostamble none
- #@TestResult Success if compareFile returns 0.
- -->
- <testcase name="getTestCaseName
- ('ldif-diff: check diff files with single value changes')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldif-diff: check diff file with single value changes'
- </message>
-
- <call function="'LdifDiffWithScript-new'">
- {
- 'sourceLdif' : sourceldif ,
- 'targetLdif' : targetldif ,
- 'outputLdif' : '%s/ldif-diff_singlevalue.out' \
- % remote.temp ,
- 'singleValueChanges' : 'True' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <call function="'compareFile'">
- {
- 'outputFile' : 'ldif-diff_singlevalue.out' ,
- 'outputPath' : remote.temp ,
- 'refFile' : 'ldif-diff_singlevalue.ref' ,
- 'knownIssue' : '3111'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml
index f46315a..74ac5ea 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifmodify_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,212 +34,243 @@
<sequence>
<block name="'clu_ldifmodify_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldifmodify check behavior tests
- #@TestSuitePurpose Test the results of the ldifmodify command.
- #@TestSuiteGroup ldifmodify check behavior tests
- #@TestScript clu_ldifmodify_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for sourceldif -->
- <script>
- sourceldif = '%s/clu/clu_start.ldif' % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker ldifmodify check behavior tests
- #@TestName ldifmodify: add, delete and modify operations
- #@TestIssue none
- #@TestPurpose Test ldifmodify with add, delete and modify
- operations
- #@TestPreamble none
- #@TestStep Do an ldifmodify with add, delete and modify
- operations.
- #@TestStep Do an ldif-diff to check that generated ldif
- is correct.
- #@TestPostamble none
- #@TestResult Success if ldifmodify and ldif-diff return 0.
- -->
- <testcase name="getTestCaseName
- ('ldifmodify: add, delete and modify operations')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifmodify: add, delete and modify operations'
- </message>
-
- <call function="'LdifModifyWithScript'">
- {
- 'sourceLdif' : sourceldif ,
- 'changesLdif' : '%s/clu/ldifmodify_checkbehavior.ldif' \
- % remote.data ,
- 'targetLdif' : '%s/ldifmodify.out' % remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ldifmodify.out' % remote.temp ,
- 'targetLdif' : '%s/clu/ldifmodify.ref' % remote.data ,
- 'outputLdif' : '%s/ldifmodify.diff' % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldifmodify check behavior tests
+ #@TestSuitePurpose Test the results of the ldifmodify command.
+ #@TestSuiteGroup ldifmodify check behavior tests
+ #@TestScript clu_ldifmodify_checkbehavior.xml
+ -->
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifmodify check behavior tests
- #@TestName ldifmodify: moddn operation
- #@TestIssue none
- #@TestPurpose Test ldifmodify with moddn operation
- #@TestPreamble none
- #@TestStep Do an ldifmodify with moddn operation.
- #@TestPostamble none
- #@TestResult Success if ldifmodify returns 1 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName('ldifmodify: moddn operation')">
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifmodify: moddn operation'
- </message>
-
- <call function="'LdifModifyWithScript'">
- {
- 'sourceLdif' : sourceldif ,
- 'changesLdif' : '%s/clu/ldifmodify_moddn.ldif' % remote.data ,
- 'targetLdif' : '%s/ldifmodify_moddn.out' % remote.temp ,
- 'expectedRC' : 1
- }
- </call>
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'The modify DN operation targeted at entry uid=user.0,'
- msg2 = 'ou=ldapsearch,o=clu tests,dc=example,dc=com cannot be'
- msg3 = 'processed because modify DN operations are not'
- msg4 = 'supported by the LDIF modify tool'
- msg = '%s%s %s %s' % (msg1, msg2, msg3, msg4)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <call function="'testSuite_Preamble'"/>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifmodify check behavior tests
- #@TestName ldifmodify: concurrente modify/delete operations
- #@TestIssue none
- #@TestPurpose Test ldifmodify with concurrente modify/delete
- operations
- #@TestPreamble none
- #@TestStep Do an ldifmodify with concurrente modify/delete
- operations.
- #@TestPostamble none
- #@TestResult Success if ldifmodify returns 1 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName
- ('ldifmodify: concurrente modify/delete operations')">
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
- <sequence>
+ <!--- Define default value for sourceldif -->
+ <script>
+ sourceldif = '%s/clu/clu_start.ldif' % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldifmodify check behavior tests
+ #@TestName ldifmodify: add, delete and modify operations
+ #@TestIssue none
+ #@TestPurpose Test ldifmodify with add, delete and modify
+ operations
+ #@TestPreamble none
+ #@TestStep Do an ldifmodify with add, delete and modify
+ operations.
+ #@TestStep Do an ldif-diff to check that generated ldif
+ is correct.
+ #@TestPostamble none
+ #@TestResult Success if ldifmodify and ldif-diff return 0.
+ -->
+ <testcase name="getTestCaseName
+ ('ldifmodify: add, delete and modify operations')">
- <call function="'testCase_Preamble'"/>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifmodify: add, delete and modify operations'
+ </message>
+
+ <call function="'LdifModifyWithScript'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'changesLdif' : '%s/clu/ldifmodify_checkbehavior.ldif' \
+ % remote.data ,
+ 'targetLdif' : '%s/ldifmodify.out' % remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ldifmodify.out' % remote.temp ,
+ 'targetLdif' : '%s/clu/ldifmodify.ref' % remote.data ,
+ 'outputLdif' : '%s/ldifmodify.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- <message>
- 'ldifmodify: concurrente modify/delete operations'
- </message>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifmodify check behavior tests
+ #@TestName ldifmodify: moddn operation
+ #@TestIssue none
+ #@TestPurpose Test ldifmodify with moddn operation
+ #@TestPreamble none
+ #@TestStep Do an ldifmodify with moddn operation.
+ #@TestPostamble none
+ #@TestResult Success if ldifmodify returns 1 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('ldifmodify: moddn operation')">
- <call function="'LdifModifyWithScript'">
- {
- 'sourceLdif' : sourceldif ,
- 'changesLdif' : '%s/clu/ldifmodify_concurrente.ldif' \
- % remote.data ,
- 'targetLdif' : '%s/ldifmodify_concurrente.out' % remote.temp ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Entry uid=user.2000,ou=ldapsearch,o=clu tests,'
- msg2 = 'dc=example,dc=com cannot be deleted because it'
- msg3 = 'was previously added in the set of changes.'
- msg4 = 'This is not supported by the LDIF modify tool'
- msg = '%s%s %s %s' % (msg1, msg2, msg3, msg4)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <script>
- msg1 = 'Cannot modify entry uid=user.2000,ou=ldapsearch,'
- msg2 = 'o=clu tests,dc=example,dc=com because it was'
- msg3 = 'previously added or deleted in the set of changes.'
- msg4 = 'This is not supported by the LDIF modify tool'
- msg = '%s%s %s %s' % (msg1, msg2, msg3, msg4)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifmodify: moddn operation'
+ </message>
+
+ <call function="'LdifModifyWithScript'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'changesLdif' : '%s/clu/ldifmodify_moddn.ldif' % remote.data ,
+ 'targetLdif' : '%s/ldifmodify_moddn.out' % remote.temp ,
+ 'expectedRC' : 1
+ }
+ </call>
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'The modify DN operation targeted at entry uid=user.0,'
+ msg2 = 'ou=ldapsearch,o=clu tests,dc=example,dc=com cannot be'
+ msg3 = 'processed because modify DN operations are not'
+ msg4 = 'supported by the LDIF modify tool'
+ msg = '%s%s %s %s' % (msg1, msg2, msg3, msg4)
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
- <call function="'testCase_Postamble'"/>
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
- </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifmodify check behavior tests
+ #@TestName ldifmodify: concurrente modify/delete operations
+ #@TestIssue none
+ #@TestPurpose Test ldifmodify with concurrente modify/delete
+ operations
+ #@TestPreamble none
+ #@TestStep Do an ldifmodify with concurrente modify/delete
+ operations.
+ #@TestPostamble none
+ #@TestResult Success if ldifmodify returns 1 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('ldifmodify: concurrente modify/delete operations')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifmodify: concurrente modify/delete operations'
+ </message>
+
+ <call function="'LdifModifyWithScript'">
+ {
+ 'sourceLdif' : sourceldif ,
+ 'changesLdif' : '%s/clu/ldifmodify_concurrente.ldif' \
+ % remote.data ,
+ 'targetLdif' : '%s/ldifmodify_concurrente.out' % remote.temp ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Entry uid=user.2000,ou=ldapsearch,o=clu tests,'
+ msg2 = 'dc=example,dc=com cannot be deleted because it'
+ msg3 = 'was previously added in the set of changes.'
+ msg4 = 'This is not supported by the LDIF modify tool'
+ msg = '%s%s %s %s' % (msg1, msg2, msg3, msg4)
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <script>
+ msg1 = 'Cannot modify entry uid=user.2000,ou=ldapsearch,'
+ msg2 = 'o=clu tests,dc=example,dc=com because it was'
+ msg3 = 'previously added or deleted in the set of changes.'
+ msg4 = 'This is not supported by the LDIF modify tool'
+ msg = '%s%s %s %s' % (msg1, msg2, msg3, msg4)
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml
index 928aa1b..86899fd 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_ldifsearch_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Portions Copyright 2008 Sun Microsystems, Inc.
+ ! Portions Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,454 +34,485 @@
<sequence>
<block name="'clu_ldifsearch_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName ldifsearch check behavior tests
- #@TestSuitePurpose Test the results of ldifsearch command.
- #@TestSuiteGroup ldifsearch check behavior tests
- #@TestScript clu_ldifsearch_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for basedn, dsfilename, filter files -->
- <script>
- basedn = 'ou=ldapsearch,o=clu tests,dc=example,dc=com'
- dsfilename = '%s/clu/clu_start.ldif' % remote.data
- filterfile = '%s/clu/filters.ldif' % remote.data
- mfilterfile = '%s/clu/multiple_filters.ldif' % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker ldifsearch check behavior tests
- #@TestName ldifsearch: check with standard options
- #@TestIssue none
- #@TestPurpose Verify that the entries returned by ldifseach
- are the same than the entries returned by
- ldapsearch
- #@TestPreamble none
- #@TestStep Do an ldapsearch with standard options.
- #@TestStep Do an ldifsearch with the same options.
- #@TestStep Do an ldif-dif to check the differences.
- #@TestPostamble none
- #@TestResult Success if ldifdiff returns no differences.
- -->
- <testcase name="getTestCaseName('ldifsearch: standard options')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName ldifsearch check behavior tests
+ #@TestSuitePurpose Test the results of ldifsearch command.
+ #@TestSuiteGroup ldifsearch check behavior tests
+ #@TestScript clu_ldifsearch_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for basedn, dsfilename, filter files -->
+ <script>
+ basedn = 'ou=ldapsearch,o=clu tests,dc=example,dc=com'
+ dsfilename = '%s/clu/clu_start.ldif' % remote.data
+ filterfile = '%s/clu/filters.ldif' % remote.data
+ mfilterfile = '%s/clu/multiple_filters.ldif' % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker ldifsearch check behavior tests
+ #@TestName ldifsearch: check with standard options
+ #@TestIssue none
+ #@TestPurpose Verify that the entries returned by ldifseach
+ are the same than the entries returned by
+ ldapsearch
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with standard options.
+ #@TestStep Do an ldifsearch with the same options.
+ #@TestStep Do an ldif-dif to check the differences.
+ #@TestPostamble none
+ #@TestResult Success if ldifdiff returns no differences.
+ -->
+ <testcase name="getTestCaseName('ldifsearch: standard options')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifsearch: standard options'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'outputFile' : 'ldapsearch.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'dsOutputFile' : '%s/ldifsearch.out' % remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ldifsearch.out' % remote.temp ,
+ 'targetLdif' : '%s/ldapsearch.out' % remote.temp ,
+ 'outputLdif' : '%s/ldifsearch.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifsearch check behavior tests
+ #@TestName ldifsearch: check with scope option
+ #@TestIssue none
+ #@TestPurpose Verify that the entries returned by ldifseach
+ are the same than the entries returned by
+ ldapsearch
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with scope option.
+ #@TestStep Do an ldifsearch with the same option.
+ #@TestStep Do an ldif-dif to check the differences.
+ #@TestPostamble none
+ #@TestResult Success if ldifdiff returns no differences.
+ -->
+ <testcase name="getTestCaseName('ldifsearch: scope option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifsearch: scope option'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsScope' : 'base' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'outputFile' : 'scope_ldapsearch.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsSearchScope' : 'base' ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsOutputFile' : '%s/scope_ldifsearch.out' % remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/scope_ldifsearch.out' % remote.temp ,
+ 'targetLdif' : '%s/scope_ldapsearch.out' % remote.temp ,
+ 'outputLdif' : '%s/scope_ldifsearch.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifsearch check behavior tests
+ #@TestName ldifsearch: check with sizeLimit option
+ #@TestIssue none
+ #@TestPurpose Verify that the entries returned by ldifseach
+ are the same than the entries returned by
+ ldapsearch
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch with sizeLimit option.
+ #@TestStep Do an ldifsearch with the same option.
+ #@TestStep Do an ldif-dif to check the differences.
+ #@TestPostamble none
+ #@TestResult Success if ldifdiff returns no differences.
+ -->
+ <testcase name="getTestCaseName('ldifsearch: sizeLimit option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifsearch: sizeLimit option'
+ </message>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsSizeLimit' : '50' ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'expectedRC' : 4
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'CheckMatches'">
+ {
+ 'string2find' : 'dn: ' ,
+ 'mainString' : returnString ,
+ 'nbExpected' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifsearch check behavior tests
+ #@TestName ldifsearch: check behavior with a filter file
+ (containing one filter) and search attribute
+ #@TestIssue none
+ #@TestPurpose Verify the output of ldifsearch with
+ filter option.
+ #@TestPreamble none
+ #@TestStep Do an ldifsearch with filter file option and
+ a search attribute, and check that the number
+ of entries is correct
+ #@TestStep Compare the output of the previous command to
+ a reference file
+ #@TestPostamble none
+ #@TestResult Success if the outputs for ldifsearch matche
+ the refenrence outputs.
+ -->
+ <testcase name="getTestCaseName
+ ('ldifsearch: check output using --filename and a search attribute')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifsearch: check output using --filename and a \
+ search attribute'
+ </message>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilterFile' : filterfile ,
+ 'dsAttributes' : 'dn' ,
+ 'dsOutputFile' : '%s/ldifsearch_filterfile_and_attribute.out' \
+ % remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ldifsearch_filterfile_and_attribute.out' \
+ % remote.temp ,
+ 'targetLdif' : '%s/clu/ldapsearch_filterfile_and_attribute.ref'\
+ % remote.data ,
+ 'outputLdif' : '%s/ldifmodify.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifsearch check behavior tests
+ #@TestName ldifsearch: check behavior with a filter file
+ containing multiple filters
+ #@TestIssue none
+ #@TestPurpose Verify the output of ldifsearch with
+ filter option.
+ #@TestPreamble none
+ #@TestStep Do an ldifsearch with filter file option and
+ check that the number of entries is correct
+ #@TestPostamble none
+ #@TestResult Success if the number of entries is 222.
+ -->
+ <testcase name="getTestCaseName
+ ('ldifsearch: check with a filter file containing multiple filters')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifsearch: check with a filter file containing multiple\
+ filters'
+ </message>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilterFile' : mfilterfile
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'CheckMatches'">
+ {
+ 'string2find' : 'dn: ' ,
+ 'mainString' : returnString ,
+ 'nbExpected' : 222
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker ldifsearch check behavior tests
+ #@TestName ldifsearch: check behavior with @ocname as
+ attribute
+ #@TestIssue none
+ #@TestPurpose Verify the output of ldifsearch with @ocname
+ in the list of requested attributes.
+ #@TestPreamble none
+ #@TestStep Do an ldapsearch using @person as attribute
+ #@TestStep Do an ldifsearch with the same option.
+ #@TestStep Do an ldif-dif to check the differences.
+ #@TestStep Do an ldapsearch using @inetorgperson as
+ attribute
+ #@TestStep Do an ldifsearch with the same option.
+ #@TestStep Do an ldif-dif to check the differences.
+ #@TestPostamble none
+ #@TestResult Success if ldifdiff returns no differences.
+ -->
+ <testcase name="getTestCaseName
+ ('ldifsearch: check with @ocname as attribute')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'ldifsearch: @person as attribute'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'dsAttributes' : '@person' ,
+ 'outputFile' : 'ocname1_ldapsearch.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'dsAttributes' : '@person' ,
+ 'dsOutputFile' : '%s/ocname1_ldifsearch.out' % remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ocname1_ldifsearch.out' % remote.temp ,
+ 'targetLdif' : '%s/ocname1_ldapsearch.out' % remote.temp ,
+ 'outputLdif' : '%s/ocname1_ldifsearch.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <message>
+ 'ldifsearch: @inetorgperson as attribute'
+ </message>
+
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'dsAttributes' : '@inetorgperson' ,
+ 'outputFile' : 'ocname2_ldapsearch.out' ,
+ 'outputPath' : remote.temp
+ }
+ </call>
+
+ <call function="'ldifSearchWithScript'">
+ {
+ 'dsLdifFile' : dsfilename ,
+ 'dsBaseDN' : basedn ,
+ 'dsFilter' : 'uid=user.1*' ,
+ 'dsAttributes' : '@inetorgperson' ,
+ 'dsOutputFile' : '%s/ocname2_ldifsearch.out' % remote.temp
+ }
+ </call>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/ocname2_ldifsearch.out' % remote.temp ,
+ 'targetLdif' : '%s/ocname2_ldapsearch.out' % remote.temp ,
+ 'outputLdif' : '%s/ocname2_ldifsearch.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : STAXResult ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifsearch: standard options'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'outputFile' : 'ldapsearch.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'dsOutputFile' : '%s/ldifsearch.out' % remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ldifsearch.out' % remote.temp ,
- 'targetLdif' : '%s/ldapsearch.out' % remote.temp ,
- 'outputLdif' : '%s/ldifsearch.diff' % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifsearch check behavior tests
- #@TestName ldifsearch: check with scope option
- #@TestIssue none
- #@TestPurpose Verify that the entries returned by ldifseach
- are the same than the entries returned by
- ldapsearch
- #@TestPreamble none
- #@TestStep Do an ldapsearch with scope option.
- #@TestStep Do an ldifsearch with the same option.
- #@TestStep Do an ldif-dif to check the differences.
- #@TestPostamble none
- #@TestResult Success if ldifdiff returns no differences.
- -->
- <testcase name="getTestCaseName('ldifsearch: scope option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifsearch: scope option'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsScope' : 'base' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'outputFile' : 'scope_ldapsearch.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsSearchScope' : 'base' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsOutputFile' : '%s/scope_ldifsearch.out' % remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/scope_ldifsearch.out' % remote.temp ,
- 'targetLdif' : '%s/scope_ldapsearch.out' % remote.temp ,
- 'outputLdif' : '%s/scope_ldifsearch.diff' % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifsearch check behavior tests
- #@TestName ldifsearch: check with sizeLimit option
- #@TestIssue none
- #@TestPurpose Verify that the entries returned by ldifseach
- are the same than the entries returned by
- ldapsearch
- #@TestPreamble none
- #@TestStep Do an ldapsearch with sizeLimit option.
- #@TestStep Do an ldifsearch with the same option.
- #@TestStep Do an ldif-dif to check the differences.
- #@TestPostamble none
- #@TestResult Success if ldifdiff returns no differences.
- -->
- <testcase name="getTestCaseName('ldifsearch: sizeLimit option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifsearch: sizeLimit option'
- </message>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsSizeLimit' : '50' ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'expectedRC' : 4
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'CheckMatches'">
- {
- 'string2find' : 'dn: ' ,
- 'mainString' : returnString ,
- 'nbExpected' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifsearch check behavior tests
- #@TestName ldifsearch: check behavior with a filter file
- (containing one filter) and search attribute
- #@TestIssue none
- #@TestPurpose Verify the output of ldifsearch with
- filter option.
- #@TestPreamble none
- #@TestStep Do an ldifsearch with filter file option and
- a search attribute, and check that the number
- of entries is correct
- #@TestStep Compare the output of the previous command to
- a reference file
- #@TestPostamble none
- #@TestResult Success if the outputs for ldifsearch matche
- the refenrence outputs.
- -->
- <testcase name="getTestCaseName
- ('ldifsearch: check output using --filename and a search attribute')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifsearch: check output using --filename and a \
- search attribute'
- </message>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsBaseDN' : basedn ,
- 'dsFilterFile' : filterfile ,
- 'dsAttributes' : 'dn' ,
- 'dsOutputFile' : '%s/ldifsearch_filterfile_and_attribute.out' \
- % remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ldifsearch_filterfile_and_attribute.out' \
- % remote.temp ,
- 'targetLdif' : '%s/clu/ldapsearch_filterfile_and_attribute.ref'\
- % remote.data ,
- 'outputLdif' : '%s/ldifmodify.diff' % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifsearch check behavior tests
- #@TestName ldifsearch: check behavior with a filter file
- containing multiple filters
- #@TestIssue none
- #@TestPurpose Verify the output of ldifsearch with
- filter option.
- #@TestPreamble none
- #@TestStep Do an ldifsearch with filter file option and
- check that the number of entries is correct
- #@TestPostamble none
- #@TestResult Success if the number of entries is 222.
- -->
- <testcase name="getTestCaseName
- ('ldifsearch: check with a filter file containing multiple filters')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifsearch: check with a filter file containing multiple\
- filters'
- </message>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsBaseDN' : basedn ,
- 'dsFilterFile' : mfilterfile
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'CheckMatches'">
- {
- 'string2find' : 'dn: ' ,
- 'mainString' : returnString ,
- 'nbExpected' : 222
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker ldifsearch check behavior tests
- #@TestName ldifsearch: check behavior with @ocname as
- attribute
- #@TestIssue none
- #@TestPurpose Verify the output of ldifsearch with @ocname
- in the list of requested attributes.
- #@TestPreamble none
- #@TestStep Do an ldapsearch using @person as attribute
- #@TestStep Do an ldifsearch with the same option.
- #@TestStep Do an ldif-dif to check the differences.
- #@TestStep Do an ldapsearch using @inetorgperson as
- attribute
- #@TestStep Do an ldifsearch with the same option.
- #@TestStep Do an ldif-dif to check the differences.
- #@TestPostamble none
- #@TestResult Success if ldifdiff returns no differences.
- -->
- <testcase name="getTestCaseName
- ('ldifsearch: check with @ocname as attribute')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'ldifsearch: @person as attribute'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'dsAttributes' : '@person' ,
- 'outputFile' : 'ocname1_ldapsearch.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'dsAttributes' : '@person' ,
- 'dsOutputFile' : '%s/ocname1_ldifsearch.out' % remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ocname1_ldifsearch.out' % remote.temp ,
- 'targetLdif' : '%s/ocname1_ldapsearch.out' % remote.temp ,
- 'outputLdif' : '%s/ocname1_ldifsearch.diff' % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <message>
- 'ldifsearch: @inetorgperson as attribute'
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'dsAttributes' : '@inetorgperson' ,
- 'outputFile' : 'ocname2_ldapsearch.out' ,
- 'outputPath' : remote.temp
- }
- </call>
-
- <call function="'ldifSearchWithScript'">
- {
- 'dsLdifFile' : dsfilename ,
- 'dsBaseDN' : basedn ,
- 'dsFilter' : 'uid=user.1*' ,
- 'dsAttributes' : '@inetorgperson' ,
- 'dsOutputFile' : '%s/ocname2_ldifsearch.out' % remote.temp
- }
- </call>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/ocname2_ldifsearch.out' % remote.temp ,
- 'targetLdif' : '%s/ocname2_ldapsearch.out' % remote.temp ,
- 'outputLdif' : '%s/ocname2_ldifsearch.diff' % remote.temp
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : STAXResult ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_list-backends_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_list-backends_checkbehavior.xml
index edcea58..be98243 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_list-backends_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_list-backends_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,316 +34,347 @@
<sequence>
<block name="'clu_list-backends_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName list-backends check behavior tests
- #@TestSuitePurpose Test the results of the list-backends command.
- #@TestSuiteGroup list-backends check behavior tests
- #@TestScript clu_list-backends_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Case information
- #@TestMarker list-backends check behavior tests
- #@TestName list-backends: without option
- #@TestIssue none
- #@TestPurpose Test list-backends without option.
- #@TestPreamble none
- #@TestStep Do an list-backends without option.
- #@TestPostamble none
- #@TestResult Success if list-backends returns 0 and the
- ouput is correct.
- -->
- <testcase name="getTestCaseName
- ('list-backends: without option')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'list-backends: without option'
- </message>
-
- <call function="'listBackendsWithScript'">
- {}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'config : cn=config'
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s : dc=com' % DIRECTORY_INSTANCE_BE
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
+ <!--- Test Suite information
+ #@TestSuiteName list-backends check behavior tests
+ #@TestSuitePurpose Test the results of the list-backends command.
+ #@TestSuiteGroup list-backends check behavior tests
+ #@TestScript clu_list-backends_checkbehavior.xml
+ -->
- </testcase>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker list-backends check behavior tests
+ #@TestName list-backends: without option
+ #@TestIssue none
+ #@TestPurpose Test list-backends without option.
+ #@TestPreamble none
+ #@TestStep Do an list-backends without option.
+ #@TestPostamble none
+ #@TestResult Success if list-backends returns 0 and the
+ ouput is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('list-backends: without option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'list-backends: without option'
+ </message>
+
+ <call function="'listBackendsWithScript'">
+ {}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'config : cn=config'
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s : dc=com' % DIRECTORY_INSTANCE_BE
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker list-backends check behavior tests
+ #@TestName list-backends: backendID option
+ #@TestIssue none
+ #@TestPurpose Test list-backends with backendID option.
+ #@TestPreamble none
+ #@TestStep Do an list-backends with backendID option.
+ #@TestPostamble none
+ #@TestResult Success if list-backends returns 0 and the
+ ouput is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('list-backends: backendID option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'list-backends: backendID option'
+ </message>
+
+ <call function="'listBackendsWithScript'">
+ {
+ 'dsBackendID' : 'schema'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'schema : cn=schema'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker list-backends check behavior tests
+ #@TestName list-backends: baseDN option
+ #@TestIssue none
+ #@TestPurpose Test list-backends with baseDN option.
+ #@TestPreamble none
+ #@TestStep Do an list-backends with basedDN option.
+ #@TestPostamble none
+ #@TestResult Success if list-backends returns 0 and the
+ ouput is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('list-backends: baseDN option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'list-backends: baseDN option'
+ </message>
+
+ <call function="'listBackendsWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'The provided DN \'dc=com\' is a base DN'
+ msg2 = 'for backend \'%s\'' % DIRECTORY_INSTANCE_BE
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker list-backends check behavior tests
+ #@TestName list-backends: backendID and baseDN options
+ #@TestIssue none
+ #@TestPurpose Test list-backends with backendID and
+ baseDN options
+ #@TestPreamble none
+ #@TestStep Do an list-backends with backendID and
+ baseDN options.
+ #@TestPostamble none
+ #@TestResult Success if list-backends returns 1 and the
+ ouput is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('list-backends: backendID and baseDN options')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'list-backends: backendID and baseDN options'
+ </message>
+
+ <call function="'listBackendsWithScript'">
+ {
+ 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
+ 'dsBaseDN' : 'dc=com' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'You may not provide both the --backendID'
+ msg2 = 'and the --baseDN arguments'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker list-backends check behavior tests
+ #@TestName list-backends: invalid backendID
+ #@TestIssue none
+ #@TestPurpose Test list-backends with an invalid backendID
+ #@TestPreamble none
+ #@TestStep Do an list-backends with an invalid backendID
+ #@TestPostamble none
+ #@TestResult Success if list-backends returns 1 and the
+ ouput is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('list-backends: invalid backendID')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'list-backends: invalid backendID'
+ </message>
+
+ <call function="'listBackendsWithScript'">
+ {
+ 'dsBackendID' : 'mybackend' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'There is no backend with ID \'mybackend\' in the'
+ msg2 = 'server configuration'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker list-backends check behavior tests
+ #@TestName list-backends: invalid baseDN
+ #@TestIssue none
+ #@TestPurpose Test list-backends with an invalid baseDN
+ #@TestPreamble none
+ #@TestStep Do an list-backends with an invalid baseDN.
+ #@TestPostamble none
+ #@TestResult Success if list-backends returns 1 and the
+ ouput is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('list-backends: invalid baseDN')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'list-backends: invalid baseDN'
+ </message>
+
+ <call function="'listBackendsWithScript'">
+ {
+ 'dsBaseDN' : 'dc=mybasedn' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'The provided DN \'dc=mybasedn\' is not a base DN'
+ msg2 = 'for any backend configured in the Directory Server'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
- <!--- Test Case information
- #@TestMarker list-backends check behavior tests
- #@TestName list-backends: backendID option
- #@TestIssue none
- #@TestPurpose Test list-backends with backendID option.
- #@TestPreamble none
- #@TestStep Do an list-backends with backendID option.
- #@TestPostamble none
- #@TestResult Success if list-backends returns 0 and the
- ouput is correct.
- -->
- <testcase name="getTestCaseName
- ('list-backends: backendID option')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'list-backends: backendID option'
- </message>
-
- <call function="'listBackendsWithScript'">
- {
- 'dsBackendID' : 'schema'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'schema : cn=schema'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker list-backends check behavior tests
- #@TestName list-backends: baseDN option
- #@TestIssue none
- #@TestPurpose Test list-backends with baseDN option.
- #@TestPreamble none
- #@TestStep Do an list-backends with basedDN option.
- #@TestPostamble none
- #@TestResult Success if list-backends returns 0 and the
- ouput is correct.
- -->
- <testcase name="getTestCaseName
- ('list-backends: baseDN option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'list-backends: baseDN option'
- </message>
-
- <call function="'listBackendsWithScript'">
- {
- 'dsBaseDN' : 'dc=com'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'The provided DN \'dc=com\' is a base DN'
- msg2 = 'for backend \'%s\'' % DIRECTORY_INSTANCE_BE
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker list-backends check behavior tests
- #@TestName list-backends: backendID and baseDN options
- #@TestIssue none
- #@TestPurpose Test list-backends with backendID and
- baseDN options
- #@TestPreamble none
- #@TestStep Do an list-backends with backendID and
- baseDN options.
- #@TestPostamble none
- #@TestResult Success if list-backends returns 1 and the
- ouput is correct.
- -->
- <testcase name="getTestCaseName
- ('list-backends: backendID and baseDN options')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'list-backends: backendID and baseDN options'
- </message>
-
- <call function="'listBackendsWithScript'">
- {
- 'dsBackendID' : DIRECTORY_INSTANCE_BE ,
- 'dsBaseDN' : 'dc=com' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'You may not provide both the --backendID'
- msg2 = 'and the --baseDN arguments'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker list-backends check behavior tests
- #@TestName list-backends: invalid backendID
- #@TestIssue none
- #@TestPurpose Test list-backends with an invalid backendID
- #@TestPreamble none
- #@TestStep Do an list-backends with an invalid backendID
- #@TestPostamble none
- #@TestResult Success if list-backends returns 1 and the
- ouput is correct.
- -->
- <testcase name="getTestCaseName
- ('list-backends: invalid backendID')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'list-backends: invalid backendID'
- </message>
-
- <call function="'listBackendsWithScript'">
- {
- 'dsBackendID' : 'mybackend' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'There is no backend with ID \'mybackend\' in the'
- msg2 = 'server configuration'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker list-backends check behavior tests
- #@TestName list-backends: invalid baseDN
- #@TestIssue none
- #@TestPurpose Test list-backends with an invalid baseDN
- #@TestPreamble none
- #@TestStep Do an list-backends with an invalid baseDN.
- #@TestPostamble none
- #@TestResult Success if list-backends returns 1 and the
- ouput is correct.
- -->
- <testcase name="getTestCaseName
- ('list-backends: invalid baseDN')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'list-backends: invalid baseDN'
- </message>
-
- <call function="'listBackendsWithScript'">
- {
- 'dsBaseDN' : 'dc=mybasedn' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'The provided DN \'dc=mybasedn\' is not a base DN'
- msg2 = 'for any backend configured in the Directory Server'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
+ </finally>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml
index 0dbb058..a483821 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_make-ldif_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,311 +34,315 @@
<sequence>
<block name="'clu_make-ldif_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName make-ldif check behavior tests
- #@TestSuitePurpose Test the results of the make-ldif command.
- #@TestSuiteGroup make-ldif check behavior tests
- #@TestScript clu_make-ldif_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for template -->
- <script>
- template = '%s/clu/make-ldif_template.ref' % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker make-ldif check behavior tests
- #@TestName make-ldif: generate ldif file with seed 0
- #@TestIssue none
- #@TestPurpose Test make-ldif with to generate ldif file
- with seed 0
- #@TestPreamble none
- #@TestStep Do an make-ldif with seed of 0.
- #@TestPostamble none
- #@TestResult Success if make-ldif returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName
- ('make-ldif: generate ldif file with seed 0')">
+
+ <try>
+
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName make-ldif check behavior tests
+ #@TestSuitePurpose Test the results of the make-ldif command.
+ #@TestSuiteGroup make-ldif check behavior tests
+ #@TestScript clu_make-ldif_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for template -->
+ <script>
+ template = '%s/clu/make-ldif_template.ref' % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker make-ldif check behavior tests
+ #@TestName make-ldif: generate ldif file with seed 0
+ #@TestIssue none
+ #@TestPurpose Test make-ldif with to generate ldif file
+ with seed 0
+ #@TestPreamble none
+ #@TestStep Do an make-ldif with seed of 0.
+ #@TestPostamble none
+ #@TestResult Success if make-ldif returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('make-ldif: generate ldif file with seed 0')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'make-ldif: generate ldif file with seed 0'
+ </message>
+
+ <call function="'MakeLdifWithScript'">
+ {
+ 'templateFile' : template ,
+ 'ldifFile' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
+ 'randomSeed' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg = 'LDIF processing complete. 161 entries written'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker make-ldif check behavior tests
+ #@TestName make-ldif: import generated data
+ #@TestIssue none
+ #@TestPurpose Check that data genereted witch make-ldif
+ are correct
+ #@TestPreamble none
+ #@TestStep Do an make-ldif with seed of 0.
+ #@TestStep Stop the server.
+ #@TestStep Import the data generated with make-ldif.
+ #@TestStep Start the server.
+ #@TestStep Search some entries using ldapsearch.
+ #@TestPostamble none
+ #@TestResult Success if ldapsearch returns the expected
+ number of entries.
+ -->
+ <testcase name="getTestCaseName
+ ('make-ldif: import generated data')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'make-ldif: generate a second ldif file with seed of 0'
+ </message>
+
+ <call function="'MakeLdifWithScript'">
+ {
+ 'templateFile' : template ,
+ 'ldifFile' : '%s/make-ldif_seed0_2.ldif' % remote.temp ,
+ 'randomSeed' : 0
+ }
+ </call>
+
+ <message>
+ 'make-ldif: import the data'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ { 'dsAdd' : 'True',
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilename' : '%s/make-ldif_seed0_2.ldif' % remote.temp,
+ 'dsContinueOnError' : 'true',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ 'make-ldif: search some entries to check that data are imported'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCountEntries' : 'True' ,
+ 'dsBaseDN' : 'ou=make-ldif,o=clu tests,dc=example,dc=com',
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Total number of matching entries: 161'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker make-ldif check behavior tests
+ #@TestName make-ldif: compare generated data
+ #@TestIssue none
+ #@TestPurpose Check that data genereted witch make-ldif
+ are correct
+ #@TestPreamble none
+ #@TestStep Do an make-ldif to generate a first file
+ without seed.
+ #@TestStep Do an make-ldif to generate a second file
+ without seed.
+ #@TestStep Do an make-ldif to generate a file
+ with seed of 5.
+ #@TestStep Compare files generated with seed of 0.
+ #@TestStep Compare one file generated with seed of 0 and
+ one generated without seed.
+ #@TestStep Compare files generated without seed.
+ #@TestStep Compare one file generated with seed of 0 and
+ one generated with seed of 5.
+ #@TestPostamble none
+ #@TestResult Success if ldif-diff returns 0 in each cases.
+ -->
+ <testcase name="getTestCaseName
+ ('make-ldif: compare generated data')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'make-ldif: generate a first ldif file without seed'
+ </message>
+
+ <call function="'MakeLdifWithScript'">
+ {
+ 'templateFile' : template ,
+ 'ldifFile' : '%s/make-ldif_noseed_1.ldif' % remote.temp
+ }
+ </call>
+
+ <message>
+ 'make-ldif: generate a second ldif file without seed'
+ </message>
+
+ <call function="'MakeLdifWithScript'">
+ {
+ 'templateFile' : template ,
+ 'ldifFile' : '%s/make-ldif_noseed_2.ldif' % remote.temp
+ }
+ </call>
+
+ <message>
+ 'make-ldif: generate a ldif file with seed of 5'
+ </message>
+
+ <call function="'MakeLdifWithScript'">
+ {
+ 'templateFile' : template ,
+ 'ldifFile' : '%s/make-ldif_seed5.ldif' % remote.temp ,
+ 'randomSeed' : 5
+ }
+ </call>
+
+ <message>
+ 'make-ldif: ldifs with seed of 0 must be the same'
+ </message>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
+ 'targetLdif' : '%s/make-ldif_seed0_2.ldif' % remote.temp ,
+ 'outputLdif' : '%s/make-ldif_seed0.diff' % remote.temp
+ }
+ </call>
+
+ <message>
+ 'make-ldif: ldifs with seed of 0 and no seed must \
+ be different'
+ </message>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
+ 'targetLdif' : '%s/make-ldif_noseed_1.ldif' % remote.temp ,
+ 'outputLdif' : '%s/make-ldif_noseed_1.diff' % remote.temp
+ }
+ </call>
+
+ <message>
+ 'make-ldif: ldifs with no seed must be different'
+ </message>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/make-ldif_noseed_1.ldif' % remote.temp ,
+ 'targetLdif' : '%s/make-ldif_noseed_2.ldif' % remote.temp ,
+ 'outputLdif' : '%s/make-ldif_noseed_2.diff' % remote.temp
+ }
+ </call>
+
+ <message>
+ 'make-ldif: ldifs with seed of 0 and seed of 5 \
+ must be different'
+ </message>
+
+ <call function="'LdifDiffWithScript'">
+ {
+ 'sourceLdif' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
+ 'targetLdif' : '%s/make-ldif_seed5.ldif' % remote.temp ,
+ 'outputLdif' : '%s/make-ldif_seed5.diff' % remote.temp
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'make-ldif: generate ldif file with seed 0'
- </message>
-
- <call function="'MakeLdifWithScript'">
- {
- 'templateFile' : template ,
- 'ldifFile' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
- 'randomSeed' : 0
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg = 'LDIF processing complete. 161 entries written'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker make-ldif check behavior tests
- #@TestName make-ldif: import generated data
- #@TestIssue none
- #@TestPurpose Check that data genereted witch make-ldif
- are correct
- #@TestPreamble none
- #@TestStep Do an make-ldif with seed of 0.
- #@TestStep Stop the server.
- #@TestStep Import the data generated with make-ldif.
- #@TestStep Start the server.
- #@TestStep Search some entries using ldapsearch.
- #@TestPostamble none
- #@TestResult Success if ldapsearch returns the expected
- number of entries.
- -->
- <testcase name="getTestCaseName
- ('make-ldif: import generated data')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'make-ldif: generate a second ldif file with seed of 0'
- </message>
-
- <call function="'MakeLdifWithScript'">
- {
- 'templateFile' : template ,
- 'ldifFile' : '%s/make-ldif_seed0_2.ldif' % remote.temp ,
- 'randomSeed' : 0
- }
- </call>
+ </finally>
- <message>
- 'make-ldif: stop the server'
- </message>
-
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <message>
- 'make-ldif: import the data'
- </message>
-
- <call function="'ImportLdifWithScript'">
- {
- 'dsLdifFile' : '%s/make-ldif_seed0_2.ldif' % remote.temp ,
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE ,
- 'dsAppend' : 'True'
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <message>
- 'make-ldif: start the server'
- </message>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'make-ldif: search some entries to check that data are imported'
- </message>
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCountEntries' : 'True' ,
- 'dsBaseDN' : 'ou=make-ldif,o=clu tests,dc=example,dc=com',
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Total number of matching entries: 161'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker make-ldif check behavior tests
- #@TestName make-ldif: compare generated data
- #@TestIssue none
- #@TestPurpose Check that data genereted witch make-ldif
- are correct
- #@TestPreamble none
- #@TestStep Do an make-ldif to generate a first file
- without seed.
- #@TestStep Do an make-ldif to generate a second file
- without seed.
- #@TestStep Do an make-ldif to generate a file
- with seed of 5.
- #@TestStep Compare files generated with seed of 0.
- #@TestStep Compare one file generated with seed of 0 and
- one generated without seed.
- #@TestStep Compare files generated without seed.
- #@TestStep Compare one file generated with seed of 0 and
- one generated with seed of 5.
- #@TestPostamble none
- #@TestResult Success if ldif-diff returns 0 in each cases.
- -->
- <testcase name="getTestCaseName
- ('make-ldif: compare generated data')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'make-ldif: generate a first ldif file without seed'
- </message>
-
- <call function="'MakeLdifWithScript'">
- {
- 'templateFile' : template ,
- 'ldifFile' : '%s/make-ldif_noseed_1.ldif' % remote.temp
- }
- </call>
-
- <message>
- 'make-ldif: generate a second ldif file without seed'
- </message>
-
- <call function="'MakeLdifWithScript'">
- {
- 'templateFile' : template ,
- 'ldifFile' : '%s/make-ldif_noseed_2.ldif' % remote.temp
- }
- </call>
-
- <message>
- 'make-ldif: generate a ldif file with seed of 5'
- </message>
-
- <call function="'MakeLdifWithScript'">
- {
- 'templateFile' : template ,
- 'ldifFile' : '%s/make-ldif_seed5.ldif' % remote.temp ,
- 'randomSeed' : 5
- }
- </call>
-
- <message>
- 'make-ldif: ldifs with seed of 0 must be the same'
- </message>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
- 'targetLdif' : '%s/make-ldif_seed0_2.ldif' % remote.temp ,
- 'outputLdif' : '%s/make-ldif_seed0.diff' % remote.temp
- }
- </call>
-
- <message>
- 'make-ldif: ldifs with seed of 0 and no seed must \
- be different'
- </message>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
- 'targetLdif' : '%s/make-ldif_noseed_1.ldif' % remote.temp ,
- 'outputLdif' : '%s/make-ldif_noseed_1.diff' % remote.temp
- }
- </call>
-
- <message>
- 'make-ldif: ldifs with no seed must be different'
- </message>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/make-ldif_noseed_1.ldif' % remote.temp ,
- 'targetLdif' : '%s/make-ldif_noseed_2.ldif' % remote.temp ,
- 'outputLdif' : '%s/make-ldif_noseed_2.diff' % remote.temp
- }
- </call>
-
- <message>
- 'make-ldif: ldifs with seed of 0 and seed of 5 \
- must be different'
- </message>
-
- <call function="'LdifDiffWithScript'">
- {
- 'sourceLdif' : '%s/make-ldif_seed0_1.ldif' % remote.temp ,
- 'targetLdif' : '%s/make-ldif_seed5.ldif' % remote.temp ,
- 'outputLdif' : '%s/make-ldif_seed5.diff' % remote.temp
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_manage-tasks_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_manage-tasks_checkbehavior.xml
index f36cdd0..40728ce 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_manage-tasks_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_manage-tasks_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,392 +34,424 @@
<sequence>
<block name="'clu_manage-tasks_checkbehavior'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName manage-tasks check behavior tests
- #@TestSuitePurpose Test the results of the manage-tasks command.
- #@TestSuiteGroup manage-tasks check behavior tests
- #@TestScript clu_manage-tasks_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for template -->
- <script>
- task = '%s/clu/disconnect.ldif' % remote.data
- </script>
-
- <!--- Test Case information
- #@TestMarker manage-tasks check behavior tests
- #@TestName manage-tasks: summary of tasks
- #@TestIssue none
- #@TestPurpose Test manage-tasks with summary option
- #@TestPreamble none
- #@TestStep Do an manage-tasks with -s option.
- #@TestStep Check that task 125 and 126 are displayed.
- #@TestPostamble none
- #@TestResult Success if manage-tasks returns 0 and if the
- output is correct.
- -->
- <testcase name="getTestCaseName
- ('manage-tasks: get summary of tasks')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'manage-tasks: create two tasks with taskID 125 and 126'
- </message>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsAdd' : 'True' ,
- 'dsFilename' : task
- }
- </call>
-
- <message>
- 'manage-tasks: check that these tasks appear in the summary'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsSummary' : 'True' ,
- 'dsQuiet' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = '125 Disconnect Client Completed with errors'
- msg2 = '126 Disconnect Client Waiting on start time'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg1
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg2
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker manage-tasks check behavior tests
- #@TestName manage-tasks: info option
- #@TestIssue none
- #@TestPurpose Test manage-tasks with info option
- #@TestPreamble none
- #@TestStep Do an manage-tasks with -i option on task 125.
- #@TestStep Check some information for task 125.
- #@TestStep Do an manage-tasks with -i option on task 126.
- #@TestStep Check some information for task 126.
- #@TestPostamble none
- #@TestResult Success if manage-tasks returns 0 and if the
- outputs are correct.
- -->
- <testcase name="getTestCaseName
- ('manage-tasks: get task information')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'manage-tasks: get information for task 125'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsInfo' : 125 ,
- 'dsQuiet' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'ID 125'
- msg2 = 'Type Disconnect Client'
- msg3 = 'Status Completed with errors'
- msg4 = 'Scheduled Start Time Immediate execution'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg1
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg2
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg3
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg4
- }
- </call>
-
- <message>
- 'manage-tasks: get information for task 126'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsInfo' : 126 ,
- 'dsQuiet' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'ID 126'
- msg2 = 'Type Disconnect Client'
- msg3 = 'Status Waiting on start time'
- msg4 = 'Scheduled Start Time Dec 12, 2048 12:00:00 AM'
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg1
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg2
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg3
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg4
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker manage-tasks check behavior tests
- #@TestName manage-tasks: cancel option
- #@TestIssue none
- #@TestPurpose Test manage-tasks with cancel option
- with seed 0
- #@TestPreamble none
- #@TestStep Do an manage-tasks with -c option on task 125.
- #@TestStep Check the output of the previous command.
- #@TestStep Do an manage-tasks with -c option on task 126.
- #@TestStep Check the output of the previous command.
- #@TestPostamble none
- #@TestResult Success if manage-tasks return 1 for task 125,
- 0 for task 126 and if the outputs are correct.
- -->
- <testcase name="getTestCaseName('manage-tasks: cancel task')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'manage-tasks: cancel the task 125'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCancel' : 125 ,
- 'dsQuiet' : 'True' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'task 125 is not in a cancelable state'
- }
- </call>
-
- <message>
- 'manage-tasks: cancel the task 126'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCancel' : 126 ,
- 'dsQuiet' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Task 126 canceled'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
- <!--- Test Case information
- #@TestMarker manage-tasks check behavior tests
- #@TestName manage-tasks: invalid task
- #@TestIssue none
- #@TestPurpose Test manage-tasks with an invalid task
- #@TestPreamble none
- #@TestStep Do an manage-tasks with -c option and an
- invalid task.
- #@TestStep Check the output of the previous command.
- #@TestStep Do an manage-tasks with -i option and an
- invalid task.
- #@TestStep Check the output of the previous command.
- #@TestPostamble none
- #@TestResult Success if manage-tasks return 1 and if
- the outputs are correct.
- -->
- <testcase name="getTestCaseName('manage-tasks: invalid task')">
+ <try>
+
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName manage-tasks check behavior tests
+ #@TestSuitePurpose Test the results of the manage-tasks command.
+ #@TestSuiteGroup manage-tasks check behavior tests
+ #@TestScript clu_manage-tasks_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Define default value for template -->
+ <script>
+ task = '%s/clu/disconnect.ldif' % remote.data
+ </script>
+
+ <!--- Test Case information
+ #@TestMarker manage-tasks check behavior tests
+ #@TestName manage-tasks: summary of tasks
+ #@TestIssue none
+ #@TestPurpose Test manage-tasks with summary option
+ #@TestPreamble none
+ #@TestStep Do an manage-tasks with -s option.
+ #@TestStep Check that task 125 and 126 are displayed.
+ #@TestPostamble none
+ #@TestResult Success if manage-tasks returns 0 and if the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('manage-tasks: get summary of tasks')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'manage-tasks: create two tasks with taskID 125 and 126'
+ </message>
+
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsAdd' : 'True' ,
+ 'dsFilename' : task
+ }
+ </call>
+
+ <message>
+ 'manage-tasks: check that these tasks appear in the summary'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsSummary' : 'True' ,
+ 'dsQuiet' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = '125 Disconnect Client Completed with errors'
+ msg2 = '126 Disconnect Client Waiting on start time'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg1
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg2
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker manage-tasks check behavior tests
+ #@TestName manage-tasks: info option
+ #@TestIssue none
+ #@TestPurpose Test manage-tasks with info option
+ #@TestPreamble none
+ #@TestStep Do an manage-tasks with -i option on task 125.
+ #@TestStep Check some information for task 125.
+ #@TestStep Do an manage-tasks with -i option on task 126.
+ #@TestStep Check some information for task 126.
+ #@TestPostamble none
+ #@TestResult Success if manage-tasks returns 0 and if the
+ outputs are correct.
+ -->
+ <testcase name="getTestCaseName
+ ('manage-tasks: get task information')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'manage-tasks: get information for task 125'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsInfo' : 125 ,
+ 'dsQuiet' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'ID 125'
+ msg2 = 'Type Disconnect Client'
+ msg3 = 'Status Completed with errors'
+ msg4 = 'Scheduled Start Time Immediate execution'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg1
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg2
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg3
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg4
+ }
+ </call>
+
+ <message>
+ 'manage-tasks: get information for task 126'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsInfo' : 126 ,
+ 'dsQuiet' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'ID 126'
+ msg2 = 'Type Disconnect Client'
+ msg3 = 'Status Waiting on start time'
+ msg4 = 'Scheduled Start Time Dec 12, 2048 12:00:00 AM'
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg1
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg2
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg3
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg4
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker manage-tasks check behavior tests
+ #@TestName manage-tasks: cancel option
+ #@TestIssue none
+ #@TestPurpose Test manage-tasks with cancel option
+ with seed 0
+ #@TestPreamble none
+ #@TestStep Do an manage-tasks with -c option on task 125.
+ #@TestStep Check the output of the previous command.
+ #@TestStep Do an manage-tasks with -c option on task 126.
+ #@TestStep Check the output of the previous command.
+ #@TestPostamble none
+ #@TestResult Success if manage-tasks return 1 for task 125,
+ 0 for task 126 and if the outputs are correct.
+ -->
+ <testcase name="getTestCaseName('manage-tasks: cancel task')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'manage-tasks: cancel the task 125'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCancel' : 125 ,
+ 'dsQuiet' : 'True' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'task 125 is not in a cancelable state'
+ }
+ </call>
+
+ <message>
+ 'manage-tasks: cancel the task 126'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCancel' : 126 ,
+ 'dsQuiet' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Task 126 canceled'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker manage-tasks check behavior tests
+ #@TestName manage-tasks: invalid task
+ #@TestIssue none
+ #@TestPurpose Test manage-tasks with an invalid task
+ #@TestPreamble none
+ #@TestStep Do an manage-tasks with -c option and an
+ invalid task.
+ #@TestStep Check the output of the previous command.
+ #@TestStep Do an manage-tasks with -i option and an
+ invalid task.
+ #@TestStep Check the output of the previous command.
+ #@TestPostamble none
+ #@TestResult Success if manage-tasks return 1 and if
+ the outputs are correct.
+ -->
+ <testcase name="getTestCaseName('manage-tasks: invalid task')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'manage-tasks: information for an invalid task'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCancel' : 124 ,
+ 'dsQuiet' : 'True' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ msg1 = 'Error canceling task \'124\': There are no tasks'
+ msg2 = 'defined with ID \'124\''
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <message>
+ 'manage-tasks: information on an invalid task'
+ </message>
+
+ <call function="'manage-tasks'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsCancel' : 124 ,
+ 'dsQuiet' : 'True' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'manage-tasks: information for an invalid task'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCancel' : 124 ,
- 'dsQuiet' : 'True' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'Error canceling task \'124\': There are no tasks'
- msg2 = 'defined with ID \'124\''
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <message>
- 'manage-tasks: information on an invalid task'
- </message>
-
- <call function="'manage-tasks'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsCancel' : 124 ,
- 'dsQuiet' : 'True' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
index ed4f284..947d342 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_rebuild-index_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Portions Copyright 2008 Sun Microsystems, Inc.
+ ! Portions Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,541 +34,572 @@
<sequence>
<block name="'clu_rebuild-index_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName rebuild-index check behavior tests
- #@TestSuitePurpose Test the results of rebuild-index command.
- #@TestSuiteGroup rebuild-index check behavior tests
- #@TestScript clu_rebuild-index_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Case information
- #@TestMarker rebuild-index check behavior tests
- #@TestName rebuild-index: check on a single index
- #@TestIssue none
- #@TestPurpose Verify that rebuild-index command failed if
- the server is started and successful otherwise
- and that the output is correct.
- #@TestPreamble none
- #@TestStep Do a rebuild-index on a single index.
- #@TestStep Check the output of the command.
- #@TestStep Create a new index using dsconfig for the
- other testcases.
- #@TestStep Stop the server.
- #@TestStep Do a rebuild-index on a single index.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 1 when the
- server is running, 0 when the server is
- stopped and the outputs are correct.
- -->
- <testcase name="getTestCaseName('rebuild-index: single index')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName rebuild-index check behavior tests
+ #@TestSuitePurpose Test the results of rebuild-index command.
+ #@TestSuiteGroup rebuild-index check behavior tests
+ #@TestScript clu_rebuild-index_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker rebuild-index check behavior tests
+ #@TestName rebuild-index: check on a single index
+ #@TestIssue none
+ #@TestPurpose Verify that rebuild-index command failed if
+ the server is started and successful otherwise
+ and that the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a rebuild-index on a single index.
+ #@TestStep Check the output of the command.
+ #@TestStep Create a new index using dsconfig for the
+ other testcases.
+ #@TestStep Stop the server.
+ #@TestStep Do a rebuild-index on a single index.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 1 when the
+ server is running, 0 when the server is
+ stopped and the outputs are correct.
+ -->
+ <testcase name="getTestCaseName('rebuild-index: single index')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'rebuild-index: try to rebuild a single index while the server \
+ is running'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid' ] ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'An error occurred while attempting to acquire a'
+ msg2 = 'exclusive lock for backend userRoot'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <message>
+ 'rebuild-index: create a new index for the other testcases'
+ </message>
+
+ <call function="'dsconfig'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'create-local-db-index' ,
+ 'objectType' : 'backend-name' ,
+ 'objectName' : DIRECTORY_INSTANCE_BE ,
+ 'optionsString' : '--index-name st --set index-type:equality'
+ }
+ </call>
+
+ <message>
+ 'rebuild-index: stop the server'
+ </message>
+
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <message>
+ 'rebuild-index: rebuild a single index with the server stopped'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Rebuild of index\(es\) uid started with 1048'
+ msg2 = 'total records to process'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Rebuild complete. Processed 1048 records'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker rebuild-index check behavior tests
+ #@TestName rebuild-index: check without index option
+ #@TestIssue none
+ #@TestPurpose Verify that rebuild-index command failed
+ and that the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a rebuild-index without index option.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 1 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('rebuild-index: without index')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'rebuild-index: without index'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'At least one index must be specified'
+ msg2 = 'for the rebuild process'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker rebuild-index check behavior tests
+ #@TestName rebuild-index: check on multiple indexes
+ #@TestIssue none
+ #@TestPurpose Verify that rebuild-index command is
+ successful and that the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a rebuild-index on multiple indexes.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 0 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('rebuild-index: multiple indexes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'rebuild-index: multiple indexes'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid', 'cn' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Rebuild of index\(es\) uid, cn started'
+ msg2 = 'with 2096 total records to process'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Rebuild complete. Processed 2096 records'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker rebuild-index check behavior tests
+ #@TestName rebuild-index: check on a non existing index
+ #@TestIssue none
+ #@TestPurpose Verify that rebuild-index command failed
+ and that the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a rebuild-index on a non existing index.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 1 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('rebuild-index: non existing index')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'rebuild-index: non existing index'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'myindex' ] ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'There is no index configured for'
+ msg2 = 'attribute type \'myindex\''
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker rebuild-index check behavior tests
+ #@TestName rebuild-index: after creation
+ #@TestIssue none
+ #@TestPurpose Verify that rebuild-index command is
+ successfull on a newly created index
+ and that the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verifiy-index before rebuild on
+ the new index.
+ #@TestStep Check the output of the command.
+ #@TestStep Do a rebuild-index on the new index.
+ #@TestStep Check the output of the command.
+ #@TestStep Do a verify-index after rebuild on
+ the new index.
+ #@TestStep Check the output of the command.
+ #@TestStep Do again a rebuild-index on the new index.
+ #@TestStep Check the output of the command.
+ #@TestStep Re-start the server.
+ #@TestPostamble none
+ #@TestResult Success if all the commands return 0 and
+ the outputs are correct.
+ -->
+ <testcase name="getTestCaseName
+ ('rebuild-index: rebuild index after creation')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'rebuild-index: verify index st before rebuild'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'st' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Due to changes in the configuration, index'
+ msg2 = 'dc_com_st is currently operating in a degraded'
+ msg3 = 'state and must be rebuilt before it can be used'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s %s' % (msg1, msg2, msg3) ,
+ 'issue' : '3102'
+ }
+ </call>
+
+ <script>
+ msg1 = 'Statistics for records that have'
+ msg2 = 'exceeded the entry limit:'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <script>
+ msg1 = 'File dc_com_st.equality has 51 such record\(s\)'
+ msg2 = 'min=14 max=31 median=20'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <message>
+ 'rebuild-index: rebuild index st'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'st' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Due to changes in the configuration, index'
+ msg2 = 'dc_com_st is currently operating in a degraded'
+ msg3 = 'state and must be rebuilt before it can be used'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s %s' % (msg1, msg2, msg3) ,
+ 'issue' : '3102'
+ }
+ </call>
+
+ <script>
+ msg1 = 'Rebuild of index\(es\) st started with 1048'
+ msg2 = 'total records to process'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <script>
+ msg = 'Rebuild complete. Processed 1048 records'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <message>
+ 'rebuild-index: verify index st after rebuild'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'st' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Due to changes in the configuration, index'
+ msg2 = 'dc_com_st is currently operating in a degraded'
+ msg3 = 'state and must be rebuilt before it can be used'
+ </script>
+ <call function="'checktestStringNotPresent'">
+ {
+ 'returnString' : returnString ,
+ 'testString' : '%s %s %s' % (msg1, msg2, msg3)
+ }
+ </call>
+
+ <script>
+ msg = 'Checked 1048 entries and found 0 error'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <message>
+ 'rebuild-index: rebuild again index st'
+ </message>
+
+ <call function="'rebuildIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'st' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'Due to changes in the configuration, index'
+ msg2 = 'dc_com_st is currently operating in a degraded'
+ msg3 = 'state and must be rebuilt before it can be used'
+ </script>
+ <call function="'checktestStringNotPresent'">
+ {
+ 'returnString' : returnString ,
+ 'testString' : '%s %s %s' % (msg1, msg2, msg3)
+ }
+ </call>
+
+ <script>
+ msg1 = 'Rebuild of index\(es\) st started with 1048'
+ msg2 = 'total records to process'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <script>
+ msg = 'Rebuild complete. Processed 1048 records'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <message>
+ 'rebuild-index: start the server'
+ </message>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ {
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'rebuild-index: try to rebuild a single index while the server \
- is running'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid' ] ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'An error occurred while attempting to acquire a'
- msg2 = 'exclusive lock for backend userRoot'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <message>
- 'rebuild-index: create a new index for the other testcases'
- </message>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-local-db-index' ,
- 'objectType' : 'backend-name' ,
- 'objectName' : DIRECTORY_INSTANCE_BE ,
- 'optionsString' : '--index-name st --set index-type:equality'
- }
- </call>
-
- <message>
- 'rebuild-index: stop the server'
- </message>
-
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <message>
- 'rebuild-index: rebuild a single index with the server stopped'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Rebuild of index\(es\) uid started with 1047'
- msg2 = 'total records to process'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Rebuild complete. Processed 1047 records'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker rebuild-index check behavior tests
- #@TestName rebuild-index: check without index option
- #@TestIssue none
- #@TestPurpose Verify that rebuild-index command failed
- and that the output is correct.
- #@TestPreamble none
- #@TestStep Do a rebuild-index without index option.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 1 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('rebuild-index: without index')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'rebuild-index: without index'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'At least one index must be specified'
- msg2 = 'for the rebuild process'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker rebuild-index check behavior tests
- #@TestName rebuild-index: check on multiple indexes
- #@TestIssue none
- #@TestPurpose Verify that rebuild-index command is
- successful and that the output is correct.
- #@TestPreamble none
- #@TestStep Do a rebuild-index on multiple indexes.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 0 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('rebuild-index: multiple indexes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'rebuild-index: multiple indexes'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid', 'cn' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Rebuild of index\(es\) uid, cn started'
- msg2 = 'with 2094 total records to process'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
+ </finally>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Rebuild complete. Processed 2094 records'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker rebuild-index check behavior tests
- #@TestName rebuild-index: check on a non existing index
- #@TestIssue none
- #@TestPurpose Verify that rebuild-index command failed
- and that the output is correct.
- #@TestPreamble none
- #@TestStep Do a rebuild-index on a non existing index.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 1 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('rebuild-index: non existing index')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'rebuild-index: non existing index'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'myindex' ] ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'There is no index configured for'
- msg2 = 'attribute type \'myindex\''
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker rebuild-index check behavior tests
- #@TestName rebuild-index: after creation
- #@TestIssue none
- #@TestPurpose Verify that rebuild-index command is
- successfull on a newly created index
- and that the output is correct.
- #@TestPreamble none
- #@TestStep Do a verifiy-index before rebuild on
- the new index.
- #@TestStep Check the output of the command.
- #@TestStep Do a rebuild-index on the new index.
- #@TestStep Check the output of the command.
- #@TestStep Do a verify-index after rebuild on
- the new index.
- #@TestStep Check the output of the command.
- #@TestStep Do again a rebuild-index on the new index.
- #@TestStep Check the output of the command.
- #@TestStep Re-start the server.
- #@TestPostamble none
- #@TestResult Success if all the commands return 0 and
- the outputs are correct.
- -->
- <testcase name="getTestCaseName
- ('rebuild-index: rebuild index after creation')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'rebuild-index: verify index st before rebuild'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'st' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Due to changes in the configuration, index'
- msg2 = 'dc_com_st is currently operating in a degraded'
- msg3 = 'state and must be rebuilt before it can be used'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s %s' % (msg1, msg2, msg3) ,
- 'issue' : '3102'
- }
- </call>
-
- <script>
- msg1 = 'Statistics for records that have'
- msg2 = 'exceeded the entry limit:'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <script>
- msg1 = 'File dc_com_st.equality has 51 such record\(s\)'
- msg2 = 'min=14 max=31 median=20'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <message>
- 'rebuild-index: rebuild index st'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'st' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Due to changes in the configuration, index'
- msg2 = 'dc_com_st is currently operating in a degraded'
- msg3 = 'state and must be rebuilt before it can be used'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s %s' % (msg1, msg2, msg3) ,
- 'issue' : '3102'
- }
- </call>
-
- <script>
- msg1 = 'Rebuild of index\(es\) st started with 1047'
- msg2 = 'total records to process'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <script>
- msg = 'Rebuild complete. Processed 1047 records'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <message>
- 'rebuild-index: verify index st after rebuild'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'st' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Due to changes in the configuration, index'
- msg2 = 'dc_com_st is currently operating in a degraded'
- msg3 = 'state and must be rebuilt before it can be used'
- </script>
- <call function="'checktestStringNotPresent'">
- {
- 'returnString' : returnString ,
- 'testString' : '%s %s %s' % (msg1, msg2, msg3)
- }
- </call>
-
- <script>
- msg = 'Checked 1047 entries and found 0 error'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <message>
- 'rebuild-index: rebuild again index st'
- </message>
-
- <call function="'rebuildIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'st' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'Due to changes in the configuration, index'
- msg2 = 'dc_com_st is currently operating in a degraded'
- msg3 = 'state and must be rebuilt before it can be used'
- </script>
- <call function="'checktestStringNotPresent'">
- {
- 'returnString' : returnString ,
- 'testString' : '%s %s %s' % (msg1, msg2, msg3)
- }
- </call>
-
- <script>
- msg1 = 'Rebuild of index\(es\) st started with 1047'
- msg2 = 'total records to process'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <script>
- msg = 'Rebuild complete. Processed 1047 records'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <message>
- 'rebuild-index: start the server'
- </message>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_setup.xml
index 48c1d11..3669578 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_setup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -91,45 +91,6 @@
<!--- Test Case information
#@TestMarker setup
- #@TestName setup: adding initial entries
- #@TestIssue none
- #@TestPurpose Load the data needed by the test suite.
- #@TestPreamble none
- #@TestStep Load the data needed by the test suite.
- #@TestPostamble none
- #@TestResult Success if importLdif returns 0.
- -->
- <testcase name="getTestCaseName('setup: load data')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'setup: add initial entries'
- </message>
-
- <call function="'importLdif'">
- {
- 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data
- }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker setup
#@TestName setup: start DS
#@TestIssue none
#@TestPurpose Start DS.
@@ -163,7 +124,7 @@
<!--- Check that DS started -->
<call function="'isAlive'">
{
- 'noOfLoops' : 10 ,
+ 'noOfLoops' : 5 ,
'noOfMilliSeconds' : 2000
}
</call>
@@ -174,6 +135,76 @@
</testcase>
+ <!--- Test Case information
+ #@TestMarker setup
+ #@TestName setup: adding initial entries
+ #@TestIssue none
+ #@TestPurpose Load the data needed by the test suite.
+ #@TestPreamble none
+ #@TestStep Load the data needed by the test suite.
+ #@TestPostamble none
+ #@TestResult Success if importLdif returns 0.
+ -->
+ <testcase name="getTestCaseName('setup: load data')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'setup: add initial entries'
+ </message>
+
+ <!-- Turn off pre-encoded passwords -->
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'password-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'Default Password Policy',
+ 'attributeName' : 'allow-pre-encoded-passwords',
+ 'attributeValue' : 'true',
+ 'expectedRC' : expectedRC
+ }
+ </call>
+
+ <call function="'ldapModifyWithScript'">
+ { 'dsAdd' : 'True',
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilename' : '%s/clu/clu_start.ldif' \
+ % remote.data,
+ 'dsContinueOnError' : 'true',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : RC ,
+ 'result' : STAXResult
+ }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ {
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
<call function="'testSuite_Postamble'"/>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_status_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_status_checkbehavior.xml
index 066d88c..536e1d7 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_status_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_status_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,91 +34,122 @@
<sequence>
<block name="'clu_status_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName status check behavior tests
- #@TestSuitePurpose Test the results of the status command.
- #@TestSuiteGroup status check behavior tests
- #@TestScript clu_status_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Case information
- #@TestMarker status check behavior tests
- #@TestName status: authenticated mode
- #@TestIssue none
- #@TestPurpose Test status in authenticated mode.
- #@TestPreamble none
- #@TestStep Do a status in authenticated mode.
- #@TestPostamble none
- #@TestResult Success if status returns 0.
- -->
- <testcase name="getTestCaseName('status: authenticated mode')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName status check behavior tests
+ #@TestSuitePurpose Test the results of the status command.
+ #@TestSuiteGroup status check behavior tests
+ #@TestScript clu_status_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker status check behavior tests
+ #@TestName status: authenticated mode
+ #@TestIssue none
+ #@TestPurpose Test status in authenticated mode.
+ #@TestPreamble none
+ #@TestStep Do a status in authenticated mode.
+ #@TestPostamble none
+ #@TestResult Success if status returns 0.
+ -->
+ <testcase name="getTestCaseName('status: authenticated mode')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'status: authenticated mode'
+ </message>
+
+ <call function="'StatusWithScript'">
+ {
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
+ }
+ </call>
+
+ <!-- STAXResult is not always a list-->
+ <script>
+ try:
+ RC,Result=STAXResult[0]
+ except AttributeError,details:
+ Result='AttributeError: can not parse STAXResult %s' % details
+ RC='1'
+ </script>
+
+ <call function="'checktestRC'">
+ {
+ 'returncode' : RC,
+ 'result' : Result
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : Result ,
+ 'expectedString' : 'Administrative Users: %s' \
+ % DIRECTORY_INSTANCE_DN
+ }
+ </call>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : Result ,
+ 'expectedString' : 'Server Run Status: Started'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'status: authenticated mode'
- </message>
-
- <call function="'StatusWithScript'">
- {
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <!-- STAXResult is not always a list-->
- <script>
- try:
- RC,Result=STAXResult[0]
- except AttributeError,details:
- Result='AttributeError: can not parse STAXResult %s' % details
- RC='1'
- </script>
-
- <call function="'checktestRC'">
- {
- 'returncode' : RC,
- 'result' : Result
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : Result ,
- 'expectedString' : 'Administrative Users: %s' \
- % DIRECTORY_INSTANCE_DN
- }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : Result ,
- 'expectedString' : 'Server Run Status: Started'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml
index d7e7274..097f575f 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/clu/clu_verify-index_checkbehavior.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Portions Copyright 2008 Sun Microsystems, Inc.
+ ! Portions Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,363 +34,394 @@
<sequence>
<block name="'clu_verify-index_checkbehavior'">
+
+ <try>
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName verify-index check behavior tests
- #@TestSuitePurpose Test the results of verify-index command.
- #@TestSuiteGroup verify-index check behavior tests
- #@TestScript clu_verify-index_checkbehavior.xml
- -->
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'clu'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Case information
- #@TestMarker verify-index check behavior tests
- #@TestName verify-index: check on a single index
- #@TestIssue none
- #@TestPurpose Verify that verify-index command is successful
- and the output is correct.
- #@TestPreamble none
- #@TestStep Do a verify-index on a single index.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 0 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('verify-index: single index')">
+ <sequence>
+ <!--- Test Suite information
+ #@TestSuiteName verify-index check behavior tests
+ #@TestSuitePurpose Test the results of verify-index command.
+ #@TestSuiteGroup verify-index check behavior tests
+ #@TestScript clu_verify-index_checkbehavior.xml
+ -->
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group'] = 'clu'
+ CurrentTestPath['suite'] = STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'allowPreEncodePassword' : True
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker verify-index check behavior tests
+ #@TestName verify-index: check on a single index
+ #@TestIssue none
+ #@TestPurpose Verify that verify-index command is successful
+ and the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verify-index on a single index.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 0 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('verify-index: single index')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'verify-index: single index'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Checked 1048 entries and found 0 error'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker verify-index check behavior tests
+ #@TestName verify-index: check without index option
+ #@TestIssue none
+ #@TestPurpose Verify that verify-index command is successful
+ and the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verify-index without index option.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 0 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('verify-index: without index')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'verify-index: without index'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Checked 1048 entries and found 0 error'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker verify-index check behavior tests
+ #@TestName verify-index: check on multiple indexes
+ #@TestIssue none
+ #@TestPurpose Verify that verify-index command is successful
+ and the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verify-index on multiple indexes.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 0 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('verify-index: multiple indexes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'verify-index: multiple indexes'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid', 'cn' ]
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Checked 1048 entries and found 0 error'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker verify-index check behavior tests
+ #@TestName verify-index: check with clean option
+ #@TestIssue none
+ #@TestPurpose Verify that verify-index command is successful
+ and the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verify-index with clean option..
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 0 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('verify-index: clean option')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'verify-index: clean option'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid' ] ,
+ 'dsClean' : 'True'
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : 'Checked 1000 records and found 0 error'
+ }
+ </call>
+
+ <script>
+ msg = 'Number of records referencing more than one entry: 10'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <script>
+ msg = 'Number of records that exceed the entry limit: 0'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <script>
+ msg = 'Average number of entries referenced is 1.04/record'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <script>
+ msg = 'Maximum number of entries referenced by any record is 5'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg ,
+ 'issue' : '3102'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker verify-index check behavior tests
+ #@TestName verify-index: multiple indexes, clean option
+ #@TestIssue none
+ #@TestPurpose Verify that verify-index command failed and
+ the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verify-index on multiple indexes with
+ clean option.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 1 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName
+ ('verify-index: clean option and multiple indexes')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'verify-index: clean option and multiple indexes'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'uid', 'cn' ] ,
+ 'dsClean' : 'True' ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg = 'Only one index at a time may be verified for cleanliness'
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : msg
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker verify-index check behavior tests
+ #@TestName verify-index: check with a non existing index
+ #@TestIssue none
+ #@TestPurpose Verify that verify-index command failed and
+ the output is correct.
+ #@TestPreamble none
+ #@TestStep Do a verify-index on a non existing index.
+ #@TestStep Check the output of the command.
+ #@TestPostamble none
+ #@TestResult Success if verify-index returns 1 and the
+ output is correct.
+ -->
+ <testcase name="getTestCaseName('verify-index: non existing index')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'verify-index: non existing index'
+ </message>
+
+ <call function="'verifyIndexWithScript'">
+ {
+ 'dsBaseDN' : 'dc=com' ,
+ 'dsIndexList' : [ 'myindex' ] ,
+ 'expectedRC' : 1
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <script>
+ msg1 = 'There is no index configured for'
+ msg2 = 'attribute type \'myindex\''
+ </script>
+ <call function="'checktestString'">
+ {
+ 'returnString' : returnString ,
+ 'expectedString' : '%s %s' % (msg1, msg2)
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
+
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'verify-index: single index'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Checked 1047 entries and found 0 error'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global CLU Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
+ </finally>
- <!--- Test Case information
- #@TestMarker verify-index check behavior tests
- #@TestName verify-index: check without index option
- #@TestIssue none
- #@TestPurpose Verify that verify-index command is successful
- and the output is correct.
- #@TestPreamble none
- #@TestStep Do a verify-index without index option.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 0 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('verify-index: without index')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'verify-index: without index'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com'
- }
- </call>
+ </try>
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Checked 1047 entries and found 0 error'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker verify-index check behavior tests
- #@TestName verify-index: check on multiple indexes
- #@TestIssue none
- #@TestPurpose Verify that verify-index command is successful
- and the output is correct.
- #@TestPreamble none
- #@TestStep Do a verify-index on multiple indexes.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 0 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('verify-index: multiple indexes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'verify-index: multiple indexes'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid', 'cn' ]
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Checked 1047 entries and found 0 error'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker verify-index check behavior tests
- #@TestName verify-index: check with clean option
- #@TestIssue none
- #@TestPurpose Verify that verify-index command is successful
- and the output is correct.
- #@TestPreamble none
- #@TestStep Do a verify-index with clean option..
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 0 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('verify-index: clean option')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'verify-index: clean option'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid' ] ,
- 'dsClean' : 'True'
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : 'Checked 1000 records and found 0 error'
- }
- </call>
-
- <script>
- msg = 'Number of records referencing more than one entry: 10'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <script>
- msg = 'Number of records that exceed the entry limit: 0'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <script>
- msg = 'Average number of entries referenced is 1.04/record'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <script>
- msg = 'Maximum number of entries referenced by any record is 5'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg ,
- 'issue' : '3102'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker verify-index check behavior tests
- #@TestName verify-index: multiple indexes, clean option
- #@TestIssue none
- #@TestPurpose Verify that verify-index command failed and
- the output is correct.
- #@TestPreamble none
- #@TestStep Do a verify-index on multiple indexes with
- clean option.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 1 and the
- output is correct.
- -->
- <testcase name="getTestCaseName
- ('verify-index: clean option and multiple indexes')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'verify-index: clean option and multiple indexes'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'uid', 'cn' ] ,
- 'dsClean' : 'True' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg = 'Only one index at a time may be verified for cleanliness'
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker verify-index check behavior tests
- #@TestName verify-index: check with a non existing index
- #@TestIssue none
- #@TestPurpose Verify that verify-index command failed and
- the output is correct.
- #@TestPreamble none
- #@TestStep Do a verify-index on a non existing index.
- #@TestStep Check the output of the command.
- #@TestPostamble none
- #@TestResult Success if verify-index returns 1 and the
- output is correct.
- -->
- <testcase name="getTestCaseName('verify-index: non existing index')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'verify-index: non existing index'
- </message>
-
- <call function="'verifyIndexWithScript'">
- {
- 'dsBaseDN' : 'dc=com' ,
- 'dsIndexList' : [ 'myindex' ] ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <script>
- msg1 = 'There is no index configured for'
- msg2 = 'attribute type \'myindex\''
- </script>
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : '%s %s' % (msg1, msg2)
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/core.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/core.xml
index 5332b24..ce398f8 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/core.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/core/core.xml
@@ -37,8 +37,8 @@
<block name="'core'">
<sequence>
<!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
<call function="'loadJobEnvironment'">
{ 'parent' : STAXParentID }
</call>
@@ -59,6 +59,7 @@
suiteList.append('controls/core_ctrls_assertion')
suiteList.append('controls/core_ctrls_matched_values')
suiteList.append('binaryattr/core_binaryattr')
+
</script>
<!-- Run the test suites -->
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig.xml
index eff9d3b..f8314a4 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig.xml
@@ -23,46 +23,76 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
-
- <defaultcall function="main_dsconfig"/>
-
+ <defaultcall function="main_dsconfig" />
<function name="main_dsconfig">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
+
<sequence>
-
- <block name="'dsconfig'">
-
- <sequence>
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
-
- <script>
- CurrentTestPath['group']='dsconfig'
- </script>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/dsconfig/dsconfig_list.xml' % (TESTS_DIR)"/>
- <call function="'dsconfig_list'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/dsconfig/dsconfig_get.xml' % (TESTS_DIR)"/>
- <call function="'dsconfig_get'" />
-
- </sequence>
-
- </block>
-
+ <try>
+ <block name="'dsconfig'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='dsconfig'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('dsconfig_list')
+ suiteList.append('dsconfig_get')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s.xml' % (TESTS_DIR,_group,_suite)"/>
+ <call function="'%s' % _suite" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
</function>
-
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_get.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_get.xml
index 79b0a1d..35c134f 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_get.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_get.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,174 +34,192 @@
<sequence>
<block name="'dsconfig-get'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='aci'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/dsconfig/dsconfig_setup.xml' % (TESTS_DIR)"/>
- <call function="'dsconfig_setup'" />
-
- <script>
- componentList = []
-
- f = open('%s/testcases/dsconfig/get.dat' % (TESTS_DIR),'r')
- for line in f.readlines():
- if line.startswith('#'):
- continue
- else:
- lineSingle = line.split(':')
- componentList.append(lineSingle)
- f.close()
-
- componentNumber=0
- testNumber=0
- i=1
- </script>
- <iterate var="dummyIndex" in="componentList">
+ <try>
<sequence>
- <script>
- # avoid same testName by incrementing the number
- thisTestname = "%s.%s, %s" % (i,componentList[componentNumber][0],componentList[componentNumber][2])
- i+=1
- </script>
- <message>'TRACE %s' % thisTestname</message>
- <testcase name="getTestCaseName(thisTestname)" >
- <sequence>
- <call function="'testCase_Preamble'" />
- <message>
- 'Getting component %s, %s, %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2], componentList[componentNumber][3], componentList[componentNumber][4])
- </message>
-
- <if expr="componentList[componentNumber][0] == 'get-local-db-index-prop'">
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : '%s' % componentList[componentNumber][0] ,
- 'objectType' : '%s' % componentList[componentNumber][1] ,
- 'objectName' : '%s' % componentList[componentNumber][2] ,
- 'optionsString' : '--backend-name %s' % DIRECTORY_INSTANCE_BE ,
- 'expectedRC' : 0
- }
- </call>
- <else>
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : '%s' % componentList[componentNumber][0] ,
- 'objectType' : '%s' % componentList[componentNumber][1] ,
- 'objectName' : '%s' % componentList[componentNumber][2] ,
- 'expectedRC' : 0
- }
- </call>
- </else>
- </if>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : componentList[componentNumber][3] ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : componentList[componentNumber][4] }
- </call>
-
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
- <script>
- componentNumber=componentNumber+1
- </script>
- </sequence>
- </iterate>
-
- <script>
- componentList2 = []
-
- f = open('%s/testcases/dsconfig/get2.dat' % (TESTS_DIR),'r')
- for line in f.readlines():
- if line.startswith('#'):
- continue
- else:
- lineSingle = line.split(':')
- componentList2.append(lineSingle)
- f.close()
-
- componentNumber=0
- testNumber=0
- </script>
- <iterate var="dummyIndex" in="componentList2">
- <sequence>
- <script>
- thisTestname = componentList2[componentNumber][0]
- </script>
- <testcase name="getTestCaseName(thisTestname)" >
- <sequence>
- <call function="'testCase_Preamble'" />
- <message>
- 'Getting component %s, %s, %s' % (componentList2[componentNumber][0], componentList2[componentNumber][1], componentList2[componentNumber][2])
- </message>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : '%s' % componentList2[componentNumber][0] ,
- 'expectedRC' : 0
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : componentList2[componentNumber][1] ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : componentList2[componentNumber][2] }
- </call>
-
- <call function="'testCase_Postamble'" />
- </sequence>
- </testcase>
- <script>
- componentNumber=componentNumber+1
- </script>
- </sequence>
- </iterate>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/dsconfig/dsconfig_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'dsconfig_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='aci'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
- </sequence>
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False,
+ 'startServer' : True,
+ 'stopServer' : False,
+ }
+ </call>
+
+ <script>
+ componentList = []
+
+ f = open('%s/testcases/dsconfig/get.dat' % (TESTS_DIR),'r')
+ for line in f.readlines():
+ if line.startswith('#'):
+ continue
+ else:
+ lineSingle = line.split(':')
+ componentList.append(lineSingle)
+ f.close()
+
+ componentNumber=0
+ testNumber=0
+ i=1
+ </script>
+ <iterate var="dummyIndex" in="componentList">
+ <sequence>
+ <script>
+ # avoid same testName by incrementing the number
+ thisTestname = "%s.%s, %s" % (i,componentList[componentNumber][0],componentList[componentNumber][2])
+ i+=1
+ </script>
+ <message>'TRACE %s' % thisTestname</message>
+ <testcase name="getTestCaseName(thisTestname)" >
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ 'Getting component %s, %s, %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2], componentList[componentNumber][3], componentList[componentNumber][4])
+ </message>
+
+ <if expr="componentList[componentNumber][0] == 'get-local-db-index-prop'">
+ <call function="'dsconfig'">
+ {
+ 'dsInstanceHost' : server.host ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'subcommand' : '%s' % componentList[componentNumber][0] ,
+ 'objectType' : '%s' % componentList[componentNumber][1] ,
+ 'objectName' : '%s' % componentList[componentNumber][2] ,
+ 'optionsString' : '--backend-name %s' % DIRECTORY_INSTANCE_BE ,
+ 'expectedRC' : 0
+ }
+ </call>
+ <else>
+ <call function="'dsconfig'">
+ {
+ 'dsInstanceHost' : server.host ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'subcommand' : '%s' % componentList[componentNumber][0] ,
+ 'objectType' : '%s' % componentList[componentNumber][1] ,
+ 'objectName' : '%s' % componentList[componentNumber][2] ,
+ 'expectedRC' : 0
+ }
+ </call>
+ </else>
+ </if>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : componentList[componentNumber][3] ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : componentList[componentNumber][4] }
+ </call>
+
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+ <script>
+ componentNumber=componentNumber+1
+ </script>
+ </sequence>
+ </iterate>
+
+ <script>
+ componentList2 = []
+
+ f = open('%s/testcases/dsconfig/get2.dat' % (TESTS_DIR),'r')
+ for line in f.readlines():
+ if line.startswith('#'):
+ continue
+ else:
+ lineSingle = line.split(':')
+ componentList2.append(lineSingle)
+ f.close()
+
+ componentNumber=0
+ testNumber=0
+ </script>
+ <iterate var="dummyIndex" in="componentList2">
+ <sequence>
+ <script>
+ thisTestname = componentList2[componentNumber][0]
+ </script>
+ <testcase name="getTestCaseName(thisTestname)" >
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ 'Getting component %s, %s, %s' % (componentList2[componentNumber][0], componentList2[componentNumber][1], componentList2[componentNumber][2])
+ </message>
+
+ <call function="'dsconfig'">
+ {
+ 'dsInstanceHost' : server.host ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'subcommand' : '%s' % componentList2[componentNumber][0] ,
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : componentList2[componentNumber][1] ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : componentList2[componentNumber][2] }
+ </call>
+
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+ <script>
+ componentNumber=componentNumber+1
+ </script>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Dsconfig Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'">
+ { 'deleteSuffix' : False }
+ </call>
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_list.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_list.xml
index ced0462..bb01bf4 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_list.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsconfig/dsconfig_list.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,103 +34,122 @@
<sequence>
<block name="'dsconfig-list'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='aci'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/dsconfig/dsconfig_setup.xml' % (TESTS_DIR)"/>
- <call function="'dsconfig_setup'" />
-
- <script>
- componentList = []
-
- f = open('%s/testcases/dsconfig/list.dat' % (TESTS_DIR),'r')
- for line in f.readlines():
- if line.startswith('#'):
- continue
- else:
- lineSingle = line.split(':')
- componentList.append(lineSingle)
- f.close()
-
- componentNumber=0
- testNumber=0
- </script>
- <iterate var="dummyIndex" in="componentList">
- <sequence>
- <testcase name="getTestCaseName(componentList[componentNumber][0])" >
- <sequence>
- <call function="'testCase_Preamble'" />
- <message>
- 'Listing component %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2])
- </message>
-
- <if expr="componentList[componentNumber][0] == 'list-local-db-indexes'">
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : '%s' % componentList[componentNumber][0] ,
- 'objectType' : 'backend-name' ,
- 'objectName' : DIRECTORY_INSTANCE_BE ,
- 'expectedRC' : 0
- }
- </call>
- <else>
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : '%s' % componentList[componentNumber][0] ,
- 'expectedRC' : 0
- }
- </call>
- </else>
- </if>
+ <try>
- <script>
- returnString = STAXResult[0][1]
- </script>
+ <sequence>
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : componentList[componentNumber][1] ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : componentList[componentNumber][2] }
- </call>
-
- <call function="'testCase_Postamble'" />
- <script>
- componentNumber=componentNumber+1
- </script>
- </sequence>
- </testcase>
- </sequence>
- </iterate>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/dsconfig/dsconfig_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'dsconfig_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='aci'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
- </sequence>
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False,
+ 'startServer' : True,
+ 'stopServer' : False,
+ }
+ </call>
+
+ <script>
+ componentList = []
+
+ f = open('%s/testcases/dsconfig/list.dat' % (TESTS_DIR),'r')
+ for line in f.readlines():
+ if line.startswith('#'):
+ continue
+ else:
+ lineSingle = line.split(':')
+ componentList.append(lineSingle)
+ f.close()
+
+ componentNumber=0
+ testNumber=0
+ </script>
+ <iterate var="dummyIndex" in="componentList">
+ <sequence>
+ <testcase name="getTestCaseName(componentList[componentNumber][0])" >
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ 'Listing component %s, %s, %s' % (componentList[componentNumber][0], componentList[componentNumber][1], componentList[componentNumber][2])
+ </message>
+
+ <if expr="componentList[componentNumber][0] == 'list-local-db-indexes'">
+ <call function="'dsconfig'">
+ {
+ 'dsInstanceHost' : server.host ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'subcommand' : '%s' % componentList[componentNumber][0] ,
+ 'objectType' : 'backend-name' ,
+ 'objectName' : server.backend ,
+ 'expectedRC' : 0
+ }
+ </call>
+ <else>
+ <call function="'dsconfig'">
+ {
+ 'dsInstanceHost' : server.host ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'subcommand' : '%s' % componentList[componentNumber][0] ,
+ 'expectedRC' : 0
+ }
+ </call>
+ </else>
+ </if>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : componentList[componentNumber][1] ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : componentList[componentNumber][2] }
+ </call>
+
+ <call function="'testCase_Postamble'" />
+ <script>
+ componentNumber=componentNumber+1
+ </script>
+ </sequence>
+ </testcase>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Dsconfig Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'">
+ { 'deleteSuffix' : False }
+ </call>
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_cleanup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_cleanup.xml
index 4fd11f0..72a1ee3 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_cleanup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_cleanup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -46,11 +46,9 @@
<sequence>
<if expr="stopDS == True">
- <block name="'Block DS Process Stop'">
- <!--- Stop DS -->
- <sequence>
+ <sequence>
<message>
- '------ Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
+ 'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
@@ -61,43 +59,21 @@
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
</call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
+ </sequence>
- </sequence>
- <!--- End Block DS Process Stop -->
- </block>
- </if>
-
+ </if>
+ <message>
+ 'Remove DS topology created for the Test Suite'
+ </message>
- <block name="'Block Remove DS Topology'">
- <!-- Remove the topology created for the test suite -->
- <sequence>
-
- <message>
- '------ Remove DS topology created for the Test Suite'
- </message>
+ <call function="'removeTopology'"/>
- <call function="'removeTopology'"/>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- </sequence>
- <!-- End Block Remove DS Topology-->
- </block>
-
-
- </sequence>
+ </sequence>
</block>
-
- </sequence>
+ </sequence>
+
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_dynamic.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_dynamic.xml
index 08513d7..94b1bd7 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_dynamic.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_dynamic.xml
@@ -23,463 +23,483 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="main_dynamicgroup"/>
+ <defaultcall function="dynamic"/>
- <function name="main_dynamicgroup">
+ <function name="dynamic">
<sequence>
- <block name="'dynamicgroup'">
-
- <sequence>
-
- <script>
- applicationDn='uid=my_application,dc=groups,dc=com'
- applicationPswd='pw_my_application'
- dynamicGroupDn='cn=my_dynamicgroup1,dc=groups,dc=com'
- newDynamicGroup='my_newDynamicGroup'
- newDynamicGroupDn='cn=%s,dc=groups,dc=com' % (newDynamicGroup)
- newDynamicGroupPswd='pw_%s' % (newDynamicGroup)
- user0='user_00'
- user0Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user0)
- user0Pswd='pw_00'
- user1='user_01'
- user1Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user1)
- user1Pswd='pw_01'
- user2='user_02'
- user2Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2)
- user2Pswd='pw_02'
- user2Add='user_22'
- user2AddDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2Add)
- user2AddPswd='pw_22'
- user2AddRenamed='%s_bis' % (user2Add)
- user2AddRenamedDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2AddRenamed)
- </script>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='groups'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Suite information
- #@TestSuiteName Group test suite
- #@TestSuitePurpose Test this feature
- #@TestSuiteID Groups Tests
- #@TestSuiteGroup Dynamic Group
- #@TestGroup Dynamic Group
- #@TestScript group_dynamic.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
+ <block name="'dynamic'">
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
-
- <call function="'group_setup'"> { 'startDS' : True } </call>
+ <try>
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: add a dynamic group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('add a dynamic group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <script>
- listAttr = []
- listAttr.append('cn:%s' % newDynamicGroup)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:groupofurls')
- listAttr.append('description:this is the description of %s' % newDynamicGroup)
- listAttr.append('memberurl:ldap:///ou=dynamic,dc=groups,dc=com??sub?(uid=*0*)')
- </script>
- <message>
- '++++ Application add group entry %s' % newDynamicGroupDn
- </message>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : newDynamicGroupDn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application do a search to check the entry has been created'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newDynamicGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uniquemember' }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user0Dn ,
- 'string2find' : newDynamicGroupDn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: delete a dynamic group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('delete a dynamic group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Delete the group entry %s' % newDynamicGroupDn
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newDynamicGroupDn,
- }
- </call>
- <message>
- '++++ Check the group entry %s no more exist' % newDynamicGroup
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newDynamicGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 32 }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user0Dn ,
- 'string2find' : newDynamicGroupDn ,
- 'nbExpected' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: no group user do a search
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('no group user do a search')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ %s search itself (should PASS as not a member of dynamic group)' % user1
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user1Dn ,
- 'dsInstancePswd' : user1Pswd ,
- 'dsBaseDN' : user1Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 0 }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn ,
- 'string2find' : dynamicGroupDn ,
- 'nbExpected' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: group user do a search
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('group user do a search')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ %s search itself (should be refused as dynamic group does not have the permission)' % user2
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user2Dn ,
- 'dsInstancePswd' : user2Pswd ,
- 'dsBaseDN' : user2Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user2Dn ,
- 'string2find' : dynamicGroupDn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: application add entry that belong to a group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('application add entry that belong to a group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application add a new user %s / %s ' % (user2AddDn,user2AddPswd)
- </message>
- <script>
- listAttr = []
- listAttr.append('uid:%s' % user2Add)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:person')
- listAttr.append('objectclass:inetOrgPerson')
- listAttr.append('cn:%s' % user2Add)
- listAttr.append('sn:sn of user %s' % user2Add)
- listAttr.append('description:this is the description of %s' % user2Add)
- listAttr.append('userPassword:%s' % user2AddPswd)
- </script>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : user2AddDn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ %s search itself (should be refused as dynamic group does not have permission)' % user2Add
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user2AddDn ,
- 'dsInstancePswd' : user2AddPswd ,
- 'dsBaseDN' : user2AddDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user2AddDn ,
- 'string2find' : dynamicGroupDn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: application rename entry that belong to a group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <!---
- <testcase name="getTestCaseName('application rename entry that belong to a group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application rename %s into %s ' % (user2Add,user2AddRenamed)
- </message>
-
- <call function="'modifyDn'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : user2AddDn ,
- 'newRDN' : user2AddRenamed,
- 'deleteOldRDN' : 1 }
- </call>
--->
- <!-- ******************** -->
-<!--
- <message>
- '++++ %s search itself (should be refused as dynamic group does not have permission)' % user2AddRenamed
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user2AddRenamedDn ,
- 'dsInstancePswd' : user2AddPswd ,
- 'dsBaseDN' : user2AddRenamedDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 0
- }
- </call>
--->
- <!-- ******************** -->
-<!--
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user2AddRenamedDn ,
- 'string2find' : dynamicGroupDn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
--->
-
- <!--- Test Case information
- #@TestMarker Dynamic Group Tests
- #@TestName Group: Dynamic: application delete entry belonging to a group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('application delete entry belonging to a group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application delete user %s' % user2Add
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : user2AddDn
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check the entry %s no more exist' % user2Add
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : user2AddDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'dn',
- 'expectedRC' : 32 }
- </call>
- <!-- ******************** -->
- <message>
- '++++ %s do a search (should fail)' % user2Add
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user2AddDn ,
- 'dsInstancePswd' : user2AddPswd ,
- 'dsBaseDN' : user2AddDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 49 }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
-
-
- <!-- *********************************************** -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'group_cleanup'"> { 'stopDS' : True } </call>
-
- <call function="'testSuite_Postamble'"/>
+ <sequence>
+
+ <script>
+ applicationDn='uid=my_application,dc=groups,dc=com'
+ applicationPswd='pw_my_application'
+ dynamicGroupDn='cn=my_dynamicgroup1,dc=groups,dc=com'
+ newDynamicGroup='my_newDynamicGroup'
+ newDynamicGroupDn='cn=%s,dc=groups,dc=com' % (newDynamicGroup)
+ newDynamicGroupPswd='pw_%s' % (newDynamicGroup)
+ user0='user_00'
+ user0Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user0)
+ user0Pswd='pw_00'
+ user1='user_01'
+ user1Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user1)
+ user1Pswd='pw_01'
+ user2='user_02'
+ user2Dn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2)
+ user2Pswd='pw_02'
+ user2Add='user_22'
+ user2AddDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2Add)
+ user2AddPswd='pw_22'
+ user2AddRenamed='%s_bis' % (user2Add)
+ user2AddRenamedDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2AddRenamed)
+ </script>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='groups'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!--- Test Suite information
+ #@TestSuiteName Group test suite
+ #@TestSuitePurpose Test this feature
+ #@TestSuiteID Groups Tests
+ #@TestSuiteGroup Dynamic Group
+ #@TestGroup Dynamic Group
+ #@TestScript group_dynamic.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- </sequence>
-
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/groups/groups.ldif' % remote.data
+ }
+ </call>
+
+ <call function="'group_setup'"/>
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: add a dynamic group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('add a dynamic group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ listAttr = []
+ listAttr.append('cn:%s' % newDynamicGroup)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:groupofurls')
+ listAttr.append('description:this is the description of %s' % newDynamicGroup)
+ listAttr.append('memberurl:ldap:///ou=dynamic,dc=groups,dc=com??sub?(uid=*0*)')
+ </script>
+ <message>
+ '++++ Application add group entry %s' % newDynamicGroupDn
+ </message>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : newDynamicGroupDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application do a search to check the entry has been created'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newDynamicGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uniquemember' }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user0Dn ,
+ 'string2find' : newDynamicGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: delete a dynamic group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('delete a dynamic group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Delete the group entry %s' % newDynamicGroupDn
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newDynamicGroupDn,
+ }
+ </call>
+ <message>
+ '++++ Check the group entry %s no more exist' % newDynamicGroup
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newDynamicGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 32 }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user0Dn ,
+ 'string2find' : newDynamicGroupDn ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: no group user do a search
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('no group user do a search')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ %s search itself (should PASS as not a member of dynamic group)' % user1
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user1Dn ,
+ 'dsInstancePswd' : user1Pswd ,
+ 'dsBaseDN' : user1Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn ,
+ 'string2find' : dynamicGroupDn ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: group user do a search
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('group user do a search')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ %s search itself (should be refused as dynamic group does not have the permission)' % user2
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user2Dn ,
+ 'dsInstancePswd' : user2Pswd ,
+ 'dsBaseDN' : user2Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user2Dn ,
+ 'string2find' : dynamicGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: application add entry that belong to a group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('application add entry that belong to a group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application add a new user %s / %s ' % (user2AddDn,user2AddPswd)
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('uid:%s' % user2Add)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:person')
+ listAttr.append('objectclass:inetOrgPerson')
+ listAttr.append('cn:%s' % user2Add)
+ listAttr.append('sn:sn of user %s' % user2Add)
+ listAttr.append('description:this is the description of %s' % user2Add)
+ listAttr.append('userPassword:%s' % user2AddPswd)
+ </script>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : user2AddDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ %s search itself (should be refused as dynamic group does not have permission)' % user2Add
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user2AddDn ,
+ 'dsInstancePswd' : user2AddPswd ,
+ 'dsBaseDN' : user2AddDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user2AddDn ,
+ 'string2find' : dynamicGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: application rename entry that belong to a group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <!---
+ <testcase name="getTestCaseName('application rename entry that belong to a group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application rename %s into %s ' % (user2Add,user2AddRenamed)
+ </message>
+
+ <call function="'modifyDn'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : user2AddDn ,
+ 'newRDN' : user2AddRenamed,
+ 'deleteOldRDN' : 1 }
+ </call>
+ -->
+ <!-- ******************** -->
+ <!--
+ <message>
+ '++++ %s search itself (should be refused as dynamic group does not have permission)' % user2AddRenamed
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user2AddRenamedDn ,
+ 'dsInstancePswd' : user2AddPswd ,
+ 'dsBaseDN' : user2AddRenamedDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 0
+ }
+ </call>
+ -->
+ <!-- ******************** -->
+ <!--
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user2AddRenamedDn ,
+ 'string2find' : dynamicGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Dynamic Group Tests
+ #@TestName Group: Dynamic: application delete entry belonging to a group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('application delete entry belonging to a group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application delete user %s' % user2Add
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : user2AddDn
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check the entry %s no more exist' % user2Add
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : user2AddDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'dn',
+ 'expectedRC' : 32 }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ %s do a search (should fail)' % user2Add
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user2AddDn ,
+ 'dsInstancePswd' : user2AddPswd ,
+ 'dsBaseDN' : user2AddDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 49 }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Groups Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_setup.xml
index fb2d498..f8b0ee4 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_setup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -44,75 +44,49 @@
</function-arg-description>
<function-arg-property name="type" value="boolean"/>
</function-arg-def>
+ <function-arg-def name="globalAcis" type="optional" default="True">
+ <function-arg-description>
+ Specifies whether the test should use global acis.
+ </function-arg-description>
+ <function-arg-property name="type" value="boolean"/>
+ </function-arg-def>
</function-map-args>
-
<sequence>
<block name="'setup'">
<sequence>
- <block name="'Block Create DS Topology'">
- <!-- Create the topology necessary to the test group/suite -->
- <sequence>
- <message>
- '------ Create DS topology as described in config.py'
- </message>
- <call function="'createTopology'">
- { 'initialiseInstance' : False }
- </call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- </sequence>
- <!--- End Block Create DS Topology -->
- </block>
+ <if expr="globalAcis == True">
- <if expr="loadBackend == True">
- <block name="'Block DS Load Data'">
- <!-- Load the data needed by the test suite -->
- <sequence>
- <message>
- '------ Load LDIF : groups.ldif'
- </message>
- <call function="'importLdif'">
- { 'ldifFile' : '%s/groups/groups.ldif' % remote.data }
- </call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- </sequence>
- <!--- End Block DS Load Data -->
- </block>
+ <sequence>
+ <message>'Adding global ACIs.'</message>
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : '%s/groups/global_acis.ldif' % remote.data
+ }
+ </call>
+ </sequence>
+ <else>
+ <sequence>
+ <message>'Adding entry ACIs.'</message>
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : '%s/groups/entry_acis.ldif' % remote.data
+ }
+ </call>
+ </sequence>
+ </else>
</if>
-
- <if expr="startDS == True">
- <block name="'Block DS Process Active'">
- <!--- Start DS -->
- <sequence>
- <message>
- '------ Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
- </message>
- <!--- Start DS -->
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
- </sequence>
- <!--- End Block DS Process Active -->
- </block>
- </if>
+
</sequence>
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_member.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_member.xml
index 9b5cb67..fe383c7 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_member.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_member.xml
@@ -23,797 +23,816 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="main_staticgroup_member"/>
+ <defaultcall function="static_member"/>
- <function name="main_staticgroup_member">
+ <function name="static_member">
<sequence>
- <block name="'staticgroup_member'">
-
- <sequence>
-
- <script>
- applicationDn='uid=my_application,dc=groups,dc=com'
- applicationPswd='pw_my_application'
- staticGroup2Dn='cn=my_staticgroup2,dc=groups,dc=com'
- staticGroup3Dn='cn=my_staticgroup3,dc=groups,dc=com'
- newStaticGroup='my_newStaticGroup'
- newStaticGroupDn='cn=%s,dc=groups,dc=com' % (newStaticGroup)
- newStaticGroupPswd='pw_%s' % (newStaticGroup)
- user1='user_01'
- user1Dn='uid=%s,ou=static,dc=groups,dc=com' % (user1)
- user1Pswd='pw_01'
- user2='user_02'
- user2Dn='uid=%s,ou=static,dc=groups,dc=com' % (user2)
- user2Pswd='pw_02'
- user11='user_11'
- user11Dn='uid=%s,ou=static,dc=groups,dc=com' % (user11)
- user11Pswd='pw_11'
+ <block name="'static_member'">
+ <try>
+ <sequence>
- </script>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='groups'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Suite information
- #@TestSuiteName Static group test suite
- #@TestSuitePurpose Test this feature
- #@TestSuiteID Groups Tests
- #@TestSuiteGroup staticgroup
- #@TestGroup Groups
- #@TestScript group_static.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
-
- <call function="'group_setup'"> { 'startDS' : True } </call>
-
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: member add a static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member add a static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <script>
- listAttr = []
- listAttr.append('cn:%s' % newStaticGroup)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:groupofnames')
- listAttr.append('description:this is the description of %s' % newStaticGroup)
- listAttr.append('member:%s' % user11Dn)
- </script>
- <message>
- '++++ Application add group entry %s' % newStaticGroup
- </message>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : newStaticGroupDn,
- 'listAttributes' : listAttr
- }
- </call>
- <message>
- '++++ Application do a search to check the entry has been created'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newStaticGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check the search return entry %s' % user11Dn
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : newStaticGroupDn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: member delete a static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member delete a static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Delete the group entry %s' % newStaticGroup
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newStaticGroupDn,
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check the group entry %s no more exist' % newStaticGroup
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newStaticGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member',
- 'expectedRC' : 32 }
- </call>
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : newStaticGroupDn ,
- 'nbExpected' : 0
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: member ldapsearch out of the group
- #@TestID search in group
- #@TestPurpose user of group search members of its group
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member ldapsearch out of the group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ user %s, not member of the group, do a search, should pass' % user11
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user11Dn ,
- 'dsInstancePswd' : user11Pswd ,
- 'dsBaseDN' : user11Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0 }
- </call>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 2
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: member ldapsearch through group
- #@TestID search in group
- #@TestPurpose user of group search members of its group
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member ldapsearch through group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ user %s, member of the group do a search, should be denied has group have no permission' % user1
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user1Dn ,
- 'dsInstancePswd' : user1Pswd ,
- 'dsBaseDN' : user1Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0 }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check the search return nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 0
- }
- </call>
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn ,
- 'string2find' : staticGroup2Dn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: member application search in group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member application search in group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- '++++ Application do a search on static group, should work'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : staticGroup2Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <script>
- STAXReason = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result return 10 entries'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'member' ,
- 'mainString' : STAXReason ,
- 'nbExpected' : 10
- }
- </call>
+ <script>
+ applicationDn='uid=my_application,dc=groups,dc=com'
+ applicationPswd='pw_my_application'
+ staticGroup2Dn='cn=my_staticgroup2,dc=groups,dc=com'
+ staticGroup3Dn='cn=my_staticgroup3,dc=groups,dc=com'
+ newStaticGroup='my_newStaticGroup'
+ newStaticGroupDn='cn=%s,dc=groups,dc=com' % (newStaticGroup)
+ newStaticGroupPswd='pw_%s' % (newStaticGroup)
+ user1='user_01'
+ user1Dn='uid=%s,ou=static,dc=groups,dc=com' % (user1)
+ user1Pswd='pw_01'
+ user2='user_02'
+ user2Dn='uid=%s,ou=static,dc=groups,dc=com' % (user2)
+ user2Pswd='pw_02'
+ user11='user_11'
+ user11Dn='uid=%s,ou=static,dc=groups,dc=com' % (user11)
+ user11Pswd='pw_11'
+
+ </script>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='groups'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: member application add user in group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member application add user in group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- '++++ Application add a new user %s / %s into the static group' % (user11Dn,user11Pswd)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : staticGroup2Dn ,
- 'changetype' : 'add' ,
- 'attributeName' : 'member' ,
- 'newAttributeValue' : user11Dn
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users through the static group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : staticGroup2Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <script>
- STAXCode = RC
- ldapSearchResult = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result return the new entry uid'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check added user %s has no more privileges' % user11
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user11Dn ,
- 'dsInstancePswd' : user11Pswd ,
- 'dsBaseDN' : user11Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search return nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : staticGroup2Dn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: member delete user entry belonging to the group
- #@TestID
- #@TestPurpose
- #@TestPreamble previous testcase must be run before this one
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member delete user entry belonging to the group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <!-- ******************** -->
- <message>
- '++++ Application delete the user entry that belong to the static group'
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : user11Dn,
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users through the static group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : staticGroup2Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <script>
- STAXCode = RC
- ldapSearchResult = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result still returns the deleted entry uid as referential integrity plugin is disabled'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result returns 11 entries'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'member' ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 11
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Add the deleted entry'
- </message>
- <script>
- listAttr = []
- listAttr.append('uid:%s' % user11)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:person')
- listAttr.append('objectclass:inetOrgPerson')
- listAttr.append('cn:%s' % user11)
- listAttr.append('sn:sn of user %s' % user11)
- listAttr.append('description:this is the description of %s' % user11)
- listAttr.append('userPassword:%s' % user11Pswd)
- </script>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : user11Dn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : staticGroup2Dn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: member application delete user from group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member application delete user from group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- '++++ Application delete attribute member:%s from the static group' % user11
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : staticGroup2Dn ,
- 'changetype' : 'delete' ,
- 'attributeName' : 'member',
- 'newAttributeValue' : user11Dn }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users through the static group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : staticGroup2Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <script>
- ldapSearchResult = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result should not returns the deleted group entry'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ User %s should now be able to do search' % user11
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : user11Dn ,
- 'dsInstancePswd' : user11Pswd ,
- 'dsBaseDN' : user11Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns entry'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : staticGroup2Dn ,
- 'nbExpected' : 0
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: member delete all attributes in a static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('member delete all attributes in a static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <!-- ******************** -->
- <message>
- '++++ Create a static group entry %s' % newStaticGroupDn
- </message>
- <script>
- listAttr = []
- listAttr.append('cn:%s' % newStaticGroup)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:groupofnames')
- listAttr.append('description:this is the description of %s' % newStaticGroup)
- listAttr.append('member:%s' % user1Dn)
- listAttr.append('member:%s' % user2Dn)
- listAttr.append('member:%s' % user11Dn)
- </script>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : newStaticGroupDn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Delete all attributes of the group entry'
- </message>
- <script>
- listAttr = []
- listAttr.append('member:%s' % user1Dn)
- listAttr.append('member:%s' % user2Dn)
- listAttr.append('member:%s' % user11Dn)
- </script>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : newStaticGroupDn ,
- 'changetype' : 'delete' ,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Do a search on the group, should return no user entries'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newStaticGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <script>
- STAXCode = RC
- ldapSearchResult = STAXResult[0][1]
- </script>
- <call function="'CheckMatches'">
- { 'string2find' : 'member' ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn ,
- 'string2find' : staticGroup2Dn ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn ,
- 'string2find' : newStaticGroupDn ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Delete the group entry created'
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newStaticGroupDn
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: member enable referential integrity plugin
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <!--
- <testcase name="getTestCaseName('member enable referential integrity plugin')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ referential integrity plugin not yet implemented in opendDS'
- </message>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
- -->
-
-
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: member nesting group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName
- ('member application search in nesting group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- '++++ Application do a search on static nesting group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : staticGroup3Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'member' }
- </call>
- <script>
- STAXReason = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result return 1 entry'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'member' ,
- 'mainString' : STAXReason ,
- 'nbExpected' : 1
- }
- </call>
-
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn ,
- 'string2find' : staticGroup3Dn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!-- *********************************************** -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'group_cleanup'"> { 'stopDS' : True } </call>
-
- <call function="'testSuite_Postamble'"/>
+ <call function="'testSuite_Preamble'"/>
+
+ <!--- Test Suite information
+ #@TestSuiteName Static group test suite
+ #@TestSuitePurpose Test this feature
+ #@TestSuiteID Groups Tests
+ #@TestSuiteGroup staticgroup
+ #@TestGroup Groups
+ #@TestScript group_static.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- </sequence>
-
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/groups/groups.ldif' % remote.data
+ }
+ </call>
+
+ <call function="'group_setup'"/>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: member add a static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member add a static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ listAttr = []
+ listAttr.append('cn:%s' % newStaticGroup)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:groupofnames')
+ listAttr.append('description:this is the description of %s' % newStaticGroup)
+ listAttr.append('member:%s' % user11Dn)
+ </script>
+ <message>
+ '++++ Application add group entry %s' % newStaticGroup
+ </message>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : newStaticGroupDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <message>
+ '++++ Application do a search to check the entry has been created'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newStaticGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check the search return entry %s' % user11Dn
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : newStaticGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: member delete a static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member delete a static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Delete the group entry %s' % newStaticGroup
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newStaticGroupDn,
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check the group entry %s no more exist' % newStaticGroup
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newStaticGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member',
+ 'expectedRC' : 32 }
+ </call>
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : newStaticGroupDn ,
+ 'nbExpected' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: member ldapsearch out of the group
+ #@TestID search in group
+ #@TestPurpose user of group search members of its group
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member ldapsearch out of the group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ user %s, not member of the group, do a search, should pass' % user11
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user11Dn ,
+ 'dsInstancePswd' : user11Pswd ,
+ 'dsBaseDN' : user11Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 2
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: member ldapsearch through group
+ #@TestID search in group
+ #@TestPurpose user of group search members of its group
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member ldapsearch through group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ user %s, member of the group do a search, should be denied has group have no permission' % user1
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user1Dn ,
+ 'dsInstancePswd' : user1Pswd ,
+ 'dsBaseDN' : user1Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0 }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check the search return nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn ,
+ 'string2find' : staticGroup2Dn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: member application search in group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member application search in group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ '++++ Application do a search on static group, should work'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : staticGroup2Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <script>
+ STAXReason = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result return 10 entries'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'member' ,
+ 'mainString' : STAXReason ,
+ 'nbExpected' : 10
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: member application add user in group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member application add user in group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ '++++ Application add a new user %s / %s into the static group' % (user11Dn,user11Pswd)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : staticGroup2Dn ,
+ 'changetype' : 'add' ,
+ 'attributeName' : 'member' ,
+ 'newAttributeValue' : user11Dn
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users through the static group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : staticGroup2Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <script>
+ STAXCode = RC
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result return the new entry uid'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check added user %s has no more privileges' % user11
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user11Dn ,
+ 'dsInstancePswd' : user11Pswd ,
+ 'dsBaseDN' : user11Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search return nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : staticGroup2Dn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: member delete user entry belonging to the group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble previous testcase must be run before this one
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member delete user entry belonging to the group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!-- ******************** -->
+ <message>
+ '++++ Application delete the user entry that belong to the static group'
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : user11Dn,
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users through the static group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : staticGroup2Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <script>
+ STAXCode = RC
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result still returns the deleted entry uid as referential integrity plugin is disabled'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result returns 11 entries'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'member' ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 11
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Add the deleted entry'
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('uid:%s' % user11)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:person')
+ listAttr.append('objectclass:inetOrgPerson')
+ listAttr.append('cn:%s' % user11)
+ listAttr.append('sn:sn of user %s' % user11)
+ listAttr.append('description:this is the description of %s' % user11)
+ listAttr.append('userPassword:%s' % user11Pswd)
+ </script>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : user11Dn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : staticGroup2Dn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: member application delete user from group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member application delete user from group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ '++++ Application delete attribute member:%s from the static group' % user11
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : staticGroup2Dn ,
+ 'changetype' : 'delete' ,
+ 'attributeName' : 'member',
+ 'newAttributeValue' : user11Dn }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users through the static group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : staticGroup2Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <script>
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result should not returns the deleted group entry'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ User %s should now be able to do search' % user11
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : user11Dn ,
+ 'dsInstancePswd' : user11Pswd ,
+ 'dsBaseDN' : user11Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns entry'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : staticGroup2Dn ,
+ 'nbExpected' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: member delete all attributes in a static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('member delete all attributes in a static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!-- ******************** -->
+ <message>
+ '++++ Create a static group entry %s' % newStaticGroupDn
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('cn:%s' % newStaticGroup)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:groupofnames')
+ listAttr.append('description:this is the description of %s' % newStaticGroup)
+ listAttr.append('member:%s' % user1Dn)
+ listAttr.append('member:%s' % user2Dn)
+ listAttr.append('member:%s' % user11Dn)
+ </script>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : newStaticGroupDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Delete all attributes of the group entry'
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('member:%s' % user1Dn)
+ listAttr.append('member:%s' % user2Dn)
+ listAttr.append('member:%s' % user11Dn)
+ </script>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : newStaticGroupDn ,
+ 'changetype' : 'delete' ,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Do a search on the group, should return no user entries'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newStaticGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <script>
+ STAXCode = RC
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'member' ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn ,
+ 'string2find' : staticGroup2Dn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn ,
+ 'string2find' : newStaticGroupDn ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Delete the group entry created'
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newStaticGroupDn
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: member enable referential integrity plugin
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <!--
+ <testcase name="getTestCaseName('member enable referential integrity plugin')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ referential integrity plugin not yet implemented in opendDS'
+ </message>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ -->
+
+
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: member nesting group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName
+ ('member application search in nesting group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ '++++ Application do a search on static nesting group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : staticGroup3Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'member' }
+ </call>
+ <script>
+ STAXReason = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result return 1 entry'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'member' ,
+ 'mainString' : STAXReason ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn ,
+ 'string2find' : staticGroup3Dn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Groups Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_uniquemember.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_uniquemember.xml
index a02b921..a8a5cda 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_uniquemember.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_static_uniquemember.xml
@@ -23,717 +23,741 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="main_staticgroup_uniquemember"/>
- <function name="main_staticgroup_uniquemember">
+ <defaultcall function="static_uniquemember"/>
+ <function name="static_uniquemember">
<sequence>
- <block name="'staticgroup_uniquemember'">
- <sequence>
- <script>
- applicationDn='uid=my_application,dc=groups,dc=com'
- applicationPswd='pw_my_application'
- staticGroup1Dn='cn=my_staticgroup1,dc=groups,dc=com'
- newStaticGroup='my_newStaticGroup'
- newStaticGroupDn='cn=%s,dc=groups,dc=com' % (newStaticGroup)
- newStaticGroupPswd='pw_%s' % (newStaticGroup)
- user1='user_01'
- user1Dn='uid=%s,ou=static,dc=groups,dc=com' % (user1)
- user1Pswd='pw_01'
- user2='user_02'
- user2Dn='uid=%s,ou=static,dc=groups,dc=com' % (user2)
- user2Pswd='pw_02'
- user11='user_11'
- user11Dn='uid=%s,ou=static,dc=groups,dc=com' % (user11)
- user11Pswd='pw_11'
- </script>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='groups'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Suite information
- #@TestSuiteName Static group test suite
- #@TestSuitePurpose Test this feature
- #@TestSuiteID Groups Tests
- #@TestSuiteGroup staticgroup
- #@TestGroup Groups
- #@TestScript group_static.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
-
- <call function="'group_setup'"> { 'startDS' : True } </call>
-
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: uniquemember add a static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember add a static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
+ <block name="'static_uniquemember'">
+ <try>
+ <sequence>
+ <script>
+ applicationDn='uid=my_application,dc=groups,dc=com'
+ applicationPswd='pw_my_application'
+ staticGroup1Dn='cn=my_staticgroup1,dc=groups,dc=com'
+ newStaticGroup='my_newStaticGroup'
+ newStaticGroupDn='cn=%s,dc=groups,dc=com' % (newStaticGroup)
+ newStaticGroupPswd='pw_%s' % (newStaticGroup)
+ user1='user_01'
+ user1Dn='uid=%s,ou=static,dc=groups,dc=com' % (user1)
+ user1Pswd='pw_01'
+ user2='user_02'
+ user2Dn='uid=%s,ou=static,dc=groups,dc=com' % (user2)
+ user2Pswd='pw_02'
+ user11='user_11'
+ user11Dn='uid=%s,ou=static,dc=groups,dc=com' % (user11)
+ user11Pswd='pw_11'
+ </script>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='groups'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!--- Test Suite information
+ #@TestSuiteName Static group test suite
+ #@TestSuitePurpose Test this feature
+ #@TestSuiteID Groups Tests
+ #@TestSuiteGroup staticgroup
+ #@TestGroup Groups
+ #@TestScript group_static.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- <script>
- listAttr = []
- listAttr.append('cn:%s' % newStaticGroup)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:groupofuniquenames')
- listAttr.append('description:this is the description of %s' % newStaticGroup)
- listAttr.append('uniquemember:%s' % user11Dn)
- </script>
- <message>
- '++++ Application add group entry %s' % newStaticGroup
- </message>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'DNToAdd' : newStaticGroupDn,
- 'listAttributes' : listAttr
- }
- </call>
- <message>
- '++++ Application do a search to check the entry has been created'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : newStaticGroupDn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uniquemember'
- }
- </call>
- <message>
- '++++ Check the search return entry %s' % user11Dn
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : newStaticGroupDn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: uniquemember delete a static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember delete a static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Delete the group entry %s' % newStaticGroup
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newStaticGroupDn,
- }
- </call>
- <message>
- '++++ Check the group entry %s no more exist' % newStaticGroup
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : newStaticGroupDn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uniquemember',
- 'expectedRC' : 32
- }
- </call>
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : newStaticGroupDn,
- 'nbExpected' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/groups/groups.ldif' % remote.data
+ }
+ </call>
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: uniquemember ldapsearch out of the group
- #@TestID search in group
- #@TestPurpose user of group search members of its group
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember ldapsearch out of the group')">
+ <call function="'group_setup'"/>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: uniquemember add a static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember add a static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ listAttr = []
+ listAttr.append('cn:%s' % newStaticGroup)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:groupofuniquenames')
+ listAttr.append('description:this is the description of %s' % newStaticGroup)
+ listAttr.append('uniquemember:%s' % user11Dn)
+ </script>
+ <message>
+ '++++ Application add group entry %s' % newStaticGroup
+ </message>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'DNToAdd' : newStaticGroupDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <message>
+ '++++ Application do a search to check the entry has been created'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : newStaticGroupDn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uniquemember'
+ }
+ </call>
+ <message>
+ '++++ Check the search return entry %s' % user11Dn
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : newStaticGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: uniquemember delete a static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember delete a static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Delete the group entry %s' % newStaticGroup
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newStaticGroupDn,
+ }
+ </call>
+ <message>
+ '++++ Check the group entry %s no more exist' % newStaticGroup
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : newStaticGroupDn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uniquemember',
+ 'expectedRC' : 32
+ }
+ </call>
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : newStaticGroupDn,
+ 'nbExpected' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: uniquemember ldapsearch out of the group
+ #@TestID search in group
+ #@TestPurpose user of group search members of its group
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember ldapsearch out of the group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ user %s, not member of the group, do a search, should pass' % user11
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : user11Dn,
+ 'dsInstancePswd' : user11Pswd,
+ 'dsBaseDN' : user11Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid' ,
+ 'mainString' : STAXResult[0][1],
+ 'nbExpected' : 2
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: uniquemember ldapsearch through group
+ #@TestID search in group
+ #@TestPurpose user of group search members of its group
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember ldapsearch through group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ user %s, member of the group do a search, should be denied has group have no permission' % user1
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : user1Dn,
+ 'dsInstancePswd' : user1Pswd,
+ 'dsBaseDN' : user1Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '++++ Check the search return nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn',
+ 'mainString' : STAXResult[0][1],
+ 'nbExpected' : 0
+ }
+ </call>
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn ,
+ 'string2find' : staticGroup1Dn,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: uniquemember application search in group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember application search in group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application do a search on static group, should work'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : staticGroup1Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uniquemember'
+ }
+ </call>
+ <script>
+ STAXReason = STAXResult[0][1]
+ </script>
+
+ <message>
+ '++++ Check ldapsearch result return 10 entries'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uniquemember',
+ 'mainString' : STAXReason,
+ 'caseSensitive' : False,
+ 'nbExpected' : 10
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: uniquemember application add user in group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember application add user in group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application add a new user %s / %s into the static group' % (user11Dn,user11Pswd)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'DNToModify' : staticGroup1Dn,
+ 'changetype' : 'add',
+ 'attributeName' : 'uniquemember',
+ 'newAttributeValue' : user11Dn
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users through the static group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : staticGroup1Dn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uniquemember'
+ }
+ </call>
+ <script>
+ STAXCode = RC
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result returns the new entry uid'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check added user %s has no more privileges' % user11
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : user11Dn,
+ 'dsInstancePswd' : user11Pswd,
+ 'dsBaseDN' : user11Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '++++ Check the search returns nothing'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn',
+ 'mainString' : STAXResult[0][1],
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : staticGroup1Dn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: uniquemember delete user entry belonging to the group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble previous testcase must be run before this one
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember delete user entry belonging to the group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <!-- ******************** -->
+ <message>
+ '++++ Application delete the user entry that belong to the static group'
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : user11Dn,
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users through the static group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : staticGroup1Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uniquemember'
+ }
+ </call>
+ <script>
+ STAXCode = RC
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result still returns the deleted entry uid as referential integrity plugin is disabled'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn,
+ 'mainString' : ldapSearchResult,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result returns 11 entries'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uniquemember',
+ 'mainString' : ldapSearchResult,
+ 'caseSensitive' : False,
+ 'nbExpected' : 11
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Add the deleted entry'
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('uid:%s' % user11)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:person')
+ listAttr.append('objectclass:inetOrgPerson')
+ listAttr.append('cn:%s' % user11)
+ listAttr.append('sn:sn of user %s' % user11)
+ listAttr.append('description:this is the description of %s' % user11)
+ listAttr.append('userPassword:%s' % user11Pswd)
+ </script>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'DNToAdd' : user11Dn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn,
+ 'string2find' : staticGroup1Dn,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: uniquemember application delete user from group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember application delete user from group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application delete attribute uniquemember:%s from the static group' % user11
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'DNToModify' : staticGroup1Dn,
+ 'changetype' : 'delete',
+ 'attributeName' : 'uniquemember',
+ 'newAttributeValue' : user11Dn
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users through the static group'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : staticGroup1Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uniquemember'
+ }
+ </call>
+ <script>
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check ldapsearch result should not returns the deleted group entry'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user11Dn,
+ 'mainString' : ldapSearchResult,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ User %s should now be able to do search' % user11
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : user11Dn,
+ 'dsInstancePswd' : user11Pswd,
+ 'dsBaseDN' : user11Dn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uid',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '++++ Check the search returns entry'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'dn',
+ 'mainString' : STAXResult[0][1],
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user11Dn ,
+ 'string2find' : staticGroup1Dn ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Static Group Tests
+ #@TestName Group: Static: uniquemember delete all attributes in a static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('uniquemember delete all attributes in a static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <!-- ******************** -->
+ <message>
+ '++++ Create a static group entry %s' % newStaticGroupDn
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('cn:%s' % newStaticGroup)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:groupofuniquenames')
+ listAttr.append('description:this is the description of %s' % newStaticGroup)
+ listAttr.append('uniquemember:%s' % user1Dn)
+ listAttr.append('uniquemember:%s' % user2Dn)
+ listAttr.append('uniquemember:%s' % user11Dn)
+ </script>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'DNToAdd' : newStaticGroupDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Delete all attributes of the group entry'
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('uniquemember:%s' % user1Dn)
+ listAttr.append('uniquemember:%s' % user2Dn)
+ listAttr.append('uniquemember:%s' % user11Dn)
+ </script>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'DNToModify' : newStaticGroupDn,
+ 'changetype' : 'delete',
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Do a search on the group, should return no user entries'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : newStaticGroupDn,
+ 'dsFilter' : 'objectclass=*',
+ 'dsAttributes' : 'uniquemember'
+ }
+ </call>
+ <script>
+ STAXCode = RC
+ ldapSearchResult = STAXResult[0][1]
+ </script>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uniquemember',
+ 'mainString' : ldapSearchResult,
+ 'caseSensitive' : False,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn,
+ 'string2find' : staticGroup1Dn,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user1Dn,
+ 'string2find' : newStaticGroupDn,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Delete the group entry created'
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host,
+ 'dsInstancePort' : server.port,
+ 'dsInstanceDn' : applicationDn,
+ 'dsInstancePswd' : applicationPswd,
+ 'dsBaseDN' : newStaticGroupDn
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Group StaticGroup Tests
+ #@TestName Group: Static: uniquemember enable referential integrity plugin
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <!--
+ <testcase name="getTestCaseName('uniquemember enable referential integrity plugin')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ referential integrity plugin not yet implemented in opendDS'
+ </message>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ -->
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ user %s, not member of the group, do a search, should pass' % user11
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : user11Dn,
- 'dsInstancePswd' : user11Pswd,
- 'dsBaseDN' : user11Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0
- }
- </call>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid' ,
- 'mainString' : STAXResult[0][1],
- 'nbExpected' : 2
- }
- </call>
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Groups Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: uniquemember ldapsearch through group
- #@TestID search in group
- #@TestPurpose user of group search members of its group
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember ldapsearch through group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ user %s, member of the group do a search, should be denied has group have no permission' % user1
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : user1Dn,
- 'dsInstancePswd' : user1Pswd,
- 'dsBaseDN' : user1Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '++++ Check the search return nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn',
- 'mainString' : STAXResult[0][1],
- 'nbExpected' : 0
- }
- </call>
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn ,
- 'string2find' : staticGroup1Dn,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: uniquemember application search in group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember application search in group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application do a search on static group, should work'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : staticGroup1Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uniquemember'
- }
- </call>
- <script>
- STAXReason = STAXResult[0][1]
- </script>
-
- <message>
- '++++ Check ldapsearch result return 10 entries'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'uniquemember',
- 'mainString' : STAXReason,
- 'caseSensitive' : False,
- 'nbExpected' : 10
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: uniquemember application add user in group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember application add user in group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application add a new user %s / %s into the static group' % (user11Dn,user11Pswd)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'DNToModify' : staticGroup1Dn,
- 'changetype' : 'add',
- 'attributeName' : 'uniquemember',
- 'newAttributeValue' : user11Dn
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users through the static group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : staticGroup1Dn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uniquemember'
- }
- </call>
- <script>
- STAXCode = RC
- ldapSearchResult = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result returns the new entry uid'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check added user %s has no more privileges' % user11
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : user11Dn,
- 'dsInstancePswd' : user11Pswd,
- 'dsBaseDN' : user11Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '++++ Check the search returns nothing'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn',
- 'mainString' : STAXResult[0][1],
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : staticGroup1Dn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: uniquemember delete user entry belonging to the group
- #@TestID
- #@TestPurpose
- #@TestPreamble previous testcase must be run before this one
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember delete user entry belonging to the group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <!-- ******************** -->
- <message>
- '++++ Application delete the user entry that belong to the static group'
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : user11Dn,
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users through the static group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : staticGroup1Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uniquemember'
- }
- </call>
- <script>
- STAXCode = RC
- ldapSearchResult = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result still returns the deleted entry uid as referential integrity plugin is disabled'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn,
- 'mainString' : ldapSearchResult,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result returns 11 entries'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'uniquemember',
- 'mainString' : ldapSearchResult,
- 'caseSensitive' : False,
- 'nbExpected' : 11
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Add the deleted entry'
- </message>
- <script>
- listAttr = []
- listAttr.append('uid:%s' % user11)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:person')
- listAttr.append('objectclass:inetOrgPerson')
- listAttr.append('cn:%s' % user11)
- listAttr.append('sn:sn of user %s' % user11)
- listAttr.append('description:this is the description of %s' % user11)
- listAttr.append('userPassword:%s' % user11Pswd)
- </script>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'DNToAdd' : user11Dn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn,
- 'string2find' : staticGroup1Dn,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: uniquemember application delete user from group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember application delete user from group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application delete attribute uniquemember:%s from the static group' % user11
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'DNToModify' : staticGroup1Dn,
- 'changetype' : 'delete',
- 'attributeName' : 'uniquemember',
- 'newAttributeValue' : user11Dn
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users through the static group'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : staticGroup1Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uniquemember'
- }
- </call>
- <script>
- ldapSearchResult = STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check ldapsearch result should not returns the deleted group entry'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user11Dn,
- 'mainString' : ldapSearchResult,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ User %s should now be able to do search' % user11
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : user11Dn,
- 'dsInstancePswd' : user11Pswd,
- 'dsBaseDN' : user11Dn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uid',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '++++ Check the search returns entry'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'dn',
- 'mainString' : STAXResult[0][1],
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user11Dn ,
- 'string2find' : staticGroup1Dn ,
- 'nbExpected' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Static Group Tests
- #@TestName Group: Static: uniquemember delete all attributes in a static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('uniquemember delete all attributes in a static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <!-- ******************** -->
- <message>
- '++++ Create a static group entry %s' % newStaticGroupDn
- </message>
- <script>
- listAttr = []
- listAttr.append('cn:%s' % newStaticGroup)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:groupofuniquenames')
- listAttr.append('description:this is the description of %s' % newStaticGroup)
- listAttr.append('uniquemember:%s' % user1Dn)
- listAttr.append('uniquemember:%s' % user2Dn)
- listAttr.append('uniquemember:%s' % user11Dn)
- </script>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'DNToAdd' : newStaticGroupDn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Delete all attributes of the group entry'
- </message>
- <script>
- listAttr = []
- listAttr.append('uniquemember:%s' % user1Dn)
- listAttr.append('uniquemember:%s' % user2Dn)
- listAttr.append('uniquemember:%s' % user11Dn)
- </script>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'DNToModify' : newStaticGroupDn,
- 'changetype' : 'delete',
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Do a search on the group, should return no user entries'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : newStaticGroupDn,
- 'dsFilter' : 'objectclass=*',
- 'dsAttributes' : 'uniquemember'
- }
- </call>
- <script>
- STAXCode = RC
- ldapSearchResult = STAXResult[0][1]
- </script>
- <call function="'CheckMatches'">
- { 'string2find' : 'uniquemember',
- 'mainString' : ldapSearchResult,
- 'caseSensitive' : False,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn,
- 'string2find' : staticGroup1Dn,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user1Dn,
- 'string2find' : newStaticGroupDn,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Delete the group entry created'
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : applicationDn,
- 'dsInstancePswd' : applicationPswd,
- 'dsBaseDN' : newStaticGroupDn
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Group StaticGroup Tests
- #@TestName Group: Static: uniquemember enable referential integrity plugin
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <!--
- <testcase name="getTestCaseName('uniquemember enable referential integrity plugin')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ referential integrity plugin not yet implemented in opendDS'
- </message>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
- -->
-
- <!-- *********************************************** -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'group_cleanup'"> { 'stopDS' : True } </call>
- <call function="'testSuite_Postamble'"/>
- </sequence>
+ </finally>
+
+ </try>
</block>
</sequence>
</function>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_virtual_static.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_virtual_static.xml
index 593819a..49d0e7f 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_virtual_static.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/group_virtual_static.xml
@@ -23,717 +23,732 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="main_virtualStaticGroup"/>
+ <defaultcall function="virtual_static"/>
- <function name="main_virtualStaticGroup">
+ <function name="virtual_static">
<sequence>
- <block name="'virtualStaticGroup'">
-
- <sequence>
-
- <script>
- applicationDn='uid=my_application,dc=groups,dc=com'
- applicationPswd='pw_my_application'
- dynamicGroupDn='cn=my_dynamicgroup1,dc=groups,dc=com'
- virtualStaticGroupDn='cn=my_virtualstaticgroup,dc=groups,dc=com'
- newVirtualStaticGroup='my_newVirtualStaticGroup'
- newVirtualStaticGroupDn='cn=%s,dc=groups,dc=com' % (newVirtualStaticGroup)
- newVirtualStaticGroupPswd='pw_%s' % (newVirtualStaticGroup)
- user2Add='user_22'
- user2AddDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2Add)
- user2AddPswd='pw_22'
- user2AddRenamed='%s_bis' % (user2Add)
- user2AddRenamedDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2AddRenamed)
- </script>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='groups'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Suite information
- #@TestSuiteName Group test suite
- #@TestSuitePurpose Test this feature
- #@TestSuiteID Groups Tests
- #@TestSuiteGroup Virtual Static Group
- #@TestGroup Virtual Static Group
- #@TestScript group_virtual_static.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
-
- <call function="'group_setup'"> { 'startDS' : True } </call>
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: enable member virtual attribute
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('enable member virtual attribute')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Virtual Static uniqueMember,cn=Virtual Attributes,cn=config' ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-cfg-allow-retrieving-membership' ,
- 'newAttributeValue' : 'true'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: add a Virtual Static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('add a Virtual Static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <script>
- listAttr = []
- listAttr.append('cn:%s' % newVirtualStaticGroup)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:groupOfUniqueNames')
- listAttr.append('objectclass:ds-virtual-static-group')
- listAttr.append('description:this is the description of %s' % newVirtualStaticGroup)
- listAttr.append('ds-target-group-dn:%s' % dynamicGroupDn)
-
- </script>
- <message>
- '++++ Application add group entry %s' % newVirtualStaticGroupDn
- </message>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : newVirtualStaticGroupDn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application do a search to check the entry has been created'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newVirtualStaticGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'dsAttributes' : 'uniquemember' }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
- 'string2find' : newVirtualStaticGroupDn ,
- 'nbExpected' : 1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: delete a Virtual Static group entry
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('delete a Virtual Static group entry')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Delete the group entry %s' % newVirtualStaticGroupDn
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newVirtualStaticGroupDn,
- }
- </call>
- <message>
- '++++ Check the group entry %s no more exist' % newVirtualStaticGroup
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : newVirtualStaticGroupDn ,
- 'dsFilter' : 'objectclass=*' ,
- 'expectedRC' : 32 }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
- 'string2find' : newVirtualStaticGroupDn ,
- 'nbExpected' : 0
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: search members of group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('search members of group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Search members of group %s' % virtualStaticGroupDn
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <script>
- ldapSearchResult=STAXResult[0][1]
- </script>
- <!-- ******************** -->
- <message>
- '++++ Check uid=user_01,ou=dynamic,dc=groups,dc=com is NOT a group member'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_01,ou=dynamic,dc=groups,dc=com' ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 0
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check uid=user_02,ou=dynamic,dc=groups,dc=com is a group member'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Check uid=user_12,ou=dynamic,dc=groups,dc=com is a group member'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_12,ou=dynamic,dc=groups,dc=com' ,
- 'mainString' : ldapSearchResult ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: application add entry that belong to a group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('application add entry that belong to a group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application add a new user %s / %s ' % (user2AddDn,user2AddPswd)
- </message>
- <script>
- listAttr = []
- listAttr.append('uid:%s' % user2Add)
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:person')
- listAttr.append('objectclass:inetOrgPerson')
- listAttr.append('cn:%s' % user2Add)
- listAttr.append('sn:sn of user %s' % user2Add)
- listAttr.append('description:this is the description of %s' % user2Add)
- listAttr.append('userPassword:%s' % user2AddPswd)
- </script>
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToAdd' : user2AddDn,
- 'listAttributes' : listAttr
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search the new user %s in the virtual static group entry (should be a member)' % user2Add
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns the added user'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user2AddDn ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1
- }
- </call>
- <!-- ******************** -->
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user2AddDn ,
- 'string2find' : virtualStaticGroupDn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: application rename entry that belong to a group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
-<!--
- <testcase name="getTestCaseName('application rename entry that belong to a group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application rename %s into %s ' % (user2Add,user2AddRenamed)
- </message>
-
- <call function="'modifyDn'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : user2AddDn ,
- 'newRDN' : user2AddRenamed,
- 'deleteOldRDN' : 1 }
- </call>
--->
- <!-- ******************** -->
-<!--
- <message>
- '++++ Application search the new user %s in the virtual static group entry (should be a member)' % user2Add
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns the added user'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user2AddRenamedDn ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1
- }
- </call>
--->
- <!-- ******************** -->
-<!--
- <call function="'CheckIsMemberOf'">
- { 'baseDn' : user2AddRenamedDn ,
- 'string2find' : virtualStaticGroupDn ,
- 'nbExpected' : 1
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
--->
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: application delete entry belonging to a group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('application delete entry belonging to a group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application delete user %s' % user2Add
- </message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : user2AddDn
- }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search the deleted user %s in the virtual static group entry (should not be in)' % user2Add
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <message>
- '++++ Check the search returns the added user'
- </message>
- <call function="'CheckMatches'">
- { 'string2find' : user2AddDn ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 0
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: Change ds-target-group-dn to another dynamic group
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Change ds-target-group-dn to another dynamic group')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <script>
- dynamicGroup2Dn='cn=my_dynamicgroup2,dc=groups,dc=com'
- </script>
- <message>
- '++++ Application set a value %s to ds-target-group-dn attribute for group %s' % (dynamicGroup2Dn,virtualStaticGroupDn)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : dynamicGroup2Dn }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users becoming to the updated virtual static group entry'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_03,ou=dynamic,dc=groups,dc=com' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1 }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application reset ds-target-group-dn attribute to default value %s' % (dynamicGroupDn)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : dynamicGroupDn }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: Change ds-target-group-dn to static group (member type)
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Change ds-target-group-dn to static group (uniquemember type)')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <script>
- staticGroupDn='cn=my_staticgroup1,dc=groups,dc=com'
- </script>
- <message>
- '++++ Application set a value %s to ds-target-group-dn attribute for group %s' % (staticGroupDn,virtualStaticGroupDn)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : staticGroupDn }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users becoming to the updated virtual static group entry'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_09,ou=static,dc=groups,dc=com' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1 }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application reset ds-target-group-dn attribute to default value %s' % (dynamicGroupDn)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : dynamicGroupDn }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: Change ds-target-group-dn to static group (member type)
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Change ds-target-group-dn to static group (member type)')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <script>
- staticGroupDn='cn=my_staticgroup2,dc=groups,dc=com'
- </script>
- <message>
- '++++ Application set a value %s to ds-target-group-dn attribute for group %s' % (staticGroupDn,virtualStaticGroupDn)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : staticGroupDn }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application search users becoming to the updated virtual static group entry'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_09,ou=static,dc=groups,dc=com' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1 }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Application reset ds-target-group-dn attribute to default value %s' % (dynamicGroupDn)
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'replace' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : dynamicGroupDn }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Virtual Static Group Tests
- #@TestName Group: Virtual Static: Remove ds-target-group-dn attribute
- #@TestID
- #@TestPurpose
- #@TestPreamble
- #@TestSteps
- #@TestPostamble
- #@TestResult
- -->
- <testcase name="getTestCaseName('Remove ds-target-group-dn attribute')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '++++ Application remove ds-target-group-dn attribute'
- </message>
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'DNToModify' : virtualStaticGroupDn ,
- 'changetype' : 'delete' ,
- 'attributeName' : 'ds-target-group-dn' ,
- 'newAttributeValue' : dynamicGroupDn ,
- 'expectedRC' : 65 }
- </call>
- <!-- ******************** -->
- <message>
- '++++ Group should not be modified'
- </message>
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : applicationDn ,
- 'dsInstancePswd' : applicationPswd ,
- 'dsBaseDN' : virtualStaticGroupDn ,
- 'dsFilter' : 'uniquemember=*' ,
- 'expectedRC' : 0 }
- </call>
- <call function="'CheckMatches'">
- { 'string2find' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
- 'mainString' : STAXResult[0][1] ,
- 'nbExpected' : 1 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
-
-
-
- <!-- *********************************************** -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'group_cleanup'"> { 'stopDS' : True } </call>
-
- <call function="'testSuite_Postamble'"/>
+ <block name="'virtual_static'">
+ <try>
+ <sequence>
+
+ <script>
+ applicationDn='uid=my_application,dc=groups,dc=com'
+ applicationPswd='pw_my_application'
+ dynamicGroupDn='cn=my_dynamicgroup1,dc=groups,dc=com'
+ virtualStaticGroupDn='cn=my_virtualstaticgroup,dc=groups,dc=com'
+ newVirtualStaticGroup='my_newVirtualStaticGroup'
+ newVirtualStaticGroupDn='cn=%s,dc=groups,dc=com' % (newVirtualStaticGroup)
+ newVirtualStaticGroupPswd='pw_%s' % (newVirtualStaticGroup)
+ user2Add='user_22'
+ user2AddDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2Add)
+ user2AddPswd='pw_22'
+ user2AddRenamed='%s_bis' % (user2Add)
+ user2AddRenamedDn='uid=%s,ou=dynamic,dc=groups,dc=com' % (user2AddRenamed)
+ </script>
- </sequence>
-
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='groups'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!--- Test Suite information
+ #@TestSuiteName Group test suite
+ #@TestSuitePurpose Test this feature
+ #@TestSuiteID Groups Tests
+ #@TestSuiteGroup Virtual Static Group
+ #@TestGroup Virtual Static Group
+ #@TestScript group_virtual_static.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_setup.xml' % (TESTS_DIR)"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/groups/group_lib.xml' % (TESTS_DIR)"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'stopServer' : False ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/groups/groups.ldif' % remote.data
+ }
+ </call>
+
+ <call function="'group_setup'"/>
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: enable member virtual attribute
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('enable member virtual attribute')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : server.dn ,
+ 'dsInstancePswd' : server.password ,
+ 'DNToModify' : 'cn=Virtual Static uniqueMember,cn=Virtual Attributes,cn=config' ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-cfg-allow-retrieving-membership' ,
+ 'newAttributeValue' : 'true'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: add a Virtual Static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('add a Virtual Static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ listAttr = []
+ listAttr.append('cn:%s' % newVirtualStaticGroup)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:groupOfUniqueNames')
+ listAttr.append('objectclass:ds-virtual-static-group')
+ listAttr.append('description:this is the description of %s' % newVirtualStaticGroup)
+ listAttr.append('ds-target-group-dn:%s' % dynamicGroupDn)
+
+ </script>
+ <message>
+ '++++ Application add group entry %s' % newVirtualStaticGroupDn
+ </message>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : newVirtualStaticGroupDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application do a search to check the entry has been created'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newVirtualStaticGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsAttributes' : 'uniquemember' }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
+ 'string2find' : newVirtualStaticGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: delete a Virtual Static group entry
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('delete a Virtual Static group entry')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Delete the group entry %s' % newVirtualStaticGroupDn
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newVirtualStaticGroupDn,
+ }
+ </call>
+ <message>
+ '++++ Check the group entry %s no more exist' % newVirtualStaticGroup
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : newVirtualStaticGroupDn ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'expectedRC' : 32 }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
+ 'string2find' : newVirtualStaticGroupDn ,
+ 'nbExpected' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: search members of group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('search members of group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Search members of group %s' % virtualStaticGroupDn
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <script>
+ ldapSearchResult=STAXResult[0][1]
+ </script>
+ <!-- ******************** -->
+ <message>
+ '++++ Check uid=user_01,ou=dynamic,dc=groups,dc=com is NOT a group member'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_01,ou=dynamic,dc=groups,dc=com' ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 0
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check uid=user_02,ou=dynamic,dc=groups,dc=com is a group member'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Check uid=user_12,ou=dynamic,dc=groups,dc=com is a group member'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_12,ou=dynamic,dc=groups,dc=com' ,
+ 'mainString' : ldapSearchResult ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: application add entry that belong to a group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('application add entry that belong to a group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application add a new user %s / %s ' % (user2AddDn,user2AddPswd)
+ </message>
+ <script>
+ listAttr = []
+ listAttr.append('uid:%s' % user2Add)
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:person')
+ listAttr.append('objectclass:inetOrgPerson')
+ listAttr.append('cn:%s' % user2Add)
+ listAttr.append('sn:sn of user %s' % user2Add)
+ listAttr.append('description:this is the description of %s' % user2Add)
+ listAttr.append('userPassword:%s' % user2AddPswd)
+ </script>
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToAdd' : user2AddDn,
+ 'listAttributes' : listAttr
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search the new user %s in the virtual static group entry (should be a member)' % user2Add
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns the added user'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user2AddDn ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <!-- ******************** -->
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user2AddDn ,
+ 'string2find' : virtualStaticGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: application rename entry that belong to a group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <!--
+ <testcase name="getTestCaseName('application rename entry that belong to a group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application rename %s into %s ' % (user2Add,user2AddRenamed)
+ </message>
+
+ <call function="'modifyDn'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : user2AddDn ,
+ 'newRDN' : user2AddRenamed,
+ 'deleteOldRDN' : 1 }
+ </call>
+ -->
+ <!-- ******************** -->
+ <!--
+ <message>
+ '++++ Application search the new user %s in the virtual static group entry (should be a member)' % user2Add
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns the added user'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user2AddRenamedDn ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1
+ }
+ </call>
+ -->
+ <!-- ******************** -->
+ <!--
+ <call function="'CheckIsMemberOf'">
+ { 'baseDn' : user2AddRenamedDn ,
+ 'string2find' : virtualStaticGroupDn ,
+ 'nbExpected' : 1
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ -->
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: application delete entry belonging to a group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('application delete entry belonging to a group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application delete user %s' % user2Add
+ </message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : user2AddDn
+ }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search the deleted user %s in the virtual static group entry (should not be in)' % user2Add
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <message>
+ '++++ Check the search returns the added user'
+ </message>
+ <call function="'CheckMatches'">
+ { 'string2find' : user2AddDn ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: Change ds-target-group-dn to another dynamic group
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Change ds-target-group-dn to another dynamic group')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <script>
+ dynamicGroup2Dn='cn=my_dynamicgroup2,dc=groups,dc=com'
+ </script>
+ <message>
+ '++++ Application set a value %s to ds-target-group-dn attribute for group %s' % (dynamicGroup2Dn,virtualStaticGroupDn)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : dynamicGroup2Dn }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users becoming to the updated virtual static group entry'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_03,ou=dynamic,dc=groups,dc=com' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1 }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application reset ds-target-group-dn attribute to default value %s' % (dynamicGroupDn)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : dynamicGroupDn }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: Change ds-target-group-dn to static group (member type)
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Change ds-target-group-dn to static group (uniquemember type)')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <script>
+ staticGroupDn='cn=my_staticgroup1,dc=groups,dc=com'
+ </script>
+ <message>
+ '++++ Application set a value %s to ds-target-group-dn attribute for group %s' % (staticGroupDn,virtualStaticGroupDn)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : staticGroupDn }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users becoming to the updated virtual static group entry'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_09,ou=static,dc=groups,dc=com' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1 }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application reset ds-target-group-dn attribute to default value %s' % (dynamicGroupDn)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : dynamicGroupDn }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: Change ds-target-group-dn to static group (member type)
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Change ds-target-group-dn to static group (member type)')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <script>
+ staticGroupDn='cn=my_staticgroup2,dc=groups,dc=com'
+ </script>
+ <message>
+ '++++ Application set a value %s to ds-target-group-dn attribute for group %s' % (staticGroupDn,virtualStaticGroupDn)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : staticGroupDn }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application search users becoming to the updated virtual static group entry'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_09,ou=static,dc=groups,dc=com' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1 }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Application reset ds-target-group-dn attribute to default value %s' % (dynamicGroupDn)
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'replace' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : dynamicGroupDn }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Virtual Static Group Tests
+ #@TestName Group: Virtual Static: Remove ds-target-group-dn attribute
+ #@TestID
+ #@TestPurpose
+ #@TestPreamble
+ #@TestSteps
+ #@TestPostamble
+ #@TestResult
+ -->
+ <testcase name="getTestCaseName('Remove ds-target-group-dn attribute')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '++++ Application remove ds-target-group-dn attribute'
+ </message>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'DNToModify' : virtualStaticGroupDn ,
+ 'changetype' : 'delete' ,
+ 'attributeName' : 'ds-target-group-dn' ,
+ 'newAttributeValue' : dynamicGroupDn ,
+ 'expectedRC' : 65 }
+ </call>
+ <!-- ******************** -->
+ <message>
+ '++++ Group should not be modified'
+ </message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : server.host ,
+ 'dsInstancePort' : server.port ,
+ 'dsInstanceDn' : applicationDn ,
+ 'dsInstancePswd' : applicationPswd ,
+ 'dsBaseDN' : virtualStaticGroupDn ,
+ 'dsFilter' : 'uniquemember=*' ,
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'CheckMatches'">
+ { 'string2find' : 'uid=user_02,ou=dynamic,dc=groups,dc=com' ,
+ 'mainString' : STAXResult[0][1] ,
+ 'nbExpected' : 1 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Groups Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/groups.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/groups.xml
index 18ec8f3..a246bcb 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/groups.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/groups/groups.xml
@@ -23,61 +23,78 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
-
- <defaultcall function="main_groups"/>
-
+ <defaultcall function="main_groups" />
<function name="main_groups">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
<sequence>
-
- <block name="'groups'">
-
- <sequence>
-
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
-
- <script>
- CurrentTestPath['group']='groups'
- </script>
-
- <call function="'testGroup_Preamble'"/>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_static_uniquemember.xml' % (TESTS_DIR)"/>
- <call function="'main_staticgroup_uniquemember'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_static_member.xml' % (TESTS_DIR)"/>
- <call function="'main_staticgroup_member'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_dynamic.xml' % (TESTS_DIR)"/>
- <call function="'main_dynamicgroup'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/groups/group_virtual_static.xml' % (TESTS_DIR)"/>
- <call function="'main_virtualStaticGroup'" />
-
-
+ <try>
+ <block name="'groups'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='groups'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('static_uniquemember')
+ suiteList.append('static_member')
+ suiteList.append('dynamic')
+ suiteList.append('virtual_static')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/group_%s.xml' % (TESTS_DIR,_group,_suite)"/>
+ <call function="'%s' % _suite" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
<call function="'testGroup_Postamble'"/>
-
- </sequence>
-
- </block>
-
+ </finally>
+ </try>
</sequence>
-
</function>
-
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_LDAPcmds.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_LDAPcmds.xml
index a43180b..efc1d61 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_LDAPcmds.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_LDAPcmds.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_authentication.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_authentication.xml
index 100ac00..505b4d5 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_authentication.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_authentication.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_createbackend.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_createbackend.xml
index 26cf6a5..2a22066 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_createbackend.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_createbackend.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml
index 703d35b..9058c8e 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_dataComparison.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_schemaExtension.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_schemaExtension.xml
index 9dc6589..90259ca 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_schemaExtension.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/i18n/i18n_8bit_schemaExtension.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging.xml
index 47da17c..3328971 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<!--
@@ -31,38 +31,78 @@
#@TestGroupName Logging
#@TestGroupPurpose Test the ability of the server to log information in the appropriated log files
-->
-
-
<stax>
- <defaultcall function="main_logging"/>
+ <defaultcall function="main_logging" />
<function name="main_logging">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
+
<sequence>
- <block name="'logging'">
- <sequence>
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
- <script>
- CurrentTestPath['group']='logging'
- </script>
- <call function="'testGroup_Preamble'" />
- <!-- 'setup','rotation','retention','writer','properties','retention_properties','rotation_properties','cleanup'-->
- <iterate var="_test" in="['setup','rotation','retention','writer','properties','retention_properties','rotation_properties','cleanup']" >
- <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/logging/logging_%s.xml' % (TESTS_DIR,_test)"/>
- <call function="'logging_%s' % _test" />
- </sequence>
- </iterate>
- <call function="'testGroup_Postamble'" />
- </sequence>
- </block>
+ <try>
+ <block name="'logging'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='logging'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('rotation')
+ suiteList.append('retention')
+ suiteList.append('writer')
+ suiteList.append('properties')
+ suiteList.append('retention_properties')
+ suiteList.append('rotation_properties')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s_%s.xml' % (TESTS_DIR,_group,_group,_suite)"/>
+ <call function="'%s_%s' % (_group,_suite)" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_cleanup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_cleanup.xml
index e03db08..348a8d5 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_cleanup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_cleanup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_cleanup"/>
@@ -31,9 +31,15 @@
<sequence>
<block name="'cleanup'">
<sequence>
- <block name="'Block DS Process Stop'">
- <!--- Stop DS -->
+
+ <call function="'testSuite_Preamble'"/>
+
+ <testcase name="getTestCaseName('Logging Setup')">
+
<sequence>
+
+ <call function="'testCase_Preamble'"/>
+
<message>
'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
@@ -47,32 +53,18 @@
}
</call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- </sequence>
- <!--- End Block DS Process Stop -->
- </block>
- <block name="'Block Remove DS Topology'">
- <!-- Remove the topology created for the test suite -->
- <sequence>
<message>
'Remove DS topology created for the Test Suite'
</message>
<call function="'removeTopology'" />
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
+ <call function="'testCase_Postamble'"/>
+
</sequence>
- <!-- End Block Remove DS Topology-->
- </block>
+
+ </testcase>
+
</sequence>
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_properties.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_properties.xml
index 20ac23f..e55b6a2 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_properties.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_properties.xml
@@ -23,650 +23,679 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_properties"/>
<function name="logging_properties" scope="local">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
-<!--- Test Suite information
-#@TestSuiteName Log publisher properties Tests
-#@TestSuitePurpose Verify the log publisher properties
-#@TestSuiteID Logging
-#@TestSuiteGroup Logging
-#@TestGroup Logging
-#@TestScript logging_properties.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
-
- <!--- Test Case : access logger -->
- <!---
- #@TestMarker Log publisher properties Tests
- #@TestName Publisher access logger properties
- #@TestIssue
- #@TestPurpose check the publisher access logger properties.
- #@TestPreamble none
- #@TestStep Check the publisher Access Logger's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('Access logger')">
+ <block name="STAXCurrentFunction">
+ <try>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the Access logger s properties -----'
- </message>
-
- <!-- create a logger publisher-->
- <message>
- '------ create logger publisher --'
- </message>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-publisher',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--type file-based-access --set asynchronous:false --set log-file-permissions:777 --set log-file:logs/access --set enabled:true ',
- 'expectedRC' : 0
- }
- </call>
-
-
- <!-- auto-flush -->
- <message>'------ set auto-flush to true --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set auto-flush:true',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '------ get auto-flush --'
- </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'auto-flush',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'true'
- }
- </call>
- <!-- append -->
- <message>'------ set append to false --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set append:false',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get append --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'append',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'false'
- }
- </call>
-
- <!-- asynchronous -->
- <message>'------ set asynchronous to true --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set asynchronous:true',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get asynchronous --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'asynchronous',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'true' }
- </call>
-
- <!-- buffer-size -->
- <message>'------ set buffer-size to 10mb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set buffer-size:10mb',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get buffer-size --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'buffer-size',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : '10 mb'
- }
- </call>
-
- <!-- time-interval -->
- <message>'------ set time-interval to 3m --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set time-interval:3m',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get time-interval --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'time-interval',
- 'extraParams' : '-m s --advanced',
- 'expectedAttributeValue' : '180 s'
- }
- </call>
-
- <!-- log-file -->
- <message>'------ set log-file to logs/testaccess --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set log-file:logs/testaccess',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get log-file --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'log-file',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'logs/testaccess'
- }
- </call>
- <!-- log-file -->
- <message>'------ set log-file to logs/access --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set log-file:logs/access',
- 'expectedRC' : 0
- }
- </call>
-
- <!-- log-file-permissions -->
- <message>'------ set log-file-permissions to 777 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set log-file-permissions:777',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get log-file-permissions --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'log-file-permissions',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : '777'
- }
- </call>
-
- <!-- queue-size -->
- <message>'------ set queue-size to 1000 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set queue-size:1000',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get queue-size --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'queue-size',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : '1000'
- }
- </call>
-
- <!-- suppress-synchronization-operations -->
- <message>
- '------ set suppress-synchronization-operations to 1000 --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set suppress-synchronization-operations:true',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '------ get suppress-synchronization-operations --'
- </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'suppress-synchronization-operations',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'true'
- }
- </call>
-
- <!-- suppress-internal-operations -->
- <message>
- '------ set suppress-internal-operations to false --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'optionsString' : '--set suppress-internal-operations:false',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '------ get suppress-synchronization-operations --'
- </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'my File-Based Access Logger',
- 'attributeName' : 'suppress-internal-operations',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'false'
- }
- </call>
-
- <!-- delete a logger publisher-->
- <message>'------ delete logger publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-publisher',
- 'objectType' : 'publisher-name',
- 'objectName' : 'my File-Based Access Logger',
- 'expectedRC' : 0
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
}
</call>
- <call function="'testCase_Postamble'"/>
+ <!--- Test Suite information
+ #@TestSuiteName Log publisher properties Tests
+ #@TestSuitePurpose Verify the log publisher properties
+ #@TestSuiteID Logging
+ #@TestSuiteGroup Logging
+ #@TestGroup Logging
+ #@TestScript logging_properties.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+
+ <!--- Test Case : access logger -->
+ <!---
+ #@TestMarker Log publisher properties Tests
+ #@TestName Publisher access logger properties
+ #@TestIssue
+ #@TestPurpose check the publisher access logger properties.
+ #@TestPreamble none
+ #@TestStep Check the publisher Access Logger's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+
+ <testcase name="getTestCaseName('Access logger')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the Access logger s properties -----'
+ </message>
+
+ <!-- create a logger publisher-->
+ <message>
+ '------ create logger publisher --'
+ </message>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-publisher',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--type file-based-access --set asynchronous:false --set log-file-permissions:777 --set log-file:logs/access --set enabled:true ',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <!-- auto-flush -->
+ <message>'------ set auto-flush to true --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set auto-flush:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get auto-flush --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'auto-flush',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+ <!-- append -->
+ <message>'------ set append to false --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set append:false',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get append --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'append',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'false'
+ }
+ </call>
+
+ <!-- asynchronous -->
+ <message>'------ set asynchronous to true --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set asynchronous:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get asynchronous --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-publisher' ,
+ 'propertyType' : 'publisher' ,
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'asynchronous',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'true' }
+ </call>
+
+ <!-- buffer-size -->
+ <message>'------ set buffer-size to 10mb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop' ,
+ 'objectType' : 'publisher-name' ,
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set buffer-size:10mb',
+ 'expectedRC' : 0 }
+ </call>
+ <message>'------ get buffer-size --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'buffer-size',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : '10 mb'
+ }
+ </call>
+
+ <!-- time-interval -->
+ <message>'------ set time-interval to 3m --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set time-interval:3m',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get time-interval --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'time-interval',
+ 'extraParams' : '-m s --advanced',
+ 'expectedAttributeValue' : '180 s'
+ }
+ </call>
+
+ <!-- log-file -->
+ <message>'------ set log-file to logs/testaccess --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set log-file:logs/testaccess',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get log-file --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'log-file',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'logs/testaccess'
+ }
+ </call>
+ <!-- log-file -->
+ <message>'------ set log-file to logs/access --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set log-file:logs/access',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- log-file-permissions -->
+ <message>'------ set log-file-permissions to 777 --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set log-file-permissions:777',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get log-file-permissions --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'log-file-permissions',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : '777'
+ }
+ </call>
+
+ <!-- queue-size -->
+ <message>'------ set queue-size to 1000 --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set queue-size:1000',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get queue-size --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'queue-size',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : '1000'
+ }
+ </call>
+
+ <!-- suppress-synchronization-operations -->
+ <message>
+ '------ set suppress-synchronization-operations to 1000 --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set suppress-synchronization-operations:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get suppress-synchronization-operations --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'suppress-synchronization-operations',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- suppress-internal-operations -->
+ <message>
+ '------ set suppress-internal-operations to false --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'optionsString' : '--set suppress-internal-operations:false',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get suppress-synchronization-operations --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'my File-Based Access Logger',
+ 'attributeName' : 'suppress-internal-operations',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'false'
+ }
+ </call>
+
+ <!-- delete a logger publisher-->
+
+ <message>'------ delete logger publisher --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-publisher',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'my File-Based Access Logger',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Error logger -->
+ <!---
+ #@TestMarker Log publisher properties Tests
+ #@TestName Publisher error logger properties
+ #@TestIssue
+ #@TestPurpose check the Publisher error logger properties.
+ #@TestPreamble none
+ #@TestStep Check the Publisher error Logger's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+
+ <testcase name="getTestCaseName('Error logger')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the Error logger s properties -----'
+ </message>
+ <!-- default-severity -->
+ <message>
+ '------ set default-severity to mild-error --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Error Logger',
+ 'optionsString' : '--set default-severity:mild-error',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-severity --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Error Logger',
+ 'attributeName' : 'default-severity',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'mild-error'
+ }
+ </call>
+
+ <!-- override-severity -->
+ <message>'------ set override-severity --' </message>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Error Logger',
+ 'optionsString' : '--set "override-severity:core=info,severe-error"',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get override-severity --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Error Logger',
+ 'attributeName' : 'override-severity',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'core=info,severe-error'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Debug logger -->
+ <!---
+ #@TestMarker Log publisher properties Tests
+ #@TestName Publisher Debug logger properties
+ #@TestIssue
+ #@TestPurpose check the Publisher Debug logger properties.
+ #@TestPreamble none
+ #@TestStep Check the Publisher Debug Logger's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+
+ <testcase name="getTestCaseName('Debug logger')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ '---- Check the Debug loggers properties -----'
+ </message>
+
+ <!-- default-debug-category -->
+
+ <message>'------ set default-debug-category --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-debug-category:thrown',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-debug-category --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-debug-category',
+ 'extraParams' : '--advanced',
+ 'expectedAttributeValue' : 'thrown'
+ }
+ </call>
+
+ <!-- default-debug-level -->
+ <message>'------ set default-debug-level --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-debug-level:verbose',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-debug-level --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-debug-level',
+ 'expectedAttributeValue' : 'verbose'
+ }
+ </call>
+
+ <!-- default-include-throwable-cause -->
+ <message>
+ '------ set default-include-throwable-cause --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-include-throwable-cause:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-include-throwable-cause --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-include-throwable-cause',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- default-omit-method-entry-arguments -->
+ <message>
+ '------ set default-omit-method-entry-arguments --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-omit-method-entry-arguments:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get default-omit-method-entry-arguments --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-omit-method-entry-arguments',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- default-omit-method-return-value -->
+ <message>
+ '------ set default-include-throwable-cause --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop' ,
+ 'objectType' : 'publisher-name' ,
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-omit-method-return-value:true',
+ 'expectedRC' : 0 }
+ </call>
+ <message>'------ get default-omit-method-return-value --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-omit-method-return-value',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- default-throwable-stack-frames -->
+ <message>
+ '------ set default-throwable-stack-frames --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-throwable-stack-frames:2',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-throwable-stack-frames --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-throwable-stack-frames',
+ 'expectedAttributeValue' : '2'
+ }
+ </call>
+
+ </sequence>
+ </testcase>
+
</sequence>
- </testcase>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Log Properties Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
- <!--- Test Case : Error logger -->
- <!---
- #@TestMarker Log publisher properties Tests
- #@TestName Publisher error logger properties
- #@TestIssue
- #@TestPurpose check the Publisher error logger properties.
- #@TestPreamble none
- #@TestStep Check the Publisher error Logger's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('Error logger')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the Error logger s properties -----'
- </message>
- <!-- default-severity -->
- <message>
- '------ set default-severity to mild-error --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Error Logger',
- 'optionsString' : '--set default-severity:mild-error',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get default-severity --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Error Logger',
- 'attributeName' : 'default-severity',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'mild-error'
- }
- </call>
-
- <!-- override-severity -->
- <message>'------ set override-severity --' </message>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Error Logger',
- 'optionsString' : '--set "override-severity:core=info,severe-error"',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '------ get override-severity --'
- </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Error Logger',
- 'attributeName' : 'override-severity',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'core=info,severe-error'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case : Debug logger -->
- <!---
- #@TestMarker Log publisher properties Tests
- #@TestName Publisher Debug logger properties
- #@TestIssue
- #@TestPurpose check the Publisher Debug logger properties.
- #@TestPreamble none
- #@TestStep Check the Publisher Debug Logger's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('Debug logger')">
- <sequence>
- <call function="'testCase_Preamble'" />
- <message>
- '---- Check the Debug loggers properties -----'
- </message>
-
- <!-- default-debug-category -->
-
- <message>'------ set default-debug-category --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-debug-category:thrown',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get default-debug-category --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-debug-category',
- 'extraParams' : '--advanced',
- 'expectedAttributeValue' : 'thrown'
- }
- </call>
-
- <!-- default-debug-level -->
- <message>'------ set default-debug-level --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-debug-level:verbose',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get default-debug-level --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-debug-level',
- 'expectedAttributeValue' : 'verbose'
- }
- </call>
-
- <!-- default-include-throwable-cause -->
- <message>
- '------ set default-include-throwable-cause --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-include-throwable-cause:true',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get default-include-throwable-cause --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-include-throwable-cause',
- 'expectedAttributeValue' : 'true'
- }
- </call>
-
- <!-- default-omit-method-entry-arguments -->
- <message>
- '------ set default-omit-method-entry-arguments --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-omit-method-entry-arguments:true',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '------ get default-omit-method-entry-arguments --'
- </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-omit-method-entry-arguments',
- 'expectedAttributeValue' : 'true'
- }
- </call>
-
- <!-- default-omit-method-return-value -->
- <message>
- '------ set default-include-throwable-cause --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-omit-method-return-value:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-omit-method-return-value --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-omit-method-return-value',
- 'expectedAttributeValue' : 'true'
- }
- </call>
-
- <!-- default-throwable-stack-frames -->
- <message>
- '------ set default-throwable-stack-frames --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-throwable-stack-frames:2',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get default-throwable-stack-frames --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-throwable-stack-frames',
- 'expectedAttributeValue' : '2'
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </try>
+ </block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention.xml
index 1d5fd85..8acd621 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention.xml
@@ -23,308 +23,334 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_retention"/>
<function name="logging_retention" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
-<!--- Test Suite information
-#@TestSuiteName Retention Policy Tests
-#@TestSuitePurpose Verify the Retention Policy
-#@TestSuiteID Logging
-#@TestSuiteGroup Logging
-#@TestGroup Logging
-#@TestScript logging_retention.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
-
- <!--- Test Case : retention policy -->
- <!---
- #@TestMarker Retention Policy Tests
- #@TestName Count limit retention policy
- #@TestPurpose Check the count retention policy
- #@TestPreamble none
- #@TestStep Create a new count limit retention policy
- #@TestStep Configure the count Limit retention policy with a Max file to 3
- #@TestStep Execute ldapsearch request until the log are cleaned
- #@TestPostamble none
- #@TestResult the number of logs must not exceed 3
- -->
- <testcase name="getTestCaseName('Count limit retention')">
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Retention Policy Tests
+ #@TestSuitePurpose Verify the Retention Policy
+ #@TestSuiteID Logging
+ #@TestSuiteGroup Logging
+ #@TestGroup Logging
+ #@TestScript logging_retention.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+
+ <!--- Test Case : retention policy -->
+ <!---
+ #@TestMarker Retention Policy Tests
+ #@TestName Count limit retention policy
+ #@TestPurpose Check the count retention policy
+ #@TestPreamble none
+ #@TestStep Create a new count limit retention policy
+ #@TestStep Configure the count Limit retention policy with a Max file to 3
+ #@TestStep Execute ldapsearch request until the log are cleaned
+ #@TestPostamble none
+ #@TestResult the number of logs must not exceed 3
+ -->
+ <testcase name="getTestCaseName('Count limit retention')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the file count -----'
+ </message>
+ <!-- set the max number of files to keep -->
+ <script>
+ numberFiles=5
+ maxFiles=6
+ </script>
+
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '-- create a new file count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my file count retention policy',
+ 'optionsString' : '--type file-count --set number-of-files:%s' % (numberFiles),
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ Add this retention policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add retention-policy:"my file count retention policy"',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '-- create a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'optionsString' : '--type size-limit --set file-size-limit:2kb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ Add this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add rotation-policy:"my size Limit Rotation Policy"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <!-- Get configuration -->
+
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'get-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'get-log-rotation-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'get-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my file count retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <!-- Starting loop -->
+
+ <!-- Execute ldapsearch until we detect a log rotation -->
+ <!-- Check the number of logs files never exceed the number-of-files -->
+ <script>
+ cpt=0
+ error=0
+ </script>
+
+ <loop from="1" to="10" until="error != 0">
+ <sequence>
+ <message>'###########################'</message>
+ <message>' LOOP %s :' % cpt </message>
+ <message>'###########################'</message>
+ <message>'--- Execute a Search request ---'</message>
+
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 5000 }
+ </call>
+
+ <call function="'listFolder'">
+ { 'location' : DIRECTORY_INSTANCE_HOST,
+ 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
+ 'filename' : 'access'
+ }
+ </call>
+
+ <if expr="int(len(cmdResult)) > maxFiles">
+ <sequence>
+ <script>
+ error=1
+ </script>
+ <message>
+ 'Error, the number of logs files is %s and exceed the retention policy' % int(len(cmdResult))
+ </message>
+ <call function="'testFailed'" />
+ </sequence>
+ </if>
+
+ <script>
+ cpt=cpt+1
+ </script>
+ </sequence>
+ </loop>
+
+ <if expr="error == 0" >
+ <sequence>
+ <message>
+ 'SUCCESS: the retention policy has been checked'
+ </message>
+ <call function="'testPassed'"/>
+ </sequence>
+ </if>
+
+ <!-- cleanup -->
+ <message>
+ '------ remove this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--remove rotation-policy:"my size Limit Rotation Policy"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ remove this retention policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--remove retention-policy:"my file count retention policy"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <message>
+ '-- delete a new file count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'delete-log-retention-policy' ,
+ 'objectType' : 'policy-name' ,
+ 'objectName' : 'my file count retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <message>
+ '-- delete a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the file count -----'
- </message>
- <!-- set the max number of files to keep -->
- <script>
- numberFiles=5
- maxFiles=6
- </script>
-
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*',
- 'dsScope' : 'base',
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- '-- create a new file count retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my file count retention policy',
- 'optionsString' : '--type file-count --set number-of-files:%s' % (numberFiles),
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- '------ Add this retention policy to the Access log publisher --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add retention-policy:"my file count retention policy"',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '-- create a new size limit rotation policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size Limit Rotation Policy',
- 'optionsString' : '--type size-limit --set file-size-limit:2kb',
- 'expectedRC' : 0
- }
- </call>
- <message>
- '------ Add this rotation policy to the Access log publisher --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add rotation-policy:"my size Limit Rotation Policy"',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false',
- 'expectedRC' : 0
- }
- </call>
-
-
- <!-- Get configuration -->
-
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'get-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'get-log-rotation-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size Limit Rotation Policy',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'get-log-retention-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my file count retention policy',
- 'expectedRC' : 0
- }
- </call>
-
-
- <!-- Starting loop -->
-
- <!-- Execute ldapsearch until we detect a log rotation -->
- <!-- Check the number of logs files never exceed the number-of-files -->
- <script>
- cpt=0
- error=0
- </script>
-
- <loop from="1" to="10" until="error != 0">
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Log Retention Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
<sequence>
- <message>'###########################'</message>
- <message>' LOOP %s :' % cpt </message>
- <message>'###########################'</message>
- <message>'--- Execute a Search request ---'</message>
-
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*',
- 'dsScope' : 'base',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 5000 }
- </call>
-
- <call function="'listFolder'">
- { 'location' : DIRECTORY_INSTANCE_HOST,
- 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
- 'filename' : 'access'
- }
- </call>
-
- <if expr="int(len(cmdResult)) > maxFiles">
- <sequence>
- <script>
- error=1
- </script>
- <message>
- 'Error, the number of logs files is %s and exceed the retention policy' % int(len(cmdResult))
- </message>
- <call function="'testFailed'" />
- </sequence>
- </if>
-
- <script>
- cpt=cpt+1
- </script>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
</sequence>
- </loop>
-
- <if expr="error == 0" >
- <sequence>
- <message>
- 'SUCCESS: the retention policy has been checked'
- </message>
- <call function="'testPassed'"/>
- </sequence>
- </if>
-
- <!-- cleanup -->
- <message>
- '------ remove this rotation policy to the Access log publisher --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--remove rotation-policy:"my size Limit Rotation Policy"',
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- '------ remove this retention policy to the Access log publisher --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--remove retention-policy:"my file count retention policy"',
- 'expectedRC' : 0
- }
- </call>
-
-
- <message>
- '-- delete a new file count retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my file count retention policy',
- 'expectedRC' : 0
- }
- </call>
-
-
- <message>
- '-- delete a new size limit rotation policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size Limit Rotation Policy',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention_properties.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention_properties.xml
index 55586aa..1d4a5b5 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention_properties.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_retention_properties.xml
@@ -23,311 +23,340 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_retention_properties"/>
<function name="logging_retention_properties" scope="local">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
-<!--- Test Suite information
-#@TestSuiteName Retention Policy Properties Tests
-#@TestSuitePurpose Verify the Retention Policy properties
-#@TestSuiteID Logging
-#@TestSuiteGroup Logging
-#@TestGroup Logging
-#@TestScript logging_retention_properties.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
-
- <!--- Test Case : Retention policy -->
- <!---
- #@TestMarker Retention Policy Properties Tests
- #@TestName Size limit retention policy
- #@TestIssue
- #@TestPurpose Check the size limit retention policy properties.
- #@TestPreamble none
- #@TestStep Check the size limit retention policy's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('size limit retention policy suite')">
+ <block name="STAXCurrentFunction">
+ <try>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the size limit retention policy properties -----'
- </message>
- <!-- create-log-retention-policy with the type size-limit -->
- <message>
- '------ create a size limit retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size retention policy',
- 'optionsString' : '--type size-limit --set disk-space-used:5mb',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get file-size-limit --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-retention-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my size retention policy',
- 'attributeName' : 'disk-space-used',
- 'expectedAttributeValue' : '5 mb'
- }
- </call>
-
- <!-- set disk-space-used -->
- <message>'------ set file-size-limit to 5kb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-retention-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size retention policy',
- 'optionsString' : '--set disk-space-used:5kb',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get disk-space-used --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-retention-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my size retention policy',
- 'attributeName' : 'disk-space-used',
- 'expectedAttributeValue' : '5 kb'
- }
- </call>
-
- <message>
- '------ delete a size limit retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size retention policy',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
-
- <!--- Test Case : free-disk-space Retention policy -->
- <!---
- #@TestMarker Retention Policy Properties Tests
- #@TestName free-disk-space retention policy
- #@TestIssue
- #@TestPurpose Check the free-disk-space retention policy properties.
- #@TestPreamble none
- #@TestStep Check the free-disk-space retention policy's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('free-disk-space retention policy suite')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the free-disk-space retention policy properties -----'
- </message>
- <!-- create-log-retention-policy with the type free-disk-space -->
- <message>
- '------ create a free-disk-space limit retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my free-disk-space retention policy',
- 'optionsString' : '--type free-disk-space --set free-disk-space:6Gb',
- 'expectedRC' : 0
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
}
</call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Retention Policy Properties Tests
+ #@TestSuitePurpose Verify the Retention Policy properties
+ #@TestSuiteID Logging
+ #@TestSuiteGroup Logging
+ #@TestGroup Logging
+ #@TestScript logging_retention_properties.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+
+ <!--- Test Case : Retention policy -->
+ <!---
+ #@TestMarker Retention Policy Properties Tests
+ #@TestName Size limit retention policy
+ #@TestIssue
+ #@TestPurpose Check the size limit retention policy properties.
+ #@TestPreamble none
+ #@TestStep Check the size limit retention policy's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+
+ <testcase name="getTestCaseName('size limit retention policy suite')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the size limit retention policy properties -----'
+ </message>
+ <!-- create-log-retention-policy with the type size-limit -->
+ <message>
+ '------ create a size limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size retention policy',
+ 'optionsString' : '--type size-limit --set disk-space-used:5mb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get file-size-limit --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my size retention policy',
+ 'attributeName' : 'disk-space-used',
+ 'expectedAttributeValue' : '5 mb'
+ }
+ </call>
+
+ <!-- set disk-space-used -->
+ <message>'------ set file-size-limit to 5kb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size retention policy',
+ 'optionsString' : '--set disk-space-used:5kb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get disk-space-used --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my size retention policy',
+ 'attributeName' : 'disk-space-used',
+ 'expectedAttributeValue' : '5 kb'
+ }
+ </call>
+
+ <message>
+ '------ delete a size limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
- <message>
- '------ get free_disk-space --'
- </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my free-disk-space retention policy',
- 'attributeName' : 'free-disk-space',
- 'expectedAttributeValue' : '6 gb'
- }
- </call>
-
- <!-- set free_disk-space -->
- <message>'------ set free_disk-space to 4mb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-retention-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my free-disk-space retention policy',
- 'optionsString' : '--set free-disk-space:4mb',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get free_disk-space --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-retention-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my free-disk-space retention policy',
- 'attributeName' : 'free-disk-space',
- 'expectedAttributeValue' : '4 mb'
- }
- </call>
-
- <message>
- '------ delete a free-disk-space retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my free-disk-space retention policy',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
+
+ <!--- Test Case : free-disk-space Retention policy -->
+ <!---
+ #@TestMarker Retention Policy Properties Tests
+ #@TestName free-disk-space retention policy
+ #@TestIssue
+ #@TestPurpose Check the free-disk-space retention policy properties.
+ #@TestPreamble none
+ #@TestStep Check the free-disk-space retention policy's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+
+ <testcase name="getTestCaseName('free-disk-space retention policy suite')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the free-disk-space retention policy properties -----'
+ </message>
+ <!-- create-log-retention-policy with the type free-disk-space -->
+ <message>
+ '------ create a free-disk-space limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my free-disk-space retention policy',
+ 'optionsString' : '--type free-disk-space --set free-disk-space:6Gb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ get free_disk-space --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-retention-policy' ,
+ 'propertyType' : 'policy' ,
+ 'propertyName' : 'my free-disk-space retention policy',
+ 'attributeName' : 'free-disk-space',
+ 'expectedAttributeValue' : '6 gb'
+ }
+ </call>
+
+ <!-- set free_disk-space -->
+ <message>'------ set free_disk-space to 4mb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my free-disk-space retention policy',
+ 'optionsString' : '--set free-disk-space:4mb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get free_disk-space --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my free-disk-space retention policy',
+ 'attributeName' : 'free-disk-space',
+ 'expectedAttributeValue' : '4 mb'
+ }
+ </call>
+
+ <message>
+ '------ delete a free-disk-space retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my free-disk-space retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case : free-disk-space Retention policy -->
+ <!---
+ #@TestMarker Retention Policy Properties Tests
+ #@TestName file-count retention policy
+ #@TestIssue
+ #@TestPurpose Check the file-count retention policy properties.
+ #@TestPreamble none
+ #@TestStep Check the file-count retention policy's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+
+ <testcase name="getTestCaseName('file-count retention policy suite')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the file-count retention policy properties -----'
+ </message>
+
+ <!-- create-log-retention-policy with the type file-count -->
+ <message>
+ '------ create a file-count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my filecount retention policy',
+ 'optionsString' : '--type file-count --set number-of-files:10',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>'------ get number-of-files --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-retention-policy' ,
+ 'propertyType' : 'policy' ,
+ 'propertyName' : 'my filecount retention policy',
+ 'attributeName' : 'number-of-files',
+ 'expectedAttributeValue' : '10'
+ }
+ </call>
+
+ <!-- set number-of-files -->
+ <message>'------ set number-of-files to 32 --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my filecount retention policy',
+ 'optionsString' : '--set number-of-files:32',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get number-of-files --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' :'my filecount retention policy',
+ 'attributeName' : 'number-of-files',
+ 'expectedAttributeValue' : '32'
+ }
+ </call>
+
+ <!-- delete-log-retention-policy with the type file-count -->
+ <message>
+ '------ delete a fixed file-count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my filecount retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
</sequence>
- </testcase>
-
-
- <!--- Test Case : free-disk-space Retention policy -->
- <!---
- #@TestMarker Retention Policy Properties Tests
- #@TestName file-count retention policy
- #@TestIssue
- #@TestPurpose Check the file-count retention policy properties.
- #@TestPreamble none
- #@TestStep Check the file-count retention policy's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('file-count retention policy suite')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the file-count retention policy properties -----'
- </message>
-
- <!-- create-log-retention-policy with the type file-count -->
- <message>
- '------ create a file-count retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my filecount retention policy',
- 'optionsString' : '--type file-count --set number-of-files:10',
- 'expectedRC' : 0
- }
- </call>
-
- <message>'------ get number-of-files --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my filecount retention policy',
- 'attributeName' : 'number-of-files',
- 'expectedAttributeValue' : '10'
- }
- </call>
-
- <!-- set number-of-files -->
- <message>'------ set number-of-files to 32 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-retention-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my filecount retention policy',
- 'optionsString' : '--set number-of-files:32',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get number-of-files --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-retention-policy',
- 'propertyType' : 'policy',
- 'propertyName' :'my filecount retention policy',
- 'attributeName' : 'number-of-files',
- 'expectedAttributeValue' : '32'
- }
- </call>
-
- <!-- delete-log-retention-policy with the type file-count -->
- <message>
- '------ delete a fixed file-count retention policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-retention-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my filecount retention policy',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
- <call function="'testSuite_Postamble'" />
- </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Log Retention Properties Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation.xml
index 2f291a8..5fc3fd9 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation.xml
@@ -23,133 +23,99 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_rotation"/>
<function name="logging_rotation" scope="local">
- <block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
-<!--- Test Suite information
-#@TestSuiteName Rotation Policy Tests
-#@TestSuitePurpose Verify the Rotation Policy
-#@TestSuiteID Logging
-#@TestSuiteGroup Logging
-#@TestGroup Logging
-#@TestScript logging_rotation.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
- <!---
- #@TestMarker Rotation Policy Tests
- #@TestName Size limit rotation
- #@TestPurpose Check the size limit rotation policy
- #@TestPreamble none
- #@TestStep Create a new size limit rotation policy
- #@TestStep Configure the Size Limit rotation policy with a Max size to 64kb
- #@TestStep Execute ldapsearch request until the log are rotate
- #@TestPostamble none
- #@TestResult the logs size must match the rotation size
- -->
-
- <testcase name="getTestCaseName('size limit')">
+ <block name="STAXCurrentFunction">
+ <try>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the size limit rotation -----'
- </message>
-
- <message>
- '-- create a new size limit rotation policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size Limit Rotation Policy',
- 'optionsString' : '--type size-limit --set file-size-limit:4kb',
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- '------ Add this rotation policy to the Access log publisher --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add rotation-policy:"my size Limit Rotation Policy"',
- 'expectedRC' : 0
- }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false --set buffer-size:64kb',
- 'expectedRC' : 0
- }
- </call>
-
-
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-publisher',
- 'propertyType' : 'publisher',
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'rotation-policy'
- }
- </call>
-
-
- <!-- Starting loop -->
<script>
- listName=[]
- listSize=[]
- cpt=0
- nbLog=0
+ CurrentTestPath['suite']=STAXCurrentFunction
</script>
- <!-- Execute ldapsearch until we detect a log rotation -->
- <!-- Stop when the first rotation is done -->
+ <call function="'testSuite_Preamble'" />
- <loop from="1" to="50" until="RC != 0">
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Rotation Policy Tests
+ #@TestSuitePurpose Verify the Rotation Policy
+ #@TestSuiteID Logging
+ #@TestSuiteGroup Logging
+ #@TestGroup Logging
+ #@TestScript logging_rotation.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <!---
+ #@TestMarker Rotation Policy Tests
+ #@TestName Size limit rotation
+ #@TestPurpose Check the size limit rotation policy
+ #@TestPreamble none
+ #@TestStep Create a new size limit rotation policy
+ #@TestStep Configure the Size Limit rotation policy with a Max size to 64kb
+ #@TestStep Execute ldapsearch request until the log are rotate
+ #@TestPostamble none
+ #@TestResult the logs size must match the rotation size
+ -->
+
+ <testcase name="getTestCaseName('size limit')">
<sequence>
- <message>'###########################'</message>
- <message>' LOOP %s :' % cpt </message>
- <message>'###########################'</message>
- <message>'--- Execute a Search request ---'</message>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the size limit rotation -----'
+ </message>
- <call function="'ldapSearchWithScript'">
+ <message>
+ '-- create a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*',
- 'dsScope' : 'base',
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'optionsString' : '--type size-limit --set file-size-limit:4kb',
'expectedRC' : 0
}
</call>
+ <message>
+ '------ Add this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add rotation-policy:"my size Limit Rotation Policy"',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false --set buffer-size:64kb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
@@ -160,137 +126,198 @@
'attributeName' : 'rotation-policy'
}
</call>
+
- <message>'--- Check log files ---'</message>
- <call function="'listFolder'">
- { 'location' : DIRECTORY_INSTANCE_HOST,
- 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
- 'filename' : 'access'
- }
- </call>
+ <!-- Starting loop -->
+ <script>
+ listName=[]
+ listSize=[]
+ cpt=0
+ nbLog=0
+ </script>
+ <!-- Execute ldapsearch until we detect a log rotation -->
+ <!-- Stop when the first rotation is done -->
- <if expr="len(cmdResult) > 0">
- <sequence>
- <iterate var="result" in="cmdResult">
- <sequence>
+ <loop from="1" to="50" until="RC != 0">
+ <sequence>
+ <message>'###########################'</message>
+ <message>' LOOP %s :' % cpt </message>
+ <message>'###########################'</message>
+ <message>'--- Execute a Search request ---'</message>
+
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'rotation-policy'
+ }
+ </call>
+
+ <message>'--- Check log files ---'</message>
+ <call function="'listFolder'">
+ { 'location' : DIRECTORY_INSTANCE_HOST,
+ 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
+ 'filename' : 'access'
+ }
+ </call>
+
+ <if expr="len(cmdResult) > 0">
+ <sequence>
+ <iterate var="result" in="cmdResult">
+ <sequence>
+ <script>
+ logname=result["name"]
+ logsize=result["size"]
+ found=0
+ </script>
+ <message>
+ 'the log file status for file "%s" is %s ' % (logname,logsize)
+ </message>
+ <script>
+ for currentLog in listName:
+ if currentLog == logname:
+ found=1
+ currentIndex=listName.index(currentLog)
+ currentSize=listSize[currentIndex]
+ if currentSize != logsize:
+ listSize[currentIndex]=logsize
+
+ if found == 0:
+ if nbLog != 0:
+ RC=1
+ newlogName=logname
+ newlogSize=logsize
+ listName.append(logname)
+ listSize.append(logsize)
+ </script>
+ </sequence>
+ </iterate>
+
+ <!-- set nbLog when we find a log file -->
<script>
- logname=result["name"]
- logsize=result["size"]
- found=0
+ nbLog=1
</script>
<message>
- 'the log file status for file "%s" is %s ' % (logname,logsize)
+ 'The new log file status is : %s : %s' % (listName,listSize)
</message>
- <script>
- for currentLog in listName:
- if currentLog == logname:
- found=1
- currentIndex=listName.index(currentLog)
- currentSize=listSize[currentIndex]
- if currentSize != logsize:
- listSize[currentIndex]=logsize
-
- if found == 0:
- if nbLog != 0:
- RC=1
- newlogName=logname
- newlogSize=logsize
- listName.append(logname)
- listSize.append(logsize)
- </script>
</sequence>
- </iterate>
-
- <!-- set nbLog when we find a log file -->
+ </if>
<script>
- nbLog=1
+ cpt=cpt+1
</script>
- <message>
- 'The new log file status is : %s : %s' % (listName,listSize)
- </message>
</sequence>
- </if>
- <script>
- cpt=cpt+1
- </script>
- </sequence>
- </loop>
-
-
- <!-- ############################### -->
- <!-- Check log file size -->
- <!-- all the log file size must be around 4kb -->
- <!-- ############################### -->
-
- <if expr="RC == 1">
- <sequence>
- <message>
- 'A log rotation has been done. The new rotation file is "%s" (size = %s) ' % (newlogName,newlogSize)
- </message>
+ </loop>
- <if expr="int(newlogSize) < 4100 and int(newlogSize) > 3900" >
+
+ <!-- ############################### -->
+ <!-- Check log file size -->
+ <!-- all the log file size must be around 4kb -->
+ <!-- ############################### -->
+
+ <if expr="RC == 1">
<sequence>
<message>
- 'SUCCESS. The rotation based on size limit is successfull. The file "%s" (size = %s) ' % (newlogName,newlogSize)
- </message>
- <call function="'testPassed'"/>
+ 'A log rotation has been done. The new rotation file is "%s" (size = %s) ' % (newlogName,newlogSize)
+ </message>
+
+ <if expr="int(newlogSize) < 4100 and int(newlogSize) > 3900" >
+ <sequence>
+ <message>
+ 'SUCCESS. The rotation based on size limit is successfull. The file "%s" (size = %s) ' % (newlogName,newlogSize)
+ </message>
+ <call function="'testPassed'"/>
+ </sequence>
+ <else>
+ <sequence>
+ <message>
+ 'ERROR in the rotation. The file "%s" (size = %s) does not match the rotation size ' % (newlogName,newlogSize)
+ </message>
+ <call function="'testFailed'"/>
+ </sequence>
+ </else>
+ </if>
</sequence>
<else>
<sequence>
- <message>
- 'ERROR in the rotation. The file "%s" (size = %s) does not match the rotation size ' % (newlogName,newlogSize)
- </message>
+ <message>'ERROR. The rotation process didn t work.'</message>
<call function="'testFailed'"/>
</sequence>
</else>
</if>
+
+ <!-- ############################### -->
+ <!-- clean rotation policy -->
+ <!-- ############################### -->
+
+ <message>
+ '------ remove this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--remove rotation-policy:"my size Limit Rotation Policy"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '-- delete a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
</sequence>
- <else>
- <sequence>
- <message>'ERROR. The rotation process didn t work.'</message>
- <call function="'testFailed'"/>
- </sequence>
- </else>
- </if>
+ </testcase>
- <!-- ############################### -->
- <!-- clean rotation policy -->
- <!-- ############################### -->
-
- <message>
- '------ remove this rotation policy to the Access log publisher --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-publisher-prop',
- 'objectType' : 'publisher-name',
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--remove rotation-policy:"my size Limit Rotation Policy"',
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- '-- delete a new size limit rotation policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size Limit Rotation Policy',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'" />
</sequence>
- </testcase>
- <call function="'testSuite_Postamble'" />
- </sequence>
- </block>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Log Rotation Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation_properties.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation_properties.xml
index e9a35c4..20817cd 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation_properties.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_rotation_properties.xml
@@ -23,299 +23,327 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_rotation_properties"/>
<function name="logging_rotation_properties" scope="local">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
-<!--- Test Suite information
-#@TestSuiteName Rotation Policy Properties Tests
-#@TestSuitePurpose Verify the Rotation Policy properties
-#@TestSuiteID Logging
-#@TestSuiteGroup Logging
-#@TestGroup Logging
-#@TestScript logging_rotation_properties.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
- <!--- Test Case : Rotation policy -->
- <!---
- #@TestMarker Rotation Policy Properties Tests
- #@TestName size limit Rotation policy
- #@TestPurpose Check the size limit rotation policy properties.
- #@TestPreamble none
- #@TestStep Check the size limit rotation policy's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
- <testcase name="getTestCaseName('size limit Rotation policy')">
+ <block name="STAXCurrentFunction">
+ <try>
<sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the size limit Rotation policy properties -----'
- </message>
-
- <!-- create-log-rotation-policy with the type size-limit -->
- <message>'------ create a size limit rotation policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size rotation policy',
- 'optionsString' : '--type size-limit --set file-size-limit:5mb',
- 'expectedRC' : 0
- }
- </call>
-
- <message>'------ get file-size-limit --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-rotation-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my size rotation policy',
- 'attributeName' : 'file-size-limit',
- 'expectedAttributeValue' : '5 mb'
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
}
</call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Rotation Policy Properties Tests
+ #@TestSuitePurpose Verify the Rotation Policy properties
+ #@TestSuiteID Logging
+ #@TestSuiteGroup Logging
+ #@TestGroup Logging
+ #@TestScript logging_rotation_properties.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <!--- Test Case : Rotation policy -->
+ <!---
+ #@TestMarker Rotation Policy Properties Tests
+ #@TestName size limit Rotation policy
+ #@TestPurpose Check the size limit rotation policy properties.
+ #@TestPreamble none
+ #@TestStep Check the size limit rotation policy's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+ <testcase name="getTestCaseName('size limit Rotation policy')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the size limit Rotation policy properties -----'
+ </message>
+
+ <!-- create-log-rotation-policy with the type size-limit -->
+ <message>'------ create a size limit rotation policy --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size rotation policy',
+ 'optionsString' : '--type size-limit --set file-size-limit:5mb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>'------ get file-size-limit --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-rotation-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my size rotation policy',
+ 'attributeName' : 'file-size-limit',
+ 'expectedAttributeValue' : '5 mb'
+ }
+ </call>
+
+ <!-- set file-size-limit -->
+ <message>'------ set file-size-limit to 6kb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-rotation-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size rotation policy',
+ 'optionsString' : '--set file-size-limit:5kb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get file-size-limit --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-rotation-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my size rotation policy',
+ 'attributeName' : 'file-size-limit',
+ 'expectedAttributeValue' : '5 kb'
+ }
+ </call>
+
+ <message>'------ delete a size limit rotation policy --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size rotation policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
- <!-- set file-size-limit -->
- <message>'------ set file-size-limit to 6kb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-rotation-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size rotation policy',
- 'optionsString' : '--set file-size-limit:5kb',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get file-size-limit --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-rotation-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my size rotation policy',
- 'attributeName' : 'file-size-limit',
- 'expectedAttributeValue' : '5 kb'
- }
- </call>
+ <!--- Test Case : time limit Rotation policy -->
+ <!---
+ #@TestMarker Rotation Policy Properties Tests
+ #@TestName time limit Rotation policy
+ #@TestPurpose Check the time limit rotation policy properties.
+ #@TestPreamble none
+ #@TestStep Check the time limit rotation policy's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
+ <testcase name="getTestCaseName('time limit Rotation policy')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the time limit Rotation policy properties -----'
+ </message>
+ <!-- ################################-->
+ <!-- create-log-rotation-policy with the type time-limit -->
+ <message>
+ '------ create a time limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my time rotation policy',
+ 'optionsString' : '--type time-limit --set rotation-interval:3d',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>'------ get rotation-interval --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-rotation-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my time rotation policy',
+ 'attributeName' : 'rotation-interval',
+ 'extraParams' : '-m d',
+ 'expectedAttributeValue' : '3 d'
+ }
+ </call>
+
+ <!-- set rotation-interval -->
+ <message>'------ set rotation-interval to 3s --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-rotation-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my time rotation policy',
+ 'optionsString' : '--set rotation-interval:3s',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get rotation-interval --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-rotation-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my time rotation policy',
+ 'attributeName' : 'rotation-interval',
+ 'extraParams' : '-m s',
+ 'expectedAttributeValue' : '3 s'
+ }
+ </call>
+
+ <message>'------ delete a time limit rotation policy --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my time rotation policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
- <message>'------ delete a size limit rotation policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my size rotation policy',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
+ <!--- Test Case : fixed time limit Rotation policy -->
+
+ <!---
+ #@TestMarker Rotation Policy Properties Tests
+ #@TestName fixed time limit Rotation policy
+ #@TestIssue
+ #@TestPurpose Check the fixed time limit rotation policy properties.
+ #@TestPreamble none
+ #@TestStep Check the fixed time limit rotation policy's properties are correctly set and get using dsconfig
+ #@TestStep Set a property
+ #@TestStep Get the property and check it has been correctly updated
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0 for all operations
+ -->
- <!--- Test Case : time limit Rotation policy -->
- <!---
- #@TestMarker Rotation Policy Properties Tests
- #@TestName time limit Rotation policy
- #@TestPurpose Check the time limit rotation policy properties.
- #@TestPreamble none
- #@TestStep Check the time limit rotation policy's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
- <testcase name="getTestCaseName('time limit Rotation policy')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the time limit Rotation policy properties -----'
- </message>
- <!-- ################################-->
- <!-- create-log-rotation-policy with the type time-limit -->
- <message>
- '------ create a time limit rotation policy --'
- </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my time rotation policy',
- 'optionsString' : '--type time-limit --set rotation-interval:3d',
- 'expectedRC' : 0
- }
- </call>
-
- <message>'------ get rotation-interval --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-rotation-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my time rotation policy',
- 'attributeName' : 'rotation-interval',
- 'extraParams' : '-m d',
- 'expectedAttributeValue' : '3 d'
- }
- </call>
-
- <!-- set rotation-interval -->
- <message>'------ set rotation-interval to 3s --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-rotation-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my time rotation policy',
- 'optionsString' : '--set rotation-interval:3s',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get rotation-interval --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-rotation-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my time rotation policy',
- 'attributeName' : 'rotation-interval',
- 'extraParams' : '-m s',
- 'expectedAttributeValue' : '3 s'
- }
- </call>
-
- <message>'------ delete a time limit rotation policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my time rotation policy',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
+ <testcase name="getTestCaseName('fixed time limit Rotation policy')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the fixed time limit Rotation policy properties -----'
+ </message>
+
+ <!-- create-log-rotation-policy with the type fixed-time -->
+ <message>'------ create a fixed time limit rotation policy --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my fixedtime rotation policy',
+ 'optionsString' : '--type fixed-time --set time-of-day:1203',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>'------ get time-of-day --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-rotation-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my fixedtime rotation policy',
+ 'attributeName' : 'time-of-day',
+ 'expectedAttributeValue' : '1203'
+ }
+ </call>
+
+ <!-- set time-of-day -->
+ <message>'------ set time-of-day to 3s --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-rotation-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my fixedtime rotation policy',
+ 'optionsString' : '--set time-of-day:0934',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get time-of-day --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-rotation-policy' ,
+ 'propertyType' : 'policy' ,
+ 'propertyName' : 'my fixedtime rotation policy',
+ 'attributeName' : 'time-of-day',
+ 'expectedAttributeValue' : '0934'
+ }
+ </call>
+
+ <!-- delete-log-rotation-policy with the type fixed-time -->
+ <message>'------ delete a fixed time limit rotation policy --' </message>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my fixedtime rotation policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
</sequence>
- </testcase>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Log Rotation Properties Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
- <!--- Test Case : fixed time limit Rotation policy -->
-
- <!---
- #@TestMarker Rotation Policy Properties Tests
- #@TestName fixed time limit Rotation policy
- #@TestIssue
- #@TestPurpose Check the fixed time limit rotation policy properties.
- #@TestPreamble none
- #@TestStep Check the fixed time limit rotation policy's properties are correctly set and get using dsconfig
- #@TestStep Set a property
- #@TestStep Get the property and check it has been correctly updated
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0 for all operations
- -->
-
- <testcase name="getTestCaseName('fixed time limit Rotation policy')">
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the fixed time limit Rotation policy properties -----'
- </message>
-
- <!-- create-log-rotation-policy with the type fixed-time -->
- <message>'------ create a fixed time limit rotation policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'create-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my fixedtime rotation policy',
- 'optionsString' : '--type fixed-time --set time-of-day:1203',
- 'expectedRC' : 0
- }
- </call>
-
- <message>'------ get time-of-day --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'objectName' : 'log-rotation-policy',
- 'propertyType' : 'policy',
- 'propertyName' : 'my fixedtime rotation policy',
- 'attributeName' : 'time-of-day',
- 'expectedAttributeValue' : '1203'
- }
- </call>
-
- <!-- set time-of-day -->
- <message>'------ set time-of-day to 3s --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-log-rotation-policy-prop',
- 'objectType' : 'policy-name',
- 'objectName' : 'my fixedtime rotation policy',
- 'optionsString' : '--set time-of-day:0934',
- 'expectedRC' : 0
- }
- </call>
- <message>'------ get time-of-day --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-rotation-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my fixedtime rotation policy',
- 'attributeName' : 'time-of-day',
- 'expectedAttributeValue' : '0934'
- }
- </call>
-
- <!-- delete-log-rotation-policy with the type fixed-time -->
- <message>'------ delete a fixed time limit rotation policy --' </message>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'delete-log-rotation-policy',
- 'objectType' : 'policy-name',
- 'objectName' : 'my fixedtime rotation policy',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </try>
+ </block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_setup.xml
index 4b9839f..2d387ff 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_setup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_setup"/>
@@ -31,9 +31,19 @@
<sequence>
<block name="'setup'">
<sequence>
- <block name="'Block Create DS Topology'">
- <!-- Create the topology necessary to the test group/suite -->
+
+ <script>
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <testcase name="getTestCaseName('Logging Setup')">
+
<sequence>
+
+ <call function="'testCase_Preamble'"/>
+
<message>
'Create DS topology as described in config.py'
</message>
@@ -42,18 +52,6 @@
{ 'initialiseInstance' : True }
</call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
- </sequence>
- <!--- End Block Create DS Topology -->
- </block>
-
- <block name="'Block DS Process Active'">
- <!--- Start DS -->
- <sequence>
<message>
'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
@@ -63,23 +61,23 @@
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
<!--- Check that DS started -->
<call function="'isAlive'">
{ 'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
+
+ <call function="'testCase_Postamble'"/>
+
</sequence>
- <!--- End Block DS Process Active -->
- </block>
+
+ </testcase>
+
+ <call function="'testSuite_Postamble'"/>
+
</sequence>
</block>
- </sequence>
+ </sequence>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_writer.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_writer.xml
index db067ad..8fa8386 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_writer.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/logging/logging_writer.xml
@@ -23,29 +23,37 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_writer"/>
<function name="logging_writer" scope="local">
- <block name="STAXCurrentFunction">
+ <block name="STAXCurrentFunction">
+ <try>
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'"/>
-
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
-<!--- Test Suite information
-#@TestSuiteName Basic tests on logging
-#@TestSuitePurpose Check the log of information under Access or Debug files is correctly done
-#@TestSuiteID Logging
-#@TestSuiteGroup Logging
-#@TestGroup Logging
-#@TestScript logging_writer.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
+ <!--- Test Suite information
+ #@TestSuiteName Basic tests on logging
+ #@TestSuitePurpose Check the log of information under Access or Debug files is correctly done
+ #@TestSuiteID Logging
+ #@TestSuiteGroup Logging
+ #@TestGroup Logging
+ #@TestScript logging_writer.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
<!-- #################################### -->
<!--
#@TestMarker Basic tests on logging
@@ -329,8 +337,27 @@
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
- <call function="'testSuite_Postamble'"/>
+
</sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Log Writer Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring.xml
index 5d3342a..3634e5a 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<!--
@@ -31,37 +31,74 @@
#@TestGroupName Monitoring
#@TestGroupPurpose Test the ability of the server to monitor informations
-->
-
<stax>
- <defaultcall function="main_monitoring"/>
+ <defaultcall function="main_monitoring" />
<function name="main_monitoring">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
+
<sequence>
- <block name="'monitoring'">
- <sequence>
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
- <script>
- CurrentTestPath['group']='monitoring'
- </script>
-
- <call function="'testGroup_Preamble'" />
- <iterate var="_test" in="['setup','provider','componant','cleanup']" >
- <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/monitoring/monitoring_%s.xml' % (TESTS_DIR,_test)"/>
- <call function="'monitoring_%s' % _test" />
- </sequence>
- </iterate>
- <call function="'testGroup_Postamble'" />
- </sequence>
- </block>
+ <try>
+ <block name="'monitoring'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='monitoring'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('provider')
+ suiteList.append('componant')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s_%s.xml' % (TESTS_DIR,_group,_group,_suite)"/>
+ <call function="'%s_%s' % (_group,_suite)" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_componant.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_componant.xml
index f2dc657..afca974 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_componant.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_componant.xml
@@ -23,120 +23,145 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="monitoring_componant"/>
<function name="monitoring_componant" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
- <!--- Test Suite information
-#@TestSuiteName Monitoring componants
-#@TestSuitePurpose Verify the monitoring of componants
-#@TestSuiteID Monitoring
-#@TestSuiteGroup Monitoring
-#@TestGroup Monitoring
-#@TestScript monitoring_componants.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
- <!---
-#@TestMarker monitoring componants
-#@TestName monitoring componants
-#@TestIssue Check the monitoring of the componant Backup Backend
-#@TestPreamble none
-#@TestStep Check the entry on cn=backup Backend,cn=monitor,cn=monitor is available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Backup Backend monitoring')">
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Monitoring componants
+ #@TestSuitePurpose Verify the monitoring of componants
+ #@TestSuiteID Monitoring
+ #@TestSuiteGroup Monitoring
+ #@TestGroup Monitoring
+ #@TestScript monitoring_componants.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <!---
+ #@TestMarker monitoring componants
+ #@TestName monitoring componants
+ #@TestIssue Check the monitoring of the componant Backup Backend
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=backup Backend,cn=monitor,cn=monitor is available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Backup Backend monitoring')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!-- Check the entry on cn=backup Backend,cn=monitor is available -->
+ <message>'###### Monitor the Backup Backend ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=backup Backend,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!---
+ #@TestMarker monitoring componants
+ #@TestName monitoring componants
+ #@TestIssue Check the monitoring of the componant Database Backend
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=userRoot Backend,cn=monitor,cn=monitor is available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Database Backend monitoring')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!-- Check the entry on cn=userRoot Backend,cn=monitor is available -->
+ <message>'###### Monitor the dbName Backend ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=%s Backend,cn=monitor' % DIRECTORY_INSTANCE_BE,
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!---
+ #@TestMarker monitoring componants
+ #@TestName monitoring componants
+ #@TestIssue Check the monitoring of the componant tasks Backend
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=tasks Backend,cn=monitor,cn=monitor is available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Tasks Backend monitoring')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!-- Check the entry on cn=tasks Backend,cn=monitor is available -->
+ <message>'###### Monitor the tasks Backend ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=tasks Backend,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <!-- Check the entry on cn=backup Backend,cn=monitor is available -->
- <message>'###### Monitor the Backup Backend ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=backup Backend,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Monitoring Component Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
- <!---
-#@TestMarker monitoring componants
-#@TestName monitoring componants
-#@TestIssue Check the monitoring of the componant Database Backend
-#@TestPreamble none
-#@TestStep Check the entry on cn=userRoot Backend,cn=monitor,cn=monitor is available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Database Backend monitoring')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <!-- Check the entry on cn=userRoot Backend,cn=monitor is available -->
- <message>'###### Monitor the dbName Backend ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=%s Backend,cn=monitor' % DIRECTORY_INSTANCE_BE,
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!---
-#@TestMarker monitoring componants
-#@TestName monitoring componants
-#@TestIssue Check the monitoring of the componant tasks Backend
-#@TestPreamble none
-#@TestStep Check the entry on cn=tasks Backend,cn=monitor,cn=monitor is available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Tasks Backend monitoring')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <!-- Check the entry on cn=tasks Backend,cn=monitor is available -->
- <message>'###### Monitor the tasks Backend ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=tasks Backend,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_provider.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_provider.xml
index 3f8d6e3..158bc23 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_provider.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/monitoring/monitoring_provider.xml
@@ -23,476 +23,502 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="monitoring_provider"/>
<function name="monitoring_provider" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
-<!--- Test Suite information
-#@TestSuiteName Monitoring Provider Tests
-#@TestSuitePurpose Verify the monitoring Provider
-#@TestSuiteID Monitoring Provider
-#@TestSuiteGroup Monitoring
-#@TestGroup Monitoring
-#@TestScript monitoring_provider.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName Client Connections monitoring Provider
-#@TestPurpose Test the Client Connections monitoring Provider
-#@TestPreamble none
-#@TestStep Check the entry on cn=Client Connections,cn=monitor is available
-#@TestStep Disable the Client Connections monitoring Provider
-#@TestStep Check the entry on cn=Client Connections,cn=monitor is not more available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Client Connections monitoring Provider')">
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Monitoring Provider Tests
+ #@TestSuitePurpose Verify the monitoring Provider
+ #@TestSuiteID Monitoring Provider
+ #@TestSuiteGroup Monitoring
+ #@TestGroup Monitoring
+ #@TestScript monitoring_provider.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName Client Connections monitoring Provider
+ #@TestPurpose Test the Client Connections monitoring Provider
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=Client Connections,cn=monitor is available
+ #@TestStep Disable the Client Connections monitoring Provider
+ #@TestStep Check the entry on cn=Client Connections,cn=monitor is not more available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Client Connections monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <!-- Check the entry on cn=Client Connections,cn=monitor is available -->
+ <message>'###### Monitor the Client Connections ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Client Connections,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Disable the Client Connections monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'Client Connections',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <!-- Check the entry on cn=Client Connections,cn=monitor is not available -->
+ <message>'###### Monitor the Client Connections ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Client Connections,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName Entry Caches monitoring Provider
+ #@TestPurpose Test the Entry Caches monitoring Provider
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=Entry Caches,cn=monitor is available
+ #@TestStep Disable the Entry Caches monitoring Provider
+ #@TestStep Check the entry on cn=Entry Caches,cn=monitor is not more available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Entry Caches monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <!-- Check the entry on cn=Entry Caches,cn=monitor is available -->
+ <message>'###### Monitor the Entry Caches ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Entry Caches,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Disable the Entry Caches monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'Entry Caches',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <!-- Check the entry on cn=Entry Caches,cn=monitor is not available -->
+ <message>'###### Monitor the Entry Caches ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Entry Caches,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName JVM Memory Usage monitoring Provider
+ #@TestPurpose Test the JVM Memory Usage monitoring Provider
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=JVM Memory Usage,cn=monitor is available
+ #@TestStep Disable the JVM Memory Usage monitoring Provider
+ #@TestStep Check the entry on cn=JVM Memory Usage,cn=monitor is not more available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('JVM Memory Usage monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <!-- Check the entry on cn=JVM Memory Usage,cn=monitor is available -->
+ <message>'###### Monitor the JVM Memory Usage ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=JVM Memory Usage,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Disable the JVM Memory Usage monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'JVM Memory Usage',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <!-- Check the entry on cn=JVM Memory Usage,cn=monitor is not available -->
+ <message>'###### Monitor the JVM Memory Usage ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=JVM Memory Usage,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName JVM Stack Trace monitoring Provider
+ #@TestPurpose Test the JVM Stack Trace monitoring Provider
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=JVM Stack Trace,cn=monitor is available
+ #@TestStep Disable the JVM Stack Trace monitoring Provider
+ #@TestStep Check the entry on cn=JVM Stack Trace,cn=monitor is not more available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('JVM Stack Trace monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <!-- Check the entry on cn=JVM Stack Trace,cn=monitor is available -->
+ <message>'###### Monitor the JVM Stack Trace ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=JVM Stack Trace,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Disable the JVM Stack Trace monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'JVM Stack Trace',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <!-- Check the entry on cn=JVM Stack Trace,cn=monitor is not available -->
+ <message>'###### Monitor the JVM Stack Trace ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=JVM Stack Trace,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName System Info monitoring Provider
+ #@TestPurpose Test the System Info monitoring Provider
+ #@TestIssue 2873
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=System Info,cn=monitor is available
+ #@TestStep Disable the System Info monitoring Provider
+ #@TestStep Check the entry on cn=System Info,cn=monitor is not more available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('System Info monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <!-- Check the entry on cn=System Info,cn=monitor is available -->
+ <message>'###### Monitor the System Info ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=System Info,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 ,
+ 'knownIssue' : '2873' }
+ </call>
+
+ <message>'-- Disable the System Info monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'System Info',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <!-- Check the entry on cn=System Info,cn=monitor is not available -->
+ <message>'###### Monitor the System Info ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=System Info,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName Version monitoring Provider
+ #@TestPurpose Test the Version monitoring Provider
+ #@TestPreamble none
+ #@TestStep Check the entry on cn=Version,cn=monitor is available
+ #@TestStep Disable the Version monitoring Provider
+ #@TestStep Check the entry on cn=Version,cn=monitor is not more available
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Version monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <!-- Check the entry on cn=Version,cn=monitor is available -->
+ <message>'###### Monitor the Version ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Version,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Disable the Version monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'Version',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+ <!-- Check the entry on cn=Version,cn=monitor is not available -->
+ <message>'###### Monitor the Version ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Version,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!---
+ #@TestMarker Monitoring Provider Tests
+ #@TestName new monitoring provider
+ #@TestPurpose Test the creation of monitoring provider using dsconfig
+ #@TestPreamble none
+ #@TestStep create a new monitoring provider to manage version using dsconfig
+ #@TestStep Enable this monitoring Provider
+ #@TestStep Disable the initial monitoring Provider which manages the Version
+ #@TestStep Check the entry on cn=Version,cn=monitor is available
+ #@TestStep Delete the new monitor Provider
+ #@TestPostamble none
+
+ -->
+
+ <testcase name="getTestCaseName('Use a new monitoring Provider')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>'-- Create a new monitor provider for Version --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'create-monitor-provider' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'myVersion',
+ 'optionsString' : '--type version --set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Disable the Version monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'Version',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+ <!-- Check the entry on cn=Version,cn=monitor is not available -->
+ <message>'###### Monitor the Version ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Version,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 32 }
+ </call>
+
+ <message>'-- Enable the new Version monitor provider --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-monitor-provider-prop' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'myVersion',
+ 'optionsString' : '--set enabled:true',
+ 'expectedRC' : 0 }
+ </call>
+
+ <!-- Check the entry on cn=Version,cn=monitor is available -->
+ <message>'###### Monitor the Version ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=Version,cn=monitor',
+ 'dsFilter' : 'objectclass=*',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'-- Delete the new monitor provider for Version --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'delete-monitor-provider' ,
+ 'objectType' : 'provider-name',
+ 'objectName' : 'myVersion',
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <!-- Check the entry on cn=Client Connections,cn=monitor is available -->
- <message>'###### Monitor the Client Connections ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Client Connections,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Disable the Client Connections monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'Client Connections',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
-
- <!-- Check the entry on cn=Client Connections,cn=monitor is not available -->
- <message>'###### Monitor the Client Connections ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Client Connections,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Monitoring Component Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName Entry Caches monitoring Provider
-#@TestPurpose Test the Entry Caches monitoring Provider
-#@TestPreamble none
-#@TestStep Check the entry on cn=Entry Caches,cn=monitor is available
-#@TestStep Disable the Entry Caches monitoring Provider
-#@TestStep Check the entry on cn=Entry Caches,cn=monitor is not more available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Entry Caches monitoring Provider')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <!-- Check the entry on cn=Entry Caches,cn=monitor is available -->
- <message>'###### Monitor the Entry Caches ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Entry Caches,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Disable the Entry Caches monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'Entry Caches',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
-
- <!-- Check the entry on cn=Entry Caches,cn=monitor is not available -->
- <message>'###### Monitor the Entry Caches ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Entry Caches,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName JVM Memory Usage monitoring Provider
-#@TestPurpose Test the JVM Memory Usage monitoring Provider
-#@TestPreamble none
-#@TestStep Check the entry on cn=JVM Memory Usage,cn=monitor is available
-#@TestStep Disable the JVM Memory Usage monitoring Provider
-#@TestStep Check the entry on cn=JVM Memory Usage,cn=monitor is not more available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('JVM Memory Usage monitoring Provider')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <!-- Check the entry on cn=JVM Memory Usage,cn=monitor is available -->
- <message>'###### Monitor the JVM Memory Usage ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=JVM Memory Usage,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Disable the JVM Memory Usage monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'JVM Memory Usage',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
-
- <!-- Check the entry on cn=JVM Memory Usage,cn=monitor is not available -->
- <message>'###### Monitor the JVM Memory Usage ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=JVM Memory Usage,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName JVM Stack Trace monitoring Provider
-#@TestPurpose Test the JVM Stack Trace monitoring Provider
-#@TestPreamble none
-#@TestStep Check the entry on cn=JVM Stack Trace,cn=monitor is available
-#@TestStep Disable the JVM Stack Trace monitoring Provider
-#@TestStep Check the entry on cn=JVM Stack Trace,cn=monitor is not more available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('JVM Stack Trace monitoring Provider')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <!-- Check the entry on cn=JVM Stack Trace,cn=monitor is available -->
- <message>'###### Monitor the JVM Stack Trace ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=JVM Stack Trace,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Disable the JVM Stack Trace monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'JVM Stack Trace',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
-
- <!-- Check the entry on cn=JVM Stack Trace,cn=monitor is not available -->
- <message>'###### Monitor the JVM Stack Trace ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=JVM Stack Trace,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName System Info monitoring Provider
-#@TestPurpose Test the System Info monitoring Provider
-#@TestIssue 2873
-#@TestPreamble none
-#@TestStep Check the entry on cn=System Info,cn=monitor is available
-#@TestStep Disable the System Info monitoring Provider
-#@TestStep Check the entry on cn=System Info,cn=monitor is not more available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('System Info monitoring Provider')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <!-- Check the entry on cn=System Info,cn=monitor is available -->
- <message>'###### Monitor the System Info ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=System Info,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 ,
- 'knownIssue' : '2873' }
- </call>
-
- <message>'-- Disable the System Info monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'System Info',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
-
- <!-- Check the entry on cn=System Info,cn=monitor is not available -->
- <message>'###### Monitor the System Info ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=System Info,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName Version monitoring Provider
-#@TestPurpose Test the Version monitoring Provider
-#@TestPreamble none
-#@TestStep Check the entry on cn=Version,cn=monitor is available
-#@TestStep Disable the Version monitoring Provider
-#@TestStep Check the entry on cn=Version,cn=monitor is not more available
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Version monitoring Provider')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <!-- Check the entry on cn=Version,cn=monitor is available -->
- <message>'###### Monitor the Version ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Version,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Disable the Version monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'Version',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
- <!-- Check the entry on cn=Version,cn=monitor is not available -->
- <message>'###### Monitor the Version ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Version,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!---
-#@TestMarker Monitoring Provider Tests
-#@TestName new monitoring provider
-#@TestPurpose Test the creation of monitoring provider using dsconfig
-#@TestPreamble none
-#@TestStep create a new monitoring provider to manage version using dsconfig
-#@TestStep Enable this monitoring Provider
-#@TestStep Disable the initial monitoring Provider which manages the Version
-#@TestStep Check the entry on cn=Version,cn=monitor is available
-#@TestStep Delete the new monitor Provider
-#@TestPostamble none
-
--->
-
- <testcase name="getTestCaseName('Use a new monitoring Provider')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>'-- Create a new monitor provider for Version --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-monitor-provider' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'myVersion',
- 'optionsString' : '--type version --set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Disable the Version monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'Version',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
- <!-- Check the entry on cn=Version,cn=monitor is not available -->
- <message>'###### Monitor the Version ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Version,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 32 }
- </call>
-
- <message>'-- Enable the new Version monitor provider --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-monitor-provider-prop' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'myVersion',
- 'optionsString' : '--set enabled:true',
- 'expectedRC' : 0 }
- </call>
-
- <!-- Check the entry on cn=Version,cn=monitor is available -->
- <message>'###### Monitor the Version ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=Version,cn=monitor',
- 'dsFilter' : 'objectclass=*',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- Delete the new monitor provider for Version --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-monitor-provider' ,
- 'objectType' : 'provider-name',
- 'objectName' : 'myVersion',
- 'expectedRC' : 0 }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins.xml
index 4aaffa0..ae6ad3b 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
@@ -33,36 +33,76 @@
#@TestGroupPurpose Test the directory server Pluggins
-->
<stax>
- <defaultcall function="main_plugins"/>
+ <defaultcall function="main_plugins" />
<function name="main_plugins">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
+
<sequence>
- <block name="'plugins'">
- <sequence>
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
- <script>
- CurrentTestPath['group']='plugins'
- </script>
-
- <call function="'testGroup_Preamble'" />
- <!-- 'setup','7bit','uniqueness','lastmod','entryUUID','refint','cleanup' -->
- <iterate var="_test" in="['setup','7bit','uniqueness','lastmod','entryUUID','refint','cleanup']" >
- <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/plugins/plugins_%s.xml' % (TESTS_DIR,_test)"/>
- <call function="'plugins_%s' % _test" />
- </sequence>
- </iterate>
- <call function="'testGroup_Postamble'" />
- </sequence>
- </block>
+ <try>
+ <block name="'plugins'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='plugins'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('7bit')
+ suiteList.append('uniqueness')
+ suiteList.append('lastmod')
+ suiteList.append('entryUUID')
+ suiteList.append('refint')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s_%s.xml' % (TESTS_DIR,_group,_group,_suite)"/>
+ <call function="'%s_%s' % (_group,_suite)" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_7bit.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_7bit.xml
index 59c976d..6f695be 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_7bit.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_7bit.xml
@@ -23,265 +23,291 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="plugins_7bit"/>
<function name="plugins_7bit" scope="local">
- <block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
- <!--- Test Suite information
-#@TestSuiteName Plugin 7bit
-#@TestSuitePurpose Verify the plugin 7bit
-#@TestSuiteID Plugins
-#@TestSuiteGroup Plugins
-#@TestGroup Plugins
-#@TestScript plugins_7bit.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
- <!---
-#@TestMarker Plugin 7bit
-#@TestName Plugin 7bit setup
-#@TestPurpose Plugins 7bit setup
-#@TestPreamble none
-#@TestStep enable the 7-bit plugin
-#@TestPostamble none
-#@TestResult none
--->
+ <block name="STAXCurrentFunction">
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
- <testcase name="getTestCaseName('Plugins 7-Bit Clean setup')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>'-- Enable the plugin 7-Bit Clean --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-plugin-prop' ,
- 'objectType' : 'plugin-name',
- 'objectName' : '7-Bit Clean',
- 'optionsString' : '--set enabled:true',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!---
-#@TestMarker Plugin 7bit
-#@TestName Plugin 7bit with default attribute-type
-#@TestPurpose Check the server behavior when the plugin 7bit is activated
-#@TestPreamble none
-#@TestStep Enable the plugin 7bit
-#@TestStep Add an entry with a userPassword containing a non-ASCII
- character
-#@TestPostamble none
-#@TestResult The test is passed if the add operation is rejected
--->
-
- <testcase name="getTestCaseName('Plugins 7bit Clean with default attribute-type')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>'###### Add an entry ###### '</message>
- <!-- Add an entry -->
- <script>
- listAttr = []
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:organizationalperson')
- listAttr.append('objectclass:inetorgperson')
- listAttr.append('objectclass:person')
- listAttr.append('givenname:testuser_7bit')
- listAttr.append('sn:testuser_7bit')
- listAttr.append('cn:testuser_7bit')
- listAttr.append('mail:testuser_7bit')
- listAttr.append('userPassword:342Ã ')
- </script>
-
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
- 'listAttributes' : listAttr,
- 'expectedRC' : 19
- }
- </call>
-
- <!-- Cleanup -->
- <message>'###### Cleanup ###### '</message>
- <message>'-- Delete the test entry --'</message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-<!---
-#@TestMarker Plugin 7bit
-#@TestName Plugin 7bit with a new attribute-type
-#@TestPurpose Check the serve behavior when the plugin 7bit is checked on a new attribut-type
-#@TestPreamble none
-#@TestStep set a new attribut-type to the attribut street
-#@TestStep Add an entry with the attribut street containing a non-ASCII character
-#@TestPostamble none
-#@TestResult The test is passed if the add operation is rejected
--->
-
- <testcase name="getTestCaseName('Plugins 7bit Clean with a new attribute-type')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>'-- configure a new attribute-type for the plugin 7-Bit --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-plugin-prop' ,
- 'objectType' : 'plugin-name',
- 'objectName' : '7-Bit Clean',
- 'optionsString' : '--add attribute-type:street',
- 'expectedRC' : 0 }
- </call>
-
- <message>'###### Add an entry ###### '</message>
- <!-- Add an entry -->
- <script>
- listAttr = []
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:organizationalperson')
- listAttr.append('objectclass:inetorgperson')
- listAttr.append('objectclass:person')
- listAttr.append('givenname:testuser_7bit')
- listAttr.append('sn:testuser_7bit')
- listAttr.append('cn:testuser_7bit')
- listAttr.append('mail:testuser_7bit')
- listAttr.append('street:342Ã ')
- listAttr.append('userPassword:342')
- </script>
-
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
- 'listAttributes' : listAttr,
- 'expectedRC' : 19
- }
- </call>
-
- <!-- Cleanup -->
- <message>'###### Cleanup ###### '</message>
- <message>'-- Delete the test entry --'</message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-<!---
-#@TestMarker Plugin 7bit
-#@TestName disable Plugin 7bit
-#@TestPurpose Check the server behavior when the plugin 7bit is disabled
-#@TestPreamble none
-#@TestStep Disable the plugin 7-bit clean
-#@TestStep Add an entry with the attribut street containing a non-ASCII character
-#@TestPostamble none
-#@TestResult The test is passed if the add operation is accepted
--->
-
- <testcase name="getTestCaseName('Plugins 7bit Clean is disabled')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <message>'-- disable the plugin 7-Bit Clean --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-plugin-prop' ,
- 'objectType' : 'plugin-name',
- 'objectName' : '7-Bit Clean',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Suite information
+ #@TestSuiteName Plugin 7bit
+ #@TestSuitePurpose Verify the plugin 7bit
+ #@TestSuiteID Plugins
+ #@TestSuiteGroup Plugins
+ #@TestGroup Plugins
+ #@TestScript plugins_7bit.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+ <!---
+ #@TestMarker Plugin 7bit
+ #@TestName Plugin 7bit setup
+ #@TestPurpose Plugins 7bit setup
+ #@TestPreamble none
+ #@TestStep enable the 7-bit plugin
+ #@TestPostamble none
+ #@TestResult none
+ -->
- <message>'###### Add an entry ###### '</message>
- <!-- Add an entry -->
- <script>
- listAttr = []
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:organizationalperson')
- listAttr.append('objectclass:inetorgperson')
- listAttr.append('objectclass:person')
- listAttr.append('givenname:testuser_7bit')
- listAttr.append('sn:testuser_7bit')
- listAttr.append('cn:testuser_7bit')
- listAttr.append('mail:testuser_7bit')
- listAttr.append('street:342Ã ')
- listAttr.append('userPassword:342')
- </script>
-
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
- 'listAttributes' : listAttr,
- 'expectedRC' : 0
- }
- </call>
-
- <!-- Cleanup -->
- <message>'###### Cleanup ###### '</message>
- <message>'-- Delete the test entry --'</message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
- </block>
-</function>
+ <testcase name="getTestCaseName('Plugins 7-Bit Clean setup')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>'-- Enable the plugin 7-Bit Clean --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-plugin-prop' ,
+ 'objectType' : 'plugin-name',
+ 'objectName' : '7-Bit Clean',
+ 'optionsString' : '--set enabled:true',
+ 'expectedRC' : 0 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!---
+ #@TestMarker Plugin 7bit
+ #@TestName Plugin 7bit with default attribute-type
+ #@TestPurpose Check the server behavior when the plugin 7bit is activated
+ #@TestPreamble none
+ #@TestStep Enable the plugin 7bit
+ #@TestStep Add an entry with a userPassword containing a non-ASCII
+ character
+ #@TestPostamble none
+ #@TestResult The test is passed if the add operation is rejected
+ -->
+
+ <testcase name="getTestCaseName('Plugins 7bit Clean with default attribute-type')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>'###### Add an entry ###### '</message>
+ <!-- Add an entry -->
+ <script>
+ listAttr = []
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:organizationalperson')
+ listAttr.append('objectclass:inetorgperson')
+ listAttr.append('objectclass:person')
+ listAttr.append('givenname:testuser_7bit')
+ listAttr.append('sn:testuser_7bit')
+ listAttr.append('cn:testuser_7bit')
+ listAttr.append('mail:testuser_7bit')
+ listAttr.append('userPassword:342Ã ')
+ </script>
+
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
+ 'listAttributes' : listAttr,
+ 'expectedRC' : 19
+ }
+ </call>
+
+ <!-- Cleanup -->
+ <message>'###### Cleanup ###### '</message>
+ <message>'-- Delete the test entry --'</message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!---
+ #@TestMarker Plugin 7bit
+ #@TestName Plugin 7bit with a new attribute-type
+ #@TestPurpose Check the serve behavior when the plugin 7bit is checked on a new attribut-type
+ #@TestPreamble none
+ #@TestStep set a new attribut-type to the attribut street
+ #@TestStep Add an entry with the attribut street containing a non-ASCII character
+ #@TestPostamble none
+ #@TestResult The test is passed if the add operation is rejected
+ -->
+
+ <testcase name="getTestCaseName('Plugins 7bit Clean with a new attribute-type')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>'-- configure a new attribute-type for the plugin 7-Bit --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-plugin-prop' ,
+ 'objectType' : 'plugin-name',
+ 'objectName' : '7-Bit Clean',
+ 'optionsString' : '--add attribute-type:street',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'###### Add an entry ###### '</message>
+ <!-- Add an entry -->
+ <script>
+ listAttr = []
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:organizationalperson')
+ listAttr.append('objectclass:inetorgperson')
+ listAttr.append('objectclass:person')
+ listAttr.append('givenname:testuser_7bit')
+ listAttr.append('sn:testuser_7bit')
+ listAttr.append('cn:testuser_7bit')
+ listAttr.append('mail:testuser_7bit')
+ listAttr.append('street:342Ã ')
+ listAttr.append('userPassword:342')
+ </script>
+
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
+ 'listAttributes' : listAttr,
+ 'expectedRC' : 19
+ }
+ </call>
+
+ <!-- Cleanup -->
+ <message>'###### Cleanup ###### '</message>
+ <message>'-- Delete the test entry --'</message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
+ 'expectedRC' : 'noCheck'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!---
+ #@TestMarker Plugin 7bit
+ #@TestName disable Plugin 7bit
+ #@TestPurpose Check the server behavior when the plugin 7bit is disabled
+ #@TestPreamble none
+ #@TestStep Disable the plugin 7-bit clean
+ #@TestStep Add an entry with the attribut street containing a non-ASCII character
+ #@TestPostamble none
+ #@TestResult The test is passed if the add operation is accepted
+ -->
+
+ <testcase name="getTestCaseName('Plugins 7bit Clean is disabled')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <message>'-- disable the plugin 7-Bit Clean --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-plugin-prop' ,
+ 'objectType' : 'plugin-name',
+ 'objectName' : '7-Bit Clean',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+ <message>'###### Add an entry ###### '</message>
+ <!-- Add an entry -->
+ <script>
+ listAttr = []
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:organizationalperson')
+ listAttr.append('objectclass:inetorgperson')
+ listAttr.append('objectclass:person')
+ listAttr.append('givenname:testuser_7bit')
+ listAttr.append('sn:testuser_7bit')
+ listAttr.append('cn:testuser_7bit')
+ listAttr.append('mail:testuser_7bit')
+ listAttr.append('street:342Ã ')
+ listAttr.append('userPassword:342')
+ </script>
+
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
+ 'listAttributes' : listAttr,
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- Cleanup -->
+ <message>'###### Cleanup ###### '</message>
+ <message>'-- Delete the test entry --'</message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global 7 Bit Plugin Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_entryUUID.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_entryUUID.xml
index 5dc703c..e2f4d05 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_entryUUID.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_entryUUID.xml
@@ -23,265 +23,292 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="plugins_entryUUID"/>
<function name="plugins_entryUUID" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-<!--- Test Suite information
-#@TestSuiteName Plugin entryUUID
-#@TestSuitePurpose Verify the plugin entryUUID
-#@TestSuiteID Plugins
-#@TestSuiteGroup Plugins
-#@TestGroup Plugins
-#@TestScript plugins_entryUUID.xml
-#@TestHTMLLink http://opends.dev.java.net/
--->
-
-
-<!---
-#@TestMarker Plugin entryUUID
-#@TestName Plugin entryUUID setup
-#@TestPurpose Plugins entryUUID setup
-#@TestPreamble none
-#@TestStep Disable the virtual attribute entryUUID
-#@TestPostamble none
-#@TestResult none
--->
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
- <testcase name="getTestCaseName('Plugins entryUUID setup')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>'-- Disable the virtual attribute entryUUID --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-virtual-attribute-prop' ,
- 'objectType' : 'name',
- 'objectName' : 'entryUUID',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
-<!---
-#@TestMarker Plugin entryUUID
-#@TestName Plugin entryUUID enable
-#@TestPurpose Check the serve behavior when the plugin entryUUID is activated
-#@TestPreamble none
-#@TestStep Enable the plugin entryUUID
-#@TestStep Disable the virtual attribute entryUUID
-#@TestStep Add an entry
-#@TestStep Execute ldapsearch request to get entryUUID attribute
-#@TestPostamble none
-#@TestResult The test is passed if the attribute entryUUID is returned
--->
-
- <testcase name="getTestCaseName('Plugins entryUUID enable')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>'-- Activate the entryUUID plugin --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-plugin-prop' ,
- 'objectType' : 'plugin-name' ,
- 'objectName' : 'Entry UUID',
- 'optionsString' : '--set enabled:true',
- 'expectedRC' : 0 }
- </call>
-
-
- <message>'###### Add an entry ###### '</message>
- <!-- Add an entry -->
- <script>
- listAttr = []
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:organizationalperson')
- listAttr.append('objectclass:inetorgperson')
- listAttr.append('objectclass:person')
- listAttr.append('givenname:testuser_entryuuid')
- listAttr.append('sn:testuser_entryuuid')
- listAttr.append('cn:testuser_entryuuid')
- listAttr.append('mail:testuser_entryuuid')
- </script>
-
-
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
- 'listAttributes' : listAttr,
- 'expectedRC' : 0
- }
- </call>
-
-
- <!-- Check the plugin -->
- <message>'###### Check the plugin entryUUID ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
- 'dsFilter' : 'objectclass=*' ,
- 'dsScope' : 'base',
- 'attributes' : 'entryUUID',
- 'expectedRC' : 0 }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'entryUUID',
- 'expectedResult' : '1' }
- </call>
-
-
- <!-- Cleanup -->
- <message>'###### Cleanup ###### '</message>
- <message>'-- Delete the test entry --'</message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
- }
- </call>
-
- <message>'-- Disable the entryUUID plugin --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-plugin-prop' ,
- 'objectType' : 'plugin-name' ,
- 'objectName' : 'Entry UUID',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-<!---
-#@TestMarker Plugin entryUUID
-#@TestName Plugin entryUUID disable
-#@TestPurpose Check the server behavior when the plugin entryUUID is disabled
-#@TestPreamble none
-#@TestStep Disable the plugin entryUUID
-#@TestStep Disable the virtual attribute entryUUID
-#@TestStep Add an entry
-#@TestStep Execute ldapsearch request to get entryUUID attribute
-#@TestPostamble none
-#@TestResult The test is passed if the attribute entryUUID is not returned
--->
-
- <testcase name="getTestCaseName('Plugins entryUUID disable')">
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>'-- Disable the entryUUID plugin --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-plugin-prop' ,
- 'objectType' : 'plugin-name' ,
- 'objectName' : 'Entry UUID',
- 'optionsString' : '--set enabled:false',
- 'expectedRC' : 0 }
- </call>
-
-
- <!-- Add an entry -->
- <message>'###### Add an entry ###### '</message>
- <script>
- listAttr = []
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:organizationalperson')
- listAttr.append('objectclass:inetorgperson')
- listAttr.append('objectclass:person')
- listAttr.append('givenname:testuser_entryuuid')
- listAttr.append('sn:testuser_entryuuid')
- listAttr.append('cn:testuser_entryuuid')
- listAttr.append('mail:testuser_entryuuid')
- </script>
-
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
- 'listAttributes' : listAttr,
- 'expectedRC' : 0
- }
- </call>
-
- <!-- The plugin is disabled. the attribute entryUUID should not be returned -->
- <message>'###### Check the plugin entryUUID ###### '</message>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
- 'dsFilter' : 'objectclass=*' ,
- 'dsScope' : 'base',
- 'attributes' : 'entryUUID',
- 'expectedRC' : 0 }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'entryUUID',
- 'expectedResult' : '0' }
- </call>
-
- <message>'###### Cleanup ###### '</message>
- <message>'-- Delete the test entry --'</message>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
- }
- </call>
+ <!--- Test Suite information
+ #@TestSuiteName Plugin entryUUID
+ #@TestSuitePurpose Verify the plugin entryUUID
+ #@TestSuiteID Plugins
+ #@TestSuiteGroup Plugins
+ #@TestGroup Plugins
+ #@TestScript plugins_entryUUID.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
+
+
+ <!---
+ #@TestMarker Plugin entryUUID
+ #@TestName Plugin entryUUID setup
+ #@TestPurpose Plugins entryUUID setup
+ #@TestPreamble none
+ #@TestStep Disable the virtual attribute entryUUID
+ #@TestPostamble none
+ #@TestResult none
+ -->
+
+ <testcase name="getTestCaseName('Plugins entryUUID setup')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
+ <message>'-- Disable the virtual attribute entryUUID --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-virtual-attribute-prop' ,
+ 'objectType' : 'name',
+ 'objectName' : 'entryUUID',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
- <call function="'testSuite_Postamble'" />
- </sequence>
- </block>
-</function>
+
+ <!---
+ #@TestMarker Plugin entryUUID
+ #@TestName Plugin entryUUID enable
+ #@TestPurpose Check the serve behavior when the plugin entryUUID is activated
+ #@TestPreamble none
+ #@TestStep Enable the plugin entryUUID
+ #@TestStep Disable the virtual attribute entryUUID
+ #@TestStep Add an entry
+ #@TestStep Execute ldapsearch request to get entryUUID attribute
+ #@TestPostamble none
+ #@TestResult The test is passed if the attribute entryUUID is returned
+ -->
+
+ <testcase name="getTestCaseName('Plugins entryUUID enable')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>'-- Activate the entryUUID plugin --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-plugin-prop' ,
+ 'objectType' : 'plugin-name' ,
+ 'objectName' : 'Entry UUID',
+ 'optionsString' : '--set enabled:true',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <message>'###### Add an entry ###### '</message>
+ <!-- Add an entry -->
+ <script>
+ listAttr = []
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:organizationalperson')
+ listAttr.append('objectclass:inetorgperson')
+ listAttr.append('objectclass:person')
+ listAttr.append('givenname:testuser_entryuuid')
+ listAttr.append('sn:testuser_entryuuid')
+ listAttr.append('cn:testuser_entryuuid')
+ listAttr.append('mail:testuser_entryuuid')
+ </script>
+
+
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
+ 'listAttributes' : listAttr,
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <!-- Check the plugin -->
+ <message>'###### Check the plugin entryUUID ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsScope' : 'base',
+ 'attributes' : 'entryUUID',
+ 'expectedRC' : 0 }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'entryUUID',
+ 'expectedResult' : '1' }
+ </call>
+
+
+ <!-- Cleanup -->
+ <message>'###### Cleanup ###### '</message>
+ <message>'-- Delete the test entry --'</message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
+ }
+ </call>
+
+ <message>'-- Disable the entryUUID plugin --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-plugin-prop' ,
+ 'objectType' : 'plugin-name' ,
+ 'objectName' : 'Entry UUID',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!---
+ #@TestMarker Plugin entryUUID
+ #@TestName Plugin entryUUID disable
+ #@TestPurpose Check the server behavior when the plugin entryUUID is disabled
+ #@TestPreamble none
+ #@TestStep Disable the plugin entryUUID
+ #@TestStep Disable the virtual attribute entryUUID
+ #@TestStep Add an entry
+ #@TestStep Execute ldapsearch request to get entryUUID attribute
+ #@TestPostamble none
+ #@TestResult The test is passed if the attribute entryUUID is not returned
+ -->
+
+ <testcase name="getTestCaseName('Plugins entryUUID disable')">
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>'-- Disable the entryUUID plugin --'</message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-plugin-prop' ,
+ 'objectType' : 'plugin-name' ,
+ 'objectName' : 'Entry UUID',
+ 'optionsString' : '--set enabled:false',
+ 'expectedRC' : 0 }
+ </call>
+
+
+ <!-- Add an entry -->
+ <message>'###### Add an entry ###### '</message>
+ <script>
+ listAttr = []
+ listAttr.append('objectclass:top')
+ listAttr.append('objectclass:organizationalperson')
+ listAttr.append('objectclass:inetorgperson')
+ listAttr.append('objectclass:person')
+ listAttr.append('givenname:testuser_entryuuid')
+ listAttr.append('sn:testuser_entryuuid')
+ listAttr.append('cn:testuser_entryuuid')
+ listAttr.append('mail:testuser_entryuuid')
+ </script>
+
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
+ 'listAttributes' : listAttr,
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- The plugin is disabled. the attribute entryUUID should not be returned -->
+ <message>'###### Check the plugin entryUUID ###### '</message>
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsScope' : 'base',
+ 'attributes' : 'entryUUID',
+ 'expectedRC' : 0 }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'entryUUID',
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>'###### Cleanup ###### '</message>
+ <message>'-- Delete the test entry --'</message>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global UUID Plugin Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_lastmod.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_lastmod.xml
index b379a49..b10f975 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_lastmod.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_lastmod.xml
@@ -23,19 +23,26 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="plugins_lastmod"/>
<function name="plugins_lastmod" scope="local">
- <block name="STAXCurrentFunction">
+ <block name="STAXCurrentFunction">
+ <try>
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'" />
-
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
<testcase name="getTestCaseName('Plugins lastmod enabled for add operations')">
<sequence>
@@ -376,8 +383,27 @@
</sequence>
</testcase>
- <call function="'testSuite_Postamble'" />
- </sequence>
- </block>
-</function>
+
+ </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Last Mod Plugin Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_refint.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_refint.xml
index c0f7f29..14bbebc 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_refint.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_refint.xml
@@ -23,19 +23,26 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="plugins_refint"/>
<function name="plugins_refint" scope="local">
<block name="STAXCurrentFunction">
+ <try>
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'" />
-
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
<!--- Test Suite information
@@ -807,8 +814,26 @@
</sequence>
</testcase>
- <call function="'testSuite_Postamble'" />
</sequence>
- </block>
-</function>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Referential Integrety Plugin Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_uniqueness.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_uniqueness.xml
index 1279839..6a8046b 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_uniqueness.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/plugins/plugins_uniqueness.xml
@@ -23,18 +23,26 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="plugins_uniqueness"/>
<function name="plugins_uniqueness" scope="local">
<block name="STAXCurrentFunction">
+ <try>
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'" />
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
<!--- Test Suite information
#@TestSuiteName Plugin uniqueness
@@ -823,9 +831,27 @@
</testcase>
-
- <call function="'testSuite_Postamble'" />
+
</sequence>
- </block>
-</function>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Uniqueness Plugin Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+ </block>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml
index c6de689..95fa9ed 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml
@@ -23,78 +23,84 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
-
- <defaultcall function="main_privileges"/>
-
+ <defaultcall function="main_privileges" />
<function name="main_privileges">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
+
<sequence>
-
- <block name="'privileges'">
-
- <sequence>
-
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
+ <try>
+ <block name="'privileges'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='privileges'
+ _group=CurrentTestPath['group']
+
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('users')
+ suiteList.append('directory_manager')
+ suiteList.append('new_root_user')
+ suiteList.append('unindexed_searches')
+ suiteList.append('import_task')
+ suiteList.append('export_task')
+ suiteList.append('backup_task')
+ suiteList.append('restore_task')
+ </script>
- <script>
- CurrentTestPath['group']='privileges'
- GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'testGroup_Preamble'"/>
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s_%s.xml' % (TESTS_DIR,_group,_group,_suite)"/>
+ <call function="'%s_%s' % (_group,_suite)" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_users.xml' % (TESTS_DIR)"/>
- <call function="'privileges_users'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_directory_manager.xml' % (TESTS_DIR)"/>
- <call function="'privileges_directory_manager'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_new_root_user.xml' % (TESTS_DIR)"/>
- <call function="'privileges_new_root_user'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_unindexed_searches.xml' % (TESTS_DIR)"/>
- <call function="'privileges_unindexed_searches'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_import_task.xml' % (TESTS_DIR)"/>
- <call function="'privileges_import_task'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_export_task.xml' % (TESTS_DIR)"/>
- <call function="'privileges_export_task'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_backup_task.xml' % (TESTS_DIR)"/>
- <call function="'privileges_backup_task'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_restore_task.xml' % (TESTS_DIR)"/>
- <call function="'privileges_restore_task'" />
-
-
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
<call function="'testGroup_Postamble'"/>
-
- </sequence>
-
- </block>
-
+ </finally>
+ </try>
</sequence>
-
</function>
-
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_acis.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_acis.xml
new file mode 100755
index 0000000..87af3f5
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_acis.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE stax SYSTEM "../../../shared/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
+ !
+ ! Copyright 2009 Sun Microsystems, Inc.
+ ! -->
+<stax>
+
+ <defaultcall function="privileges_acis"/>
+
+ <function name="privileges_acis">
+ <function-map-args>
+ <function-arg-def name="globalAcis" type="optional" default="False">
+ <function-arg-description>
+ Specifies whether the test should use global acis.
+ </function-arg-description>
+ <function-arg-property name="type" value="boolean"/>
+ </function-arg-def>
+ </function-map-args>
+
+ <sequence>
+
+ <block name="'privileges_acis'">
+ <sequence>
+
+ <if expr="globalAcis == True">
+
+ <sequence>
+ <message>'Adding global ACIs.'</message>
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : '%s/privileges/privileges_global_acis.ldif' % remote.data
+ }
+ </call>
+ </sequence>
+ <else>
+ <sequence>
+ <message>'Adding entry ACIs.'</message>
+ <call function="'ldapModifyWithScript'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsFilename' : '%s/privileges/privileges_entry_acis.ldif' % remote.data
+ }
+ </call>
+ </sequence>
+ </else>
+ </if>
+
+ </sequence>
+ </block>
+ </sequence>
+ </function>
+
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml
index 4aaf3d5..0a790f9 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_backup_task.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,409 +34,433 @@
<sequence>
<block name="'privileges-backup-task'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Backup Tasks Tests
- #@TestSuitePurpose Test the basic Privileges Support in regard to basic users.
- #@TestSuiteGroup Basic Privileges Backup Tasks Tests
- #@TestScript privileges_backup_task.xml
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Backup Tasks Tests
- #@TestName backend-backup
- #@TestIssue 475
- #@TestPurpose Privileges for regular users to add backup tasks
- #@TestPreamble none
- #@TestStep User adding backup task.
- #@TestStep Admin adding privilege.
- #@TestStep User adding backup task.
- #@TestStep Admin adding global ACI.
- #@TestStep User adding backup task.
- #@TestStep Admin deleting privilege.
- #@TestStep Admin deleting global ACI.
- #@TestStep User adding backup task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, and 8 and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('backend-backup')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '3' ,
- 'backupDir' : '%s/privileges/' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'backend-backup' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '3' ,
- 'backupDir' : '%s/privileges/' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Admin adding global ACI'
- </message>
-
- <script>
- aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-backup-id || ds-task-backup-backend-id || ds-backup-directory-path\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '3' ,
- 'backupDir' : '%s/privileges/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'backend-backup' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Admin deleting global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '3.1' ,
- 'backupDir' : '%s/privileges/' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
+ <try>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Backup Tasks Tests
- #@TestName backend-backup, Directory Manager
- #@TestIssue 475
- #@TestPurpose Privileges for Directory Manager to add backup tasks
- #@TestPreamble none
- #@TestStep Directory Manager adding backup task.
- #@TestStep Alternative root user removing privilege.
- #@TestStep Directory Manager adding backup task.
- #@TestStep Alternative root user putting back privilege.
- #@TestStep Directory Manager adding backup task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 5 and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('backend-backup Directory Manager')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Directory Manager, DM adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '3.2' ,
- 'backupDir' : '%s/privileges/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Directory Manager, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-backup' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Directory Manager, DM adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '3.3' ,
- 'backupDir' : '%s/privileges/' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Directory Manager, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-backup' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, Directory Manager, DM adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '3.4' ,
- 'backupDir' : '%s/privileges/' % remote.data
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Backup Tasks Tests
- #@TestName backend-backup, New Root User
- #@TestIssue 475
- #@TestPurpose Privileges for new root user to add backup tasks
- #@TestPreamble Admin adds new root user.
- #@TestStep New root user adding backup task.
- #@TestStep Alternative root user removing privilege.
- #@TestStep New root user adding backup task.
- #@TestStep Alternative root user putting back privilege.
- #@TestStep New root user adding backup task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 5 and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('backend-backup New Root User')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, New Root User, preamble, alternative root user adding new root user'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, New Root User, new root user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '3.5' ,
- 'backupDir' : '%s/privileges/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, New Root User, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-backup' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, New Root User, new root user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '3.6' ,
- 'backupDir' : '%s/privileges/' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, New Root User, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-backup' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Backup Tasks: backend-backup, New Root User, new root user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '3.7' ,
- 'backupDir' : '%s/privileges/' % remote.data
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
- </sequence>
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Backup Tasks Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regard to basic users.
+ #@TestSuiteGroup Basic Privileges Backup Tasks Tests
+ #@TestScript privileges_backup_task.xml
+ -->
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Backup Tasks Tests
+ #@TestName backend-backup
+ #@TestIssue 475
+ #@TestPurpose Privileges for regular users to add backup tasks
+ #@TestPreamble none
+ #@TestStep User adding backup task.
+ #@TestStep Admin adding privilege.
+ #@TestStep User adding backup task.
+ #@TestStep Admin adding global ACI.
+ #@TestStep User adding backup task.
+ #@TestStep Admin deleting privilege.
+ #@TestStep Admin deleting global ACI.
+ #@TestStep User adding backup task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, and 8 and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('backend-backup')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '3' ,
+ 'backupDir' : '%s/privileges/' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'backend-backup' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '3' ,
+ 'backupDir' : '%s/privileges/' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Admin adding global ACI'
+ </message>
+
+ <script>
+ aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-backup-id || ds-task-backup-backend-id || ds-backup-directory-path\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '3' ,
+ 'backupDir' : '%s/privileges/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'backend-backup' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Admin deleting global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '3.1' ,
+ 'backupDir' : '%s/privileges/' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Backup Tasks Tests
+ #@TestName backend-backup, Directory Manager
+ #@TestIssue 475
+ #@TestPurpose Privileges for Directory Manager to add backup tasks
+ #@TestPreamble none
+ #@TestStep Directory Manager adding backup task.
+ #@TestStep Alternative root user removing privilege.
+ #@TestStep Directory Manager adding backup task.
+ #@TestStep Alternative root user putting back privilege.
+ #@TestStep Directory Manager adding backup task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 5 and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('backend-backup Directory Manager')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Directory Manager, DM adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '3.2' ,
+ 'backupDir' : '%s/privileges/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Directory Manager, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-backup' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Directory Manager, DM adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '3.3' ,
+ 'backupDir' : '%s/privileges/' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Directory Manager, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-backup' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, Directory Manager, DM adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '3.4' ,
+ 'backupDir' : '%s/privileges/' % remote.data
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Backup Tasks Tests
+ #@TestName backend-backup, New Root User
+ #@TestIssue 475
+ #@TestPurpose Privileges for new root user to add backup tasks
+ #@TestPreamble Admin adds new root user.
+ #@TestStep New root user adding backup task.
+ #@TestStep Alternative root user removing privilege.
+ #@TestStep New root user adding backup task.
+ #@TestStep Alternative root user putting back privilege.
+ #@TestStep New root user adding backup task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 5 and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('backend-backup New Root User')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, New Root User, preamble, alternative root user adding new root user'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, New Root User, new root user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '3.5' ,
+ 'backupDir' : '%s/privileges/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, New Root User, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-backup' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, New Root User, new root user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '3.6' ,
+ 'backupDir' : '%s/privileges/' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, New Root User, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-backup' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Backup Tasks: backend-backup, New Root User, new root user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '3.7' ,
+ 'backupDir' : '%s/privileges/' % remote.data
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Backup Task Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_directory_manager.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_directory_manager.xml
index d613e14..8acc522 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_directory_manager.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_directory_manager.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,1895 +34,1916 @@
<sequence>
<block name="'privileges-directory-manager'">
+
+ <try>
- <sequence>
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Directory Manager Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regard to basic Directory Manager.
+ #@TestSuiteGroup Basic Privileges Users Tests
+ #@TestScript privileges_directory_manager.xml
+ -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Directory Manager Tests
- #@TestSuitePurpose Test the basic Privileges Support in regard to basic Directory Manager.
- #@TestSuiteGroup Basic Privileges Users Tests
- #@TestScript privileges_directory_manager.xml
- -->
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName bypass-acl
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for Directory Manager
+ #@TestPreamble Alternate root user removes global search ACI.
+ #@TestStep Directory Manager searches entry.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager searches entry.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager searches entry.
+ #@TestStep Alternate root user puts back global search ACI.
+ #@TestStep Directory Manager searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName bypass-acl
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for Directory Manager
- #@TestPreamble Alternate root user removes global search ACI.
- #@TestStep Directory Manager searches entry.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager searches entry.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager searches entry.
- #@TestStep Alternate root user puts back global search ACI.
- #@TestStep Directory Manager searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, preamble, alternate root user removing global search ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn: Carter' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 0
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn: Carter' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate root user putting back global search ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 0
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName bypass-acl, alternate bind DN
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for Directory Manager using alternate bind dn
- #@TestPreamble Alternate root user removes global search ACI.
- #@TestStep Directory Manager searches entry.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Alternate root user puts back global search ACI.
- #@TestStep Directory Manager searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 32
- for step 2, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl, alternate bind DN')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate bind DN, alternate root user removing global search ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate bind DN, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 0
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn: Carter' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate bind DN, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'add' ,
- 'expectedRC' : 32
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate bind DN, alternate root user putting back global search ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: bypass-acl, alternate bind DN, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 0
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName modify-acl - add aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for Directory Manager - add aci
- #@TestPreamble none
- #@TestStep Directory Manager adds ACI, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager adds second ACI.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager adds second ACI.
- #@TestStep Alternate root removes first DM-added ACI.
- #@TestStep Alternate root removes second DM-added ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - add aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, check default, DM adding ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, DM adding ACI'
- </message>
-
- <script>
- search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, DM adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, alternate root user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - add aci, alternate root user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'delete' }
- </call>
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, preamble, alternate root user removing global search ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn: Carter' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn: Carter' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate root user putting back global search ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName modify-acl - replace aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for Directory Manager - replace aci
- #@TestPreamble none
- #@TestStep Directory Manager replaces ACI, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager replaces second ACI.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager replaces second ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - replace aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - replace aci, check default, DM replacing ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"rep_search_aci_tmorris\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - replace aci, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - replace aci, DM replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - replace aci, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - replace aci, DM replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' }
- </call>
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName bypass-acl, alternate bind DN
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for Directory Manager using alternate bind dn
+ #@TestPreamble Alternate root user removes global search ACI.
+ #@TestStep Directory Manager searches entry.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Alternate root user puts back global search ACI.
+ #@TestStep Directory Manager searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 32
+ for step 2, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl, alternate bind DN')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate bind DN, alternate root user removing global search ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate bind DN, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn: Carter' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate bind DN, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate bind DN, alternate root user putting back global search ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: bypass-acl, alternate bind DN, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName modify-acl - delete aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for Directory Manager - delete aci
- #@TestPreamble none
- #@TestStep Directory Manager deletes ACI, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager deletes second ACI.
- #@TestStep Alternate root user puts back privilege.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - delete aci')">
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName modify-acl - add aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for Directory Manager - add aci
+ #@TestPreamble none
+ #@TestStep Directory Manager adds ACI, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager adds second ACI.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager adds second ACI.
+ #@TestStep Alternate root removes first DM-added ACI.
+ #@TestStep Alternate root removes second DM-added ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - add aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, check default, DM adding ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, DM adding ACI'
+ </message>
+
+ <script>
+ search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, DM adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, alternate root user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - add aci, alternate root user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName modify-acl - replace aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for Directory Manager - replace aci
+ #@TestPreamble none
+ #@TestStep Directory Manager replaces ACI, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager replaces second ACI.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager replaces second ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - replace aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - replace aci, check default, DM replacing ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"rep_search_aci_tmorris\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - replace aci, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - replace aci, DM replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - replace aci, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - replace aci, DM replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName modify-acl - delete aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for Directory Manager - delete aci
+ #@TestPreamble none
+ #@TestStep Directory Manager deletes ACI, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager deletes second ACI.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - delete aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - delete aci, check default, DM deleting ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_gfarmer\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=gfarmer, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - delete aci, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - delete aci, DM delete ACI'
+ </message>
+
+ <script>
+ search2_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_abergin\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=abergin, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'delete' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: modify-acl - delete aci, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName config-read
+ #@TestIssue 472
+ #@TestPurpose config-read privilege for Directory Manager
+ #@TestPreamble none
+ #@TestStep Directory Manager searches cn=config, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager searches cn=config.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager searches cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('config-read')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: config-read, check default privilege, DM searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: cn=config' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'ds-cfg-check-schema:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-read, alternate root removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-read, DM searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-read, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-read, DM searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: cn=config' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName config-write
+ #@TestIssue 472
+ #@TestPurpose config-write privilege for Directory Manager
+ #@TestPreamble none
+ #@TestStep Directory Manager modifies cn=config, default behavior.
+ #@TestStep Alternate root user removes read privilege.
+ #@TestStep Directory Manager modifies cn=config.
+ #@TestStep Alternate root user removes write privilege.
+ #@TestStep Directory Manager modifies cn=config.
+ #@TestStep Alternate root user puts back read privilege.
+ #@TestStep Directory Manager modifies cn=config.
+ #@TestStep Alternate root user puts back write privilege.
+ #@TestStep Directory Manager modifies cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, 5, and 7 and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('config-write')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, check default privilege, DM modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, alternate root user removing read privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, DM modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, alternate root user removing write privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, DM modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, alternate root user putting back read privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, DM modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, alternate root user putting back write privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write, DM modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName config-write - add global aci
+ #@TestIssue 472
+ #@TestPurpose config-write privilege for Directory Manager - add global aci
+ #@TestPreamble none
+ #@TestStep Directory Manager adds global ACI, default behavior.
+ #@TestStep Alternate root user removes read privilege.
+ #@TestStep Directory Manager adds global ACI.
+ #@TestStep Alternate root user removes write privilege.
+ #@TestStep Alternate root user puts back read privilege.
+ #@TestStep Directory Manager modifies cn=config.
+ #@TestStep Alternate root user puts back write privilege.
+ #@TestStep Directory Manager modifies cn=config.
+ #@TestStep Alternate root deletes first DM-added global aci.
+ #@TestStep Alternate root deletes second DM-added global aci.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, 6, and 8, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('config-write - add global aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, check default, DM adding global ACI'
+ </message>
+
+ <script>
+ another_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, alternate root user removing config-read privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, DM adding ACI'
+ </message>
+
+ <script>
+ global2_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, alternate user removing config-write privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, alternate root user putting back config-read privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, DM adding global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, alternate root user putting back config-write privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, DM adding global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, alternate root user deleting write global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: config-write - add global aci, alternate root user deleting write global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName password-reset
+ #@TestIssue 479
+ #@TestPurpose password-reset privilege for Directory Manager
+ #@TestPreamble none
+ #@TestStep Directory Manager resets user password, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager resets user password.
+ #@TestStep Alternate root user puts privilege.
+ #@TestStep Directory Manager resets user password.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('password-reset')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: password-reset, check default privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'pickles' ,
+ 'changetype' : 'replace'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: password-reset, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-password-reset' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: password-reset, DM resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'pickles' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: password-reset, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-password-reset' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: password-reset, DM resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'pickles' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName update-schema
+ #@TestIssue 468
+ #@TestPurpose update-schema privilege for Directory Manager
+ #@TestPreamble none
+ #@TestStep Alternate root user adds entry that uses new object class.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager adds new schema object.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager adds new schema object.
+ #@TestStep Alternate root user adds entry that uses new object class.
+ #@TestStep Alternate root user searches new entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, 65 for step 1, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('update-schema')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, alternate root user adding entry that users new object class'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
+ 'expectedRC' : 65
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-update-schema' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, DM adding new schema object'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-update-schema' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, DM adding new schema object'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, alternate root user adding entry that users new object class'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: update-schema, alternate root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=sfish,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=sfish,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'uid: sfish' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName privilege-change
+ #@TestIssue 1213
+ #@TestPurpose privilege-change privilege for Directory Manager
+ #@TestPreamble Alternate root user adding write ACI
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager adds modify-acl privilege to second user.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager adds modify-acl privilege to second user.
+ #@TestStep Second user adds an ACI.
+ #@TestStep Directory Manager removes modify-acl privilege from second user.
+ #@TestStep Alternate root user deletes user-added ACI.
+ #@TestStep Alternate root user deletes write ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('privilege-change')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, preamble, alternate root user adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, alternate root user removing privilege from DM'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-privilege-change' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, DM adding privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, alternate root user putting back privilege to DM'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-privilege-change' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, DM adding privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, second user adding ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, DM removing privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, alternate root user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: privilege-change, alternate root user deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName server-shutdown
+ #@TestIssue 477
+ #@TestPurpose server-shutdown privilege for Directory Manager
+ #@TestPreamble none
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager adds shutdown task.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager adds shutdown task.
+ #@TestStep Directory Manager searches for an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('server-shutdown')">
+
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - delete aci, check default, DM deleting ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_gfarmer\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=gfarmer, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - delete aci, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - delete aci, DM delete ACI'
- </message>
-
- <script>
- search2_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_abergin\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=abergin, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'delete' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: modify-acl - delete aci, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName config-read
- #@TestIssue 472
- #@TestPurpose config-read privilege for Directory Manager
- #@TestPreamble none
- #@TestStep Directory Manager searches cn=config, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager searches cn=config.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager searches cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('config-read')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: config-read, check default privilege, DM searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: server-shutdown, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-shutdown' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: cn=config' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'ds-cfg-check-schema:' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-read, alternate root removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-read, DM searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' ,
+ 'taskID' : STAXCurrentTestcase,
'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-read, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'delete'
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: server-shutdown, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-shutdown' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : STAXCurrentTestcase,
}
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-read, DM searching cn=config'
- </message>
+ </call>
+
+ <if expr="STAFCmdRC != 0">
+ <tcstatus result="'fail'"/>
+ <else>
+ <!--- Start DS -->
+ <sequence>
+
+ <message>
+ 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
+ </message>
- <call function="'SearchObject'">
+ <!--- Start DS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <call function="'checkRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000 }
+ </call>
+ </sequence>
+ <!--- End Block DS Process Active -->
+ </else>
+ </if>
+
+ <message>
+ 'Privileges: Directory Manager: server-shutdown, DM searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Directory Manager Tests
+ #@TestName server-restart
+ #@TestIssue 477
+ #@TestPurpose server-restart privilege for Directory Manager
+ #@TestPreamble none
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Directory Manager adds restart task.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep Directory Manager adds restart task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('server-restart')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Directory Manager: server-restart, alternate root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-restart' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: server-restart, DM adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: server-restart, alternate root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-restart' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Directory Manager: server-restart, DM adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: cn=config' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ 'taskID' : STAXCurrentTestcase
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
</sequence>
</testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName config-write
- #@TestIssue 472
- #@TestPurpose config-write privilege for Directory Manager
- #@TestPreamble none
- #@TestStep Directory Manager modifies cn=config, default behavior.
- #@TestStep Alternate root user removes read privilege.
- #@TestStep Directory Manager modifies cn=config.
- #@TestStep Alternate root user removes write privilege.
- #@TestStep Directory Manager modifies cn=config.
- #@TestStep Alternate root user puts back read privilege.
- #@TestStep Directory Manager modifies cn=config.
- #@TestStep Alternate root user puts back write privilege.
- #@TestStep Directory Manager modifies cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, 5, and 7 and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('config-write')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: config-write, check default privilege, DM modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, alternate root user removing read privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, DM modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, alternate root user removing write privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, DM modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, alternate root user putting back read privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, DM modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, alternate root user putting back write privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write, DM modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' }
- </call>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName config-write - add global aci
- #@TestIssue 472
- #@TestPurpose config-write privilege for Directory Manager - add global aci
- #@TestPreamble none
- #@TestStep Directory Manager adds global ACI, default behavior.
- #@TestStep Alternate root user removes read privilege.
- #@TestStep Directory Manager adds global ACI.
- #@TestStep Alternate root user removes write privilege.
- #@TestStep Alternate root user puts back read privilege.
- #@TestStep Directory Manager modifies cn=config.
- #@TestStep Alternate root user puts back write privilege.
- #@TestStep Directory Manager modifies cn=config.
- #@TestStep Alternate root deletes first DM-added global aci.
- #@TestStep Alternate root deletes second DM-added global aci.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, 6, and 8, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('config-write - add global aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, check default, DM adding global ACI'
- </message>
-
- <script>
- another_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, alternate root user removing config-read privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, DM adding ACI'
- </message>
-
- <script>
- global2_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, alternate user removing config-write privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, alternate root user putting back config-read privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, DM adding global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, alternate root user putting back config-write privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, DM adding global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, alternate root user deleting write global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'delete'
- }
- </call>
+ </sequence>
- <message>
- 'Privileges: Directory Manager: config-write - add global aci, alternate root user deleting write global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName password-reset
- #@TestIssue 479
- #@TestPurpose password-reset privilege for Directory Manager
- #@TestPreamble none
- #@TestStep Directory Manager resets user password, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager resets user password.
- #@TestStep Alternate root user puts privilege.
- #@TestStep Directory Manager resets user password.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('password-reset')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: password-reset, check default privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'pickles' ,
- 'changetype' : 'replace'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: password-reset, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-password-reset' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: password-reset, DM resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'pickles' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: password-reset, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-password-reset' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: password-reset, DM resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'pickles' ,
- 'changetype' : 'replace' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName update-schema
- #@TestIssue 468
- #@TestPurpose update-schema privilege for Directory Manager
- #@TestPreamble none
- #@TestStep Alternate root user adds entry that uses new object class.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager adds new schema object.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager adds new schema object.
- #@TestStep Alternate root user adds entry that uses new object class.
- #@TestStep Alternate root user searches new entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, 65 for step 1, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('update-schema')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: update-schema, alternate root user adding entry that users new object class'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
- 'expectedRC' : 65
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: update-schema, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-update-schema' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: update-schema, DM adding new schema object'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: update-schema, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-update-schema' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: update-schema, DM adding new schema object'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: update-schema, alternate root user adding entry that users new object class'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: update-schema, alternate root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=sfish,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=sfish,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'uid: sfish' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName privilege-change
- #@TestIssue 1213
- #@TestPurpose privilege-change privilege for Directory Manager
- #@TestPreamble Alternate root user adding write ACI
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager adds modify-acl privilege to second user.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager adds modify-acl privilege to second user.
- #@TestStep Second user adds an ACI.
- #@TestStep Directory Manager removes modify-acl privilege from second user.
- #@TestStep Alternate root user deletes user-added ACI.
- #@TestStep Alternate root user deletes write ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('privilege-change')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, preamble, alternate root user adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, alternate root user removing privilege from DM'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-privilege-change' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, DM adding privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, alternate root user putting back privilege to DM'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-privilege-change' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, DM adding privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, second user adding ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, DM removing privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, alternate root user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: privilege-change, alternate root user deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName server-shutdown
- #@TestIssue 477
- #@TestPurpose server-shutdown privilege for Directory Manager
- #@TestPreamble none
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager adds shutdown task.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager adds shutdown task.
- #@TestStep Directory Manager searches for an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('server-shutdown')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: server-shutdown, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-shutdown' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: server-shutdown, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-shutdown' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase,
- }
- </call>
-
- <if expr="STAFCmdRC != 0">
- <tcstatus result="'fail'"/>
- <else>
- <!--- Start DS -->
- <sequence>
-
- <message>
- 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <!--- Start DS -->
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
- </sequence>
- <!--- End Block DS Process Active -->
- </else>
- </if>
-
- <message>
- 'Privileges: Directory Manager: server-shutdown, DM searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Directory Manager Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
+ </finally>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Directory Manager Tests
- #@TestName server-restart
- #@TestIssue 477
- #@TestPurpose server-restart privilege for Directory Manager
- #@TestPreamble none
- #@TestStep Alternate root user removes privilege.
- #@TestStep Directory Manager adds restart task.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep Directory Manager adds restart task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('server-restart')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Directory Manager: server-restart, alternate root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-restart' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: server-restart, DM adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: server-restart, alternate root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-restart' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Directory Manager: server-restart, DM adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml
index 672fd72..e3cce64 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_export_task.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,411 +34,435 @@
<sequence>
<block name="'privileges-export-task'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Export Tasks Tests
- #@TestSuitePurpose Test the basic Privileges Support in regard to basic users.
- #@TestSuiteGroup Basic Privileges Export Tasks Tests
- #@TestScript privileges_export_task.xml
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Export Tasks Tests
- #@TestName ldif-export
- #@TestIssue 474
- #@TestPurpose Privileges for regular users to add export tasks
- #@TestPreamble none
- #@TestStep User adding export task.
- #@TestStep Admin adding privilege.
- #@TestStep User adding export task.
- #@TestStep Admin adding global ACI.
- #@TestStep User adding export task.
- #@TestStep Admin deleting privilege.
- #@TestStep Admin deleting global ACI.
- #@TestStep User adding export task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3 and 8, and 0
- for all other ldap operations.
- Proper entries returned for searches.
- -->
- <testcase name="getTestCaseName('export-ldif')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '1' ,
- 'ldifFile' : '%s/privileges/export_task_out.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'ldif-export' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '1' ,
- 'ldifFile' : '%s/privileges/export_task_out.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Admin adding global ACI'
- </message>
-
- <script>
- aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-export-backend-id || ds-task-export-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '1' ,
- 'ldifFile' : '%s/privileges/export_task_out.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'ldif-export' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Admin deleting global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : '1.1' ,
- 'ldifFile' : '%s/privileges/export_task_out2.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
+ <try>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Export Tasks Tests
- #@TestName ldif-export, Directory Manager
- #@TestIssue 474
- #@TestPurpose Privileges for Directory Manager to add export tasks
- #@TestPreamble none
- #@TestStep Directory Manager adding export task.
- #@TestStep Alternative root user removing privilege from Directory Manager.
- #@TestStep Directory Manager adding export task.
- #@TestStep Alternative root user putting back privilege to Directory Manager.
- #@TestStep Directory Manager adding export task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('export-ldif Directory Manager')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Directory Manager, DM adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '1.1' ,
- 'ldifFile' : '%s/privileges/export_task_out3.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Directory Manager, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-export' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Directory Manager, DM adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '1.2' ,
- 'ldifFile' : '%s/privileges/export_task_out4.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Directory Manager, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-export' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, Directory Manager, DM adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '1.3' ,
- 'ldifFile' : '%s/privileges/export_task_out5.ldif' % remote.data
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Export Tasks Tests
- #@TestName ldif-export, New Root User
- #@TestIssue 474
- #@TestPurpose Privileges for new root user to add export tasks
- #@TestPreamble Admin adds new root user.
- #@TestStep New root user adding export task.
- #@TestStep Alternative root user removing privilege from new root user.
- #@TestStep New root user adding export task.
- #@TestStep Alternative root user putting back privilege to new root user.
- #@TestStep New root user adding export task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('export-ldif New Root User')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, New Root User, preamble, alternative root user adding new root user'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, New Root User, new root user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '1.4' ,
- 'ldifFile' : '%s/privileges/export_task_out6.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, New Root User, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-export' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, New Root User, new root user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '1.5' ,
- 'ldifFile' : '%s/privileges/export_task_out7.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, New Root User, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-export' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Export Tasks: export-ldif, New Root User, new root user adding export task'
- </message>
-
- <call function="'exportLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '1.6' ,
- 'ldifFile' : '%s/privileges/export_task_out8.ldif' % remote.data
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
- </sequence>
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Export Tasks Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regard to basic users.
+ #@TestSuiteGroup Basic Privileges Export Tasks Tests
+ #@TestScript privileges_export_task.xml
+ -->
+
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Export Tasks Tests
+ #@TestName ldif-export
+ #@TestIssue 474
+ #@TestPurpose Privileges for regular users to add export tasks
+ #@TestPreamble none
+ #@TestStep User adding export task.
+ #@TestStep Admin adding privilege.
+ #@TestStep User adding export task.
+ #@TestStep Admin adding global ACI.
+ #@TestStep User adding export task.
+ #@TestStep Admin deleting privilege.
+ #@TestStep Admin deleting global ACI.
+ #@TestStep User adding export task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3 and 8, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('export-ldif')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '1' ,
+ 'ldifFile' : '%s/privileges/export_task_out.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'ldif-export' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '1' ,
+ 'ldifFile' : '%s/privileges/export_task_out.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Admin adding global ACI'
+ </message>
+
+ <script>
+ aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-export-backend-id || ds-task-export-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '1' ,
+ 'ldifFile' : '%s/privileges/export_task_out.ldif' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'ldif-export' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Admin deleting global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : '1.1' ,
+ 'ldifFile' : '%s/privileges/export_task_out2.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Export Tasks Tests
+ #@TestName ldif-export, Directory Manager
+ #@TestIssue 474
+ #@TestPurpose Privileges for Directory Manager to add export tasks
+ #@TestPreamble none
+ #@TestStep Directory Manager adding export task.
+ #@TestStep Alternative root user removing privilege from Directory Manager.
+ #@TestStep Directory Manager adding export task.
+ #@TestStep Alternative root user putting back privilege to Directory Manager.
+ #@TestStep Directory Manager adding export task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('export-ldif Directory Manager')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Directory Manager, DM adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '1.1' ,
+ 'ldifFile' : '%s/privileges/export_task_out3.ldif' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Directory Manager, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-export' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Directory Manager, DM adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '1.2' ,
+ 'ldifFile' : '%s/privileges/export_task_out4.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Directory Manager, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-export' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, Directory Manager, DM adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '1.3' ,
+ 'ldifFile' : '%s/privileges/export_task_out5.ldif' % remote.data
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Export Tasks Tests
+ #@TestName ldif-export, New Root User
+ #@TestIssue 474
+ #@TestPurpose Privileges for new root user to add export tasks
+ #@TestPreamble Admin adds new root user.
+ #@TestStep New root user adding export task.
+ #@TestStep Alternative root user removing privilege from new root user.
+ #@TestStep New root user adding export task.
+ #@TestStep Alternative root user putting back privilege to new root user.
+ #@TestStep New root user adding export task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('export-ldif New Root User')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, New Root User, preamble, alternative root user adding new root user'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, New Root User, new root user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '1.4' ,
+ 'ldifFile' : '%s/privileges/export_task_out6.ldif' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, New Root User, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-export' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, New Root User, new root user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '1.5' ,
+ 'ldifFile' : '%s/privileges/export_task_out7.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, New Root User, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-export' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Export Tasks: export-ldif, New Root User, new root user adding export task'
+ </message>
+
+ <call function="'exportLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '1.6' ,
+ 'ldifFile' : '%s/privileges/export_task_out8.ldif' % remote.data
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Export Task Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_import_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_import_task.xml
index d8bc7f9..fd31b45 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_import_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_import_task.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,431 +34,456 @@
<sequence>
<block name="'privileges-import-task'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Import Tasks Tests
- #@TestSuitePurpose Test the basic Privileges Support in regrad to basic users.
- #@TestSuiteGroup Basic Privileges Import Tasks Tests
- #@TestScript privileges_import_task.xml
- -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Import Tasks Tests
- #@TestName ldif-import
- #@TestIssue 474
- #@TestPurpose Privileges for regular users to add import tasks
- #@TestPreamble none
- #@TestStep User adding import task.
- #@TestStep Admin adding privilege.
- #@TestStep User adding import task.
- #@TestStep Admin adding global ACI.
- #@TestStep User adding import task.
- #@TestStep Admin deleting global ACI.
- #@TestStep Admin searching an entry that was imported.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 3, and 0
- for all other ldap operations.
- Proper entries returned for searches.
- -->
- <testcase name="getTestCaseName('import-ldif')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, user adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
- % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'ldif-import' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, user adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
- % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Admin adding ACI'
- </message>
-
- <script>
- aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-import-backend-id || ds-task-import-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, user adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Admin deleting global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: bypass-acl, Admin searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=rhunt, ou=People, ou=import task, o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=rhunt,ou=People,ou=import task,o=Privileges Tests' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
+ <try>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Import Tasks Tests
- #@TestName ldif-import, Directory Manager
- #@TestIssue 474
- #@TestPurpose Privileges for Directory Manager to add import tasks
- #@TestPreamble none
- #@TestStep Alternative root user removing privilege from Directory Manager.
- #@TestStep Directory Manager adding import task.
- #@TestStep Alternative root user putting back privilege to Directory Manager.
- #@TestStep Directory Manager adding import task.
- #@TestStep Alternative root user searching an entry that was imported.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- Proper entries returned for searches.
- -->
- <testcase name="getTestCaseName('import-ldif Directory Manager')">
+ <sequence>
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Directory Manager, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-import' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Directory Manager, DM adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
- % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Directory Manager, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-import' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Directory Manager, DM adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
- % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, Directory Manager, alternative root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=rhunt, ou=People, ou=import task, o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=rhunt,ou=People,ou=import task,o=Privileges Tests' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Import Task Tests
- #@TestName ldif-import, New Root User
- #@TestIssue 474
- #@TestPurpose Privileges for new root user to add import tasks
- #@TestPreamble Admin adds new root user.
- #@TestStep Alternative root user removing privilege from new root user.
- #@TestStep New root user adding import task.
- #@TestStep Alternative root user putting back privilege to new root user.
- #@TestStep New root user adding import task.
- #@TestStep Alternative root user searching an entry that was imported.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- Proper entries returned for searches.
- -->
- <testcase name="getTestCaseName('import-ldif New Root User')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, New Root User, preamble, Admin adding new root user'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, New Root User, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-import' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, New Root User, new root user adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
- % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, New Root User, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-ldif-import' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, New Root User, new root user adding import task'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
- % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Import Tasks: import-ldif, New Root User, alternative root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=rhunt, ou=People, ou=import task, o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=rhunt,ou=People,ou=import task,o=Privileges Tests' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
- </sequence>
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Import Tasks Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regrad to basic users.
+ #@TestSuiteGroup Basic Privileges Import Tasks Tests
+ #@TestScript privileges_import_task.xml
+ -->
+
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Import Tasks Tests
+ #@TestName ldif-import
+ #@TestIssue 474
+ #@TestPurpose Privileges for regular users to add import tasks
+ #@TestPreamble none
+ #@TestStep User adding import task.
+ #@TestStep Admin adding privilege.
+ #@TestStep User adding import task.
+ #@TestStep Admin adding global ACI.
+ #@TestStep User adding import task.
+ #@TestStep Admin deleting global ACI.
+ #@TestStep Admin searching an entry that was imported.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 3, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('import-ldif')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, user adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
+ % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'ldif-import' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, user adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
+ % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Admin adding ACI'
+ </message>
+
+ <script>
+ aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-import-backend-id || ds-task-import-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, user adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Admin deleting global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: bypass-acl, Admin searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=rhunt, ou=People, ou=import task, o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=rhunt,ou=People,ou=import task,o=Privileges Tests' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Import Tasks Tests
+ #@TestName ldif-import, Directory Manager
+ #@TestIssue 474
+ #@TestPurpose Privileges for Directory Manager to add import tasks
+ #@TestPreamble none
+ #@TestStep Alternative root user removing privilege from Directory Manager.
+ #@TestStep Directory Manager adding import task.
+ #@TestStep Alternative root user putting back privilege to Directory Manager.
+ #@TestStep Directory Manager adding import task.
+ #@TestStep Alternative root user searching an entry that was imported.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('import-ldif Directory Manager')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Directory Manager, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-import' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Directory Manager, DM adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
+ % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Directory Manager, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-import' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Directory Manager, DM adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
+ % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, Directory Manager, alternative root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=rhunt, ou=People, ou=import task, o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=rhunt,ou=People,ou=import task,o=Privileges Tests' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Import Task Tests
+ #@TestName ldif-import, New Root User
+ #@TestIssue 474
+ #@TestPurpose Privileges for new root user to add import tasks
+ #@TestPreamble Admin adds new root user.
+ #@TestStep Alternative root user removing privilege from new root user.
+ #@TestStep New root user adding import task.
+ #@TestStep Alternative root user putting back privilege to new root user.
+ #@TestStep New root user adding import task.
+ #@TestStep Alternative root user searching an entry that was imported.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('import-ldif New Root User')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, New Root User, preamble, Admin adding new root user'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, New Root User, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-import' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, New Root User, new root user adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
+ % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, New Root User, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-ldif-import' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, New Root User, new root user adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_import_task/import_task.ldif' \
+ % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Import Tasks: import-ldif, New Root User, alternative root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=rhunt, ou=People, ou=import task, o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=rhunt,ou=People,ou=import task,o=Privileges Tests' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Import Task Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_new_root_user.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_new_root_user.xml
index 13cc04c..cf2c011 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_new_root_user.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_new_root_user.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,1874 +34,1897 @@
<sequence>
<block name="'privileges-new-root-user'">
+
+ <try>
- <sequence>
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Directory Manager Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regard to basic Directory Manager.
+ #@TestSuiteGroup Basic Privileges Users Tests
+ #@TestScript privileges_directory_manager.xml
+ -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Directory Manager Tests
- #@TestSuitePurpose Test the basic Privileges Support in regard to basic Directory Manager.
- #@TestSuiteGroup Basic Privileges Users Tests
- #@TestScript privileges_directory_manager.xml
- -->
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName preamble
+ #@TestIssue 468
+ #@TestPurpose Preamble - add a new root user
+ #@TestPreamble none
+ #@TestStep Admin adds a new root user.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all ldap operations, and
+ and entry is returned only for step 1.
+ -->
+ <testcase name="getTestCaseName('preamble')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName preamble
- #@TestIssue 468
- #@TestPurpose Preamble - add a new root user
- #@TestPreamble none
- #@TestStep Admin adds a new root user.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all ldap operations, and
- and entry is returned only for step 1.
- -->
- <testcase name="getTestCaseName('preamble')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: preamble, Admin adding new root user'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
- </call>
+ <message>
+ 'Privileges: New Root User: preamble, Admin adding new root user'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName bypass-acl
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for new root user
- #@TestPreamble Alternate root user removes global search ACI.
- #@TestStep New root user searches entry.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user searches entry.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user searches entry.
- #@TestStep Alternate root user puts back global search ACI.
- #@TestStep New root user searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternative root user removing search global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn: Carter' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn: Carter' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternative root user putting back global search ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName bypass-acl, alternate bind DN
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for new root user using alternate bind dn
- #@TestPreamble Alternate root user removes global search ACI.
- #@TestStep New root user searches entry.
- #@TestStep Alternate root user removes privilege.
- #@TestStep Alternate root user puts back global search ACI.
- #@TestStep New root user searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 32
- for step 2, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl, alternate bind DN')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternate bind DN, alternative root user removing search global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternate bind DN, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'sn: Carter' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternate bind DN, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'add' ,
- 'expectedRC' : 32
- }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternate bind DN, alternative root user putting back global search ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: bypass-acl, alternate bind DN, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName modify-acl - add aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for new root user - add aci
- #@TestPreamble none
- #@TestStep New root user adds ACI, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user adds second ACI.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user adds second ACI.
- #@TestStep Alternate root removes first ACI.
- #@TestStep Alternate root removes second ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - add aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, check default, new root user adding ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, new root user adding second ACI'
- </message>
-
- <script>
- search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, new root user adding second ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, alternative root user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - add aci, alternative root user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'delete' }
- </call>
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName bypass-acl
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for new root user
+ #@TestPreamble Alternate root user removes global search ACI.
+ #@TestStep New root user searches entry.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user searches entry.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user searches entry.
+ #@TestStep Alternate root user puts back global search ACI.
+ #@TestStep New root user searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternative root user removing search global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn: Carter' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn: Carter' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternative root user putting back global search ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName modify-acl - replace aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for new root user - replace aci
- #@TestPreamble none
- #@TestStep New root user replaces ACI, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user replaces second ACI.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user replaces second ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - replace aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: modify-acl - replace aci, preamble, check default, new root user replacing ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"rep_search_aci_tmorris\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - replace aci, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - replace aci, new root user replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - replace aci, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - replace aci, new root user replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' }
- </call>
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName bypass-acl, alternate bind DN
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for new root user using alternate bind dn
+ #@TestPreamble Alternate root user removes global search ACI.
+ #@TestStep New root user searches entry.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep Alternate root user puts back global search ACI.
+ #@TestStep New root user searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 32
+ for step 2, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl, alternate bind DN')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternate bind DN, alternative root user removing search global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternate bind DN, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'sn: Carter' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternate bind DN, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternate bind DN, alternative root user putting back global search ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: bypass-acl, alternate bind DN, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName modify-acl - delete aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for new root user - delete aci
- #@TestPreamble none
- #@TestStep New root user deletes ACI, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user deletes second ACI.
- #@TestStep Alternate root user puts back privilege.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - delete aci')">
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName modify-acl - add aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for new root user - add aci
+ #@TestPreamble none
+ #@TestStep New root user adds ACI, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user adds second ACI.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user adds second ACI.
+ #@TestStep Alternate root removes first ACI.
+ #@TestStep Alternate root removes second ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - add aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, check default, new root user adding ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, new root user adding second ACI'
+ </message>
+
+ <script>
+ search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, new root user adding second ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, alternative root user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - add aci, alternative root user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName modify-acl - replace aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for new root user - replace aci
+ #@TestPreamble none
+ #@TestStep New root user replaces ACI, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user replaces second ACI.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user replaces second ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - replace aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - replace aci, preamble, check default, new root user replacing ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"rep_search_aci_tmorris\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - replace aci, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - replace aci, new root user replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - replace aci, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - replace aci, new root user replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName modify-acl - delete aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for new root user - delete aci
+ #@TestPreamble none
+ #@TestStep New root user deletes ACI, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user deletes second ACI.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - delete aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - delete aci, preamble, check default, new root user deleting ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_gfarmer\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=gfarmer, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - delete aci, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - delete aci, new root user delete ACI'
+ </message>
+
+ <script>
+ search2_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_abergin\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=abergin, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'delete' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: modify-acl - delete aci, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName config-read
+ #@TestIssue 472
+ #@TestPurpose config-read privilege for new root user
+ #@TestPreamble none
+ #@TestStep New root user searches cn=config, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user searches cn=config.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user searches cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('config-read')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: config-read, new root user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: cn=config' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'ds-cfg-check-schema:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-read, alternative root removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-read, new root user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-read, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-read, new root user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: cn=config' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName config-write
+ #@TestIssue 472
+ #@TestPurpose config-write privilege for new root user
+ #@TestPreamble none
+ #@TestStep New root user modifies cn=config, default behavior.
+ #@TestStep Alternate root user removes read privilege.
+ #@TestStep New root user modifies cn=config.
+ #@TestStep Alternate root user removes write privilege.
+ #@TestStep New root user modifies cn=config.
+ #@TestStep Alternate root user puts back read privilege.
+ #@TestStep New root user modifies cn=config.
+ #@TestStep Alternate root user puts back write privilege.
+ #@TestStep New root user modifies cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, 5, and 7 and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('config-write')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: config-write, new root user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, new root user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, new root user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, altrnative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, new root user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write, new root user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName config-write - add global aci
+ #@TestIssue 472
+ #@TestPurpose config-write privilege for new root user - add global aci
+ #@TestPreamble none
+ #@TestStep New root user adds global ACI, default behavior.
+ #@TestStep Alternate root user removes read privilege.
+ #@TestStep New root user adds global ACI.
+ #@TestStep Alternate root user removes write privilege.
+ #@TestStep Alternate root user puts back read privilege.
+ #@TestStep New root user modifies cn=config.
+ #@TestStep Alternate root user puts back write privilege.
+ #@TestStep New root user modifies cn=config.
+ #@TestStep Alternate root deletes first added global aci.
+ #@TestStep Alternate root deletes second added global aci.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, 6, and 8, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('config-write - add global aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, new root user adding global ACI'
+ </message>
+
+ <script>
+ another_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, alternative root user removing config-read privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, new root user adding ACI'
+ </message>
+
+ <script>
+ global2_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, altrnative user removing config-write privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, alternative root user putting back config-read privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-read' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, new root user adding global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, alternative root user putting back config-write privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-config-write' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, new root user adding global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, new root user deleting write global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: config-write - add global aci, new root user deleting write global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName password-reset
+ #@TestIssue 479
+ #@TestPurpose password-reset privilege for new root user
+ #@TestPreamble none
+ #@TestStep New root user resets user password, default behavior.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user resets user password.
+ #@TestStep Alternate root user puts privilege.
+ #@TestStep New root user resets user password.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('password-reset')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: password-reset, new root user resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'pickles' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: password-reset, alternative root user adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-password-reset' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: password-reset, new root user resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'pickles' ,
+ 'changetype' : 'replace',
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: password-reset, alternative root user deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-password-reset' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: password-reset, new root user resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'pickles' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName update-schema
+ #@TestIssue 468
+ #@TestPurpose update-schema privilege for new root user
+ #@TestPreamble none
+ #@TestStep Alternate root user adds entry that uses new object class.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user adds new schema object.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user adds new schema object.
+ #@TestStep Alternate root user adds entry that uses new object class.
+ #@TestStep Alternate root user searches new entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, 65 for step 1, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('update-schema')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: update-schema, alternate root user adding entry that users new object class'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
+ 'expectedRC' : 65
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: update-schema, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-update-schema' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: update-schema, new root user adding new schema object'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: update-schema, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-update-schema' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: update-schema, new root user adding new schema object'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: update-schema, alternate root user adding entry that users new object class'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: update-schema, alternate root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=sfish,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=sfish,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'uid: sfish' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName privilege-change
+ #@TestIssue 1213
+ #@TestPurpose privilege-change privilege for new root user
+ #@TestPreamble Alternate root user adding write ACI
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user adds modify-acl privilege to second user.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user adds modify-acl privilege to second user.
+ #@TestStep Second user adds an ACI.
+ #@TestStep New root user removes modify-acl privilege from second user.
+ #@TestStep Alternate root user deletes user-added ACI.
+ #@TestStep Alternate root user deletes write ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('privilege-change')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, alternative root user adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, alternative root user removing privilege from new root user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-privilege-change' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, new root user adding privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, alternative root user putting back privilege to new root user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-privilege-change' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, new root user adding privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, second user adding ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, new root user removing privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, alternative root user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: privilege-change, alternative root user deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName server-shutdown
+ #@TestIssue 477
+ #@TestPurpose server-shutdown privilege for new root user
+ #@TestPreamble none
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user adds shutdown task.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user adds shutdown task.
+ #@TestStep New root user searches for an entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('server-shutdown')">
+
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: modify-acl - delete aci, preamble, check default, new root user deleting ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_gfarmer\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=gfarmer, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - delete aci, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - delete aci, new root user delete ACI'
- </message>
-
- <script>
- search2_aci="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_abergin\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=abergin, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'delete' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: modify-acl - delete aci, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName config-read
- #@TestIssue 472
- #@TestPurpose config-read privilege for new root user
- #@TestPreamble none
- #@TestStep New root user searches cn=config, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user searches cn=config.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user searches cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('config-read')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: config-read, new root user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: server-shutdown, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-shutdown' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: server-shutdown, new root user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : 'cn=Zroot' ,
'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: cn=config' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'ds-cfg-check-schema:' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-read, alternative root removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-read, new root user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' ,
+ 'taskID' : STAXCurrentTestcase,
'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: New Root User: config-read, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'delete' }
- </call>
+ </call>
+
+ <message>
+ 'Privileges: New Root User: server-shutdown, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-shutdown' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: server-shutdown, new root user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : STAXCurrentTestcase,
+ }
+ </call>
+
+ <if expr="STAFCmdRC != 0">
+ <tcstatus result="'fail'"/>
+ <else>
+ <!--- Start DS -->
+ <sequence>
+
+ <message>
+ 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
+ </message>
- <message>
- 'Privileges: New Root User: config-read, new root user searching cn=config'
- </message>
+ <!--- Start DS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
- <call function="'SearchObject'">
+ <call function="'checkRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000 }
+ </call>
+ </sequence>
+ <!--- End Block DS Process Active -->
+ </else>
+ </if>
+
+ <message>
+ 'Privileges: New Root User: server-shutdown, new root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges New Root User Tests
+ #@TestName server-restart
+ #@TestIssue 477
+ #@TestPurpose server-restart privilege for new root user
+ #@TestPreamble none
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user adds restart task.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user adds restart task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('server-restart')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: New Root User: server-restart, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-restart' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: server-restart, new root user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: server-restart, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-server-restart' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: New Root User: server-restart, new root user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : 'cn=Zroot' ,
'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: cn=config' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ 'taskID' : STAXCurrentTestcase
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
</sequence>
</testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName config-write
- #@TestIssue 472
- #@TestPurpose config-write privilege for new root user
- #@TestPreamble none
- #@TestStep New root user modifies cn=config, default behavior.
- #@TestStep Alternate root user removes read privilege.
- #@TestStep New root user modifies cn=config.
- #@TestStep Alternate root user removes write privilege.
- #@TestStep New root user modifies cn=config.
- #@TestStep Alternate root user puts back read privilege.
- #@TestStep New root user modifies cn=config.
- #@TestStep Alternate root user puts back write privilege.
- #@TestStep New root user modifies cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, 5, and 7 and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('config-write')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: config-write, new root user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, new root user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, new root user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, altrnative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, new root user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write, new root user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' }
- </call>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName config-write - add global aci
- #@TestIssue 472
- #@TestPurpose config-write privilege for new root user - add global aci
- #@TestPreamble none
- #@TestStep New root user adds global ACI, default behavior.
- #@TestStep Alternate root user removes read privilege.
- #@TestStep New root user adds global ACI.
- #@TestStep Alternate root user removes write privilege.
- #@TestStep Alternate root user puts back read privilege.
- #@TestStep New root user modifies cn=config.
- #@TestStep Alternate root user puts back write privilege.
- #@TestStep New root user modifies cn=config.
- #@TestStep Alternate root deletes first added global aci.
- #@TestStep Alternate root deletes second added global aci.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, 6, and 8, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('config-write - add global aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, new root user adding global ACI'
- </message>
-
- <script>
- another_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, alternative root user removing config-read privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, new root user adding ACI'
- </message>
-
- <script>
- global2_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, altrnative user removing config-write privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, alternative root user putting back config-read privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-read' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, new root user adding global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, alternative root user putting back config-write privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-config-write' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, new root user adding global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, new root user deleting write global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: config-write - add global aci, new root user deleting write global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName password-reset
- #@TestIssue 479
- #@TestPurpose password-reset privilege for new root user
- #@TestPreamble none
- #@TestStep New root user resets user password, default behavior.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user resets user password.
- #@TestStep Alternate root user puts privilege.
- #@TestStep New root user resets user password.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('password-reset')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: password-reset, new root user resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'pickles' ,
- 'changetype' : 'replace' }
- </call>
-
- <message>
- 'Privileges: New Root User: password-reset, alternative root user adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-password-reset' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: password-reset, new root user resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'pickles' ,
- 'changetype' : 'replace',
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: password-reset, alternative root user deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-password-reset' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: password-reset, new root user resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=tmason, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'pickles' ,
- 'changetype' : 'replace' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName update-schema
- #@TestIssue 468
- #@TestPurpose update-schema privilege for new root user
- #@TestPreamble none
- #@TestStep Alternate root user adds entry that uses new object class.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user adds new schema object.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user adds new schema object.
- #@TestStep Alternate root user adds entry that uses new object class.
- #@TestStep Alternate root user searches new entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, 65 for step 1, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('update-schema')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: update-schema, alternate root user adding entry that users new object class'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
- 'expectedRC' : 65
- }
- </call>
-
- <message>
- 'Privileges: New Root User: update-schema, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-update-schema' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: update-schema, new root user adding new schema object'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: update-schema, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-update-schema' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: update-schema, new root user adding new schema object'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: New Root User: update-schema, alternate root user adding entry that users new object class'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: New Root User: update-schema, alternate root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=sfish,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=sfish,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'uid: sfish' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName privilege-change
- #@TestIssue 1213
- #@TestPurpose privilege-change privilege for new root user
- #@TestPreamble Alternate root user adding write ACI
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user adds modify-acl privilege to second user.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user adds modify-acl privilege to second user.
- #@TestStep Second user adds an ACI.
- #@TestStep New root user removes modify-acl privilege from second user.
- #@TestStep Alternate root user deletes user-added ACI.
- #@TestStep Alternate root user deletes write ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('privilege-change')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: privilege-change, alternative root user adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, alternative root user removing privilege from new root user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-privilege-change' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, new root user adding privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, alternative root user putting back privilege to new root user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-privilege-change' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, new root user adding privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, second user adding ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, new root user removing privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, alternative root user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: privilege-change, alternative root user deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName server-shutdown
- #@TestIssue 477
- #@TestPurpose server-shutdown privilege for new root user
- #@TestPreamble none
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user adds shutdown task.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user adds shutdown task.
- #@TestStep New root user searches for an entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('server-shutdown')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: server-shutdown, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-shutdown' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: server-shutdown, new root user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: server-shutdown, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-shutdown' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: server-shutdown, new root user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- }
- </call>
-
- <if expr="STAFCmdRC != 0">
- <tcstatus result="'fail'"/>
- <else>
- <!--- Start DS -->
- <sequence>
-
- <message>
- 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <!--- Start DS -->
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
- </sequence>
- <!--- End Block DS Process Active -->
- </else>
- </if>
-
- <message>
- 'Privileges: New Root User: server-shutdown, new root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges New Root User Tests
- #@TestName server-restart
- #@TestIssue 477
- #@TestPurpose server-restart privilege for new root user
- #@TestPreamble none
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user adds restart task.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user adds restart task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('server-restart')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: New Root User: server-restart, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-restart' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: New Root User: server-restart, new root user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: New Root User: server-restart, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-server-restart' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: New Root User: server-restart, new root user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
+ </sequence>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Root User Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml
index c00c634..0e3d054 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_restore_task.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,585 +34,609 @@
<sequence>
<block name="'privileges-restore-task'">
+
+ <try>
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Restore Tasks Tests
- #@TestSuitePurpose Test the basic Privileges Support in regard to basic users.
- #@TestSuiteGroup Basic Privileges Restore Tasks Tests
- #@TestScript privileges_restore_task.xml
- -->
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
-
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
<!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Restore Tasks Tests
- #@TestName backend-restore
- #@TestIssue 475
- #@TestPurpose Privileges for regular users to add restore tasks
- #@TestPreamble Admin add import task to add entries.
- #@TestStep Admin adding backup task.
- #@TestStep Admin delete entry.
- #@TestStep Admin search entry that was deleted.
- #@TestStep Admin adding privilege.
- #@TestStep User adding restore task.
- #@TestStep Admin adding global ACI.
- #@TestStep User adding restore task.
- #@TestStep Admin deleting global ACI.
- #@TestStep Admin searching deleted entry that was restored.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 5, 32 for step 3, and 0
- for all other ldap operations.
- Proper entries returned for searches.
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Restore Tasks Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regard to basic users.
+ #@TestSuiteGroup Basic Privileges Restore Tasks Tests
+ #@TestScript privileges_restore_task.xml
-->
- <testcase name="getTestCaseName('backend-restore')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin adding import task to create entries'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_restore_task/restore_task.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : '6' ,
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin deleting entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeModified' : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 32
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'backend-restore' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, user adding restore task'
- </message>
-
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : '6.1',
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin adding global ACI'
- </message>
-
- <script>
- aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-id || ds-backup-directory-path || ds-task-restore-verify-only\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, user adding restore task'
- </message>
-
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : '6.2',
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin deleting global ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Admin searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=tmorris,ou=People,ou=restore task,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
+
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Restore Tasks Tests
+ #@TestName backend-restore
+ #@TestIssue 475
+ #@TestPurpose Privileges for regular users to add restore tasks
+ #@TestPreamble Admin add import task to add entries.
+ #@TestStep Admin adding backup task.
+ #@TestStep Admin delete entry.
+ #@TestStep Admin search entry that was deleted.
+ #@TestStep Admin adding privilege.
+ #@TestStep User adding restore task.
+ #@TestStep Admin adding global ACI.
+ #@TestStep User adding restore task.
+ #@TestStep Admin deleting global ACI.
+ #@TestStep Admin searching deleted entry that was restored.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 5, 32 for step 3, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('backend-restore')">
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Restore Tasks Tests
- #@TestName backend-restore, Directory Manager
- #@TestIssue 475
- #@TestPurpose Privileges for Directory Manager to add restore tasks
- #@TestPreamble Alternative root user add import task to add entries.
- #@TestStep Alternative root user adding backup task.
- #@TestStep Alternative root user delete entry.
- #@TestStep Alternative root user search entry that was deleted.
- #@TestStep Alternative root user removing privilege from Directory Manager.
- #@TestStep Directory Manager adding restore task.
- #@TestStep Alternative root user putting back privilege to Directory Manager.
- #@TestStep Directory Manager adding restore task.
- #@TestStep Alternative root user searching deleted entry that was restored.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 5, 32 for step 3, and 0
- for all other ldap operations.
- Proper entries returned for searches.
- -->
- <testcase name="getTestCaseName('backend-restore Directory Manager')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user adding import task to create entries'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_restore_task/restore_task.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '6.3' ,
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user deleting entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeModified' : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 32
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-restore' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, DM adding restore task'
- </message>
-
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : '6.4',
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-restore' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, DM adding restore task'
- </message>
-
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'taskID' : '6.5',
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=tmorris,ou=People,ou=restore task,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
+ <sequence>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Restore Tasks Tests
- #@TestName backend-restore, New User Root
- #@TestIssue 475
- #@TestPurpose Privileges for new root user to add restore tasks
- #@TestPreamble Alternative root user adding new root user.
- #@TestStep Alternative root user add import task to add entries.
- #@TestStep Alternative root user adding backup task.
- #@TestStep Alternative root user delete entry.
- #@TestStep Alternative root user search entry that was deleted.
- #@TestStep Alternative root user removing privilege from new root user.
- #@TestStep New root user adding restore task.
- #@TestStep Alternative root user putting back privilege to new root user.
- #@TestStep New root user adding restore task.
- #@TestStep Alternative root user searching deleted entry that was restored.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 6, 32 for step 4, and 0
- for all other ldap operations.
- Proper entries returned for searches.
- -->
- <testcase name="getTestCaseName('backend-restore New User Root')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, preamble, alternative root user adding new root user'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin adding import task to create entries'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_restore_task/restore_task.ldif' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : '6' ,
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin deleting entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeModified' : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'backend-restore' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, user adding restore task'
+ </message>
+
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : '6.1',
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin adding global ACI'
+ </message>
+
+ <script>
+ aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-id || ds-backup-directory-path || ds-task-restore-verify-only\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, user adding restore task'
+ </message>
+
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : '6.2',
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin deleting global ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Admin searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=tmorris,ou=People,ou=restore task,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Restore Tasks Tests
+ #@TestName backend-restore, Directory Manager
+ #@TestIssue 475
+ #@TestPurpose Privileges for Directory Manager to add restore tasks
+ #@TestPreamble Alternative root user add import task to add entries.
+ #@TestStep Alternative root user adding backup task.
+ #@TestStep Alternative root user delete entry.
+ #@TestStep Alternative root user search entry that was deleted.
+ #@TestStep Alternative root user removing privilege from Directory Manager.
+ #@TestStep Directory Manager adding restore task.
+ #@TestStep Alternative root user putting back privilege to Directory Manager.
+ #@TestStep Directory Manager adding restore task.
+ #@TestStep Alternative root user searching deleted entry that was restored.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 5, 32 for step 3, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('backend-restore Directory Manager')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user adding import task to create entries'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : 'cn=Aroot' ,
'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user adding import task to create entries'
- </message>
-
- <call function="'importLdifTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : STAXCurrentTestcase,
- 'ldifFile' : '%s/privileges/privileges_restore_task/restore_task.ldif' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, new root user adding backup task'
- </message>
-
- <call function="'backupTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '6.6' ,
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user deleting entry'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'entryToBeModified' : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid',
- 'expectedRC' : 32
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_restore_task/restore_task.ldif' % remote.data
}
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-restore' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, new root user adding restore task'
- </message>
-
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '6.7',
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-backend-restore' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, new root user adding restore task'
- </message>
-
- <call function="'restoreTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'taskID' : '6.8',
- 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
- }
- </call>
-
- <message>
- 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=tmorris,ou=People,ou=restore task,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user adding backup task'
+ </message>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '6.3' ,
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user deleting entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeModified' : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-restore' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, DM adding restore task'
+ </message>
+
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : '6.4',
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Directory Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-restore' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, DM adding restore task'
+ </message>
+
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'taskID' : '6.5',
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, Directory Manager, alternative root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=tmorris,ou=People,ou=restore task,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Restore Tasks Tests
+ #@TestName backend-restore, New User Root
+ #@TestIssue 475
+ #@TestPurpose Privileges for new root user to add restore tasks
+ #@TestPreamble Alternative root user adding new root user.
+ #@TestStep Alternative root user add import task to add entries.
+ #@TestStep Alternative root user adding backup task.
+ #@TestStep Alternative root user delete entry.
+ #@TestStep Alternative root user search entry that was deleted.
+ #@TestStep Alternative root user removing privilege from new root user.
+ #@TestStep New root user adding restore task.
+ #@TestStep Alternative root user putting back privilege to new root user.
+ #@TestStep New root user adding restore task.
+ #@TestStep Alternative root user searching deleted entry that was restored.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 6, 32 for step 4, and 0
+ for all other ldap operations.
+ Proper entries returned for searches.
+ -->
+ <testcase name="getTestCaseName('backend-restore New User Root')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, preamble, alternative root user adding new root user'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeAdded' : '%s/privileges/add_new_root_user.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user adding import task to create entries'
+ </message>
+
+ <call function="'importLdifTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : STAXCurrentTestcase,
+ 'ldifFile' : '%s/privileges/privileges_restore_task/restore_task.ldif' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, new root user adding backup task'
+ </message>
+
+ <call function="'backupTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '6.6' ,
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user deleting entry'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'entryToBeModified' : '%s/privileges/privileges_restore_task/del_entry.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid',
+ 'expectedRC' : 32
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-restore' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, new root user adding restore task'
+ </message>
+
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '6.7',
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-backend-restore' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, new root user adding restore task'
+ </message>
+
+ <call function="'restoreTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'taskID' : '6.8',
+ 'backupDir' : '%s/privileges/privileges_restore_task/' % remote.data
+ }
+ </call>
+
+ <message>
+ 'Privileges: Restore Tasks: backend-restore, New User Root, alternative root user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'dsBaseDN' : 'uid=tmorris,ou=People,ou=restore task,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=tmorris,ou=People,ou=restore task,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Restore Task Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_unindexed_searches.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_unindexed_searches.xml
index ba5dcad..a7096fb 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_unindexed_searches.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_unindexed_searches.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,658 +34,682 @@
<sequence>
<block name="'privileges-unindexed-searches'">
+
+ <try>
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!--- Define default value for ldifFile1, ldifFile2 and DNToMod -->
+ <script>
+ logPath = remote.data
+ privPath = '%s/privileges/privileges_unindexed_searches' % logPath
+ ldifFile1 = '%s/50Entries.ldif' % privPath
+ ldifFile2 = '%s/privileges/add_new_root_user.ldif' % logPath
+ DNToMod = 'cn=Directory Manager,cn=Root DNs,cn=config'
+ </script>
+
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Unindexed Searches Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regard to
+ unindexed searches.
+ #@TestSuiteGroup Basic Privileges Unindexed Searches Tests
+ #@TestScript privileges_unindexed_searches.xml
+ -->
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
- <!--- Define default value for ldifFile1, ldifFile2 and DNToMod -->
- <script>
- logPath = remote.data
- privPath = '%s/privileges/privileges_unindexed_searches' % logPath
- ldifFile1 = '%s/50Entries.ldif' % privPath
- ldifFile2 = '%s/privileges/add_new_root_user.ldif' % logPath
- DNToMod = 'cn=Directory Manager,cn=Root DNs,cn=config'
- </script>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Unindexed Searches Tests
- #@TestSuitePurpose Test the basic Privileges Support in regard to
- unindexed searches.
- #@TestSuiteGroup Basic Privileges Unindexed Searches Tests
- #@TestScript privileges_unindexed_searches.xml
- -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Unindexed Searches Tests
+ #@TestName preamble
+ #@TestIssue none
+ #@TestPurpose Prepare for unindexed search privileges tests
+ #@TestPreamble none
+ #@TestStep Admin changing index-entry-limit.
+ #@TestStep Admin importing 50 entries.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all ldap operations,
+ and the entries imported without error.
+ -->
+ <testcase name="getTestCaseName('preamble')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Unindexed Searches: Preamble - \
+ Admin changing index-entry-limit'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'backend' ,
+ 'propertyType' : 'backend' ,
+ 'propertyName' : DIRECTORY_INSTANCE_BE ,
+ 'attributeName' : 'index-entry-limit' ,
+ 'attributeValue' : '4'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Preamble - \
+ Admin adding import task'
+ </message>
+
+ <call function="'importLdifTask'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'taskID' : STAXCurrentTestcase ,
+ 'ldifFile' : ldifFile1
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Unindexed Searches Tests
+ #@TestName unindexed searches - non-root user
+ #@TestIssue none
+ #@TestPurpose Unindexed search privilege for normal users
+ #@TestPreamble none
+ #@TestStep User searches entry.
+ #@TestStep Admin adds privilege.
+ #@TestStep User searches entry.
+ #@TestStep Admin removes privilege.
+ #@TestStep User searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 5, and 0 for all
+ other ldap operations.
+ -->
+ <testcase name="getTestCaseName('unindexed search non-root user')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Unindexed Searches: user searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'smellyFish' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'unindexed-search' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: user searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'smellyFish' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'unindexed-search' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: user searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'smellyFish' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Unindexed Searches Tests
+ #@TestName unindexed searches - Directory Manager
+ #@TestIssue none
+ #@TestPurpose Unindexed search privilege for Directory
+ Manager
+ #@TestPreamble none
+ #@TestStep Directory Manager searches entry.
+ #@TestStep Alternate Admin removes privilege.
+ #@TestStep Directory Manager searches entry.
+ #@TestStep Alternate Admin puts back privilege.
+ #@TestStep Directory Manager searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0 for all
+ other ldap operations.
+ -->
+ <testcase name="getTestCaseName
+ ('unindexed search Directory Manager')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Unindexed Searches: Directory Manager \
+ searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: alternative root user \
+ removing privilege from Directory Manager'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : DNToMod ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-unindexed-search' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Directory Manager \
+ searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: alternative root user \
+ putting back privilege to Directory Manager'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : DNToMod ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-unindexed-search' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Directory Manager \
+ searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Unindexed Searches Tests
+ #@TestName unindexed searches - new root user
+ #@TestIssue none
+ #@TestPurpose Unindexed search privilege for new root user
+ #@TestPreamble none
+ #@TestStep Directory Manager adds new root user.
+ #@TestStep New root user searches entries.
+ #@TestStep Alternate root user removes privilege.
+ #@TestStep New root user searches entry.
+ #@TestStep Alternate root user puts back privilege.
+ #@TestStep New root user searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 3, and 0 for all
+ other ldap operations.
+ -->
+ <testcase name="getTestCaseName('unindexed search New Root User')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Unindexed Searches: Directory Manager adding \
+ new root user'
+ </message>
+
+ <call function="'addEntry'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeAdded' : ldifFile2
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: New root user searching \
+ entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule',
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Alternative root user \
+ removing privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-unindexed-search' ,
+ 'changetype' : 'add'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: New root user searching \
+ entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule',
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Alternative root user \
+ putting back privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Aroot' ,
+ 'dsInstancePswd' : 'PrivsRule' ,
+ 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-unindexed-search' ,
+ 'changetype' : 'delete'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: New root user \
+ searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'cn=Zroot' ,
+ 'dsInstancePswd' : 'PrivsRule',
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Unindexed Searches Tests
+ #@TestName unindexed searches - global configuration
+ #@TestIssue none
+ #@TestPurpose Unindexed search privilege in the global
+ configuration
+ #@TestPreamble none
+ #@TestStep User searches entries.
+ #@TestStep Anonymous search.
+ #@TestStep Root user removes privilege in global
+ configuration.
+ #@TestStep User searches entries.
+ #@TestStep Anonymous search.
+ #@TestStep Root user puts back privilege in global
+ configuration.
+ #@TestStep User searches entries.
+ #@TestStep Anonymous search.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 1, 2, 7, 8 and 0 for all
+ other ldap operations.
+ -->
+ <testcase name="getTestCaseName
+ ('unindexed searches - global configuration')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Unindexed Searches: User searching entries'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'smellyFish' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Anonymous search'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Admin enabling \
+ unindexed-search privilege in the global configuration'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'global-configuration' ,
+ 'attributeName' : 'disabled-privilege' ,
+ 'attributeValue' : 'unindexed-search'
+ }
+ </call>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'smellyFish' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Anonymous search'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*'
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Admin disabling \
+ unindexed-search privilege in the global configuration'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'global-configuration' ,
+ 'modifyType' : 'reset' ,
+ 'attributeName' : 'disabled-privilege'
+ }
+ </call>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'smellyFish' ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Unindexed Searches: Anonymous search'
+ </message>
+
+ <call function="'SearchObject'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : 'dc=example,dc=com' ,
+ 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
+ 'expectedRC' : 50
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Unindexed Searches Tests
+ #@TestName postamble
+ #@TestIssue none
+ #@TestPurpose Reset after unindexed saerch tests
+ #@TestPreamble none
+ #@TestStep Admin changing index-entry-limit.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('postamble')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Unindexed Searches: Postamble - \
+ Admin changing index-entry-limit'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'backend' ,
+ 'propertyType' : 'backend' ,
+ 'propertyName' : DIRECTORY_INSTANCE_BE ,
+ 'attributeName' : 'index-entry-limit' ,
+ 'attributeValue' : '4000'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ </sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' %
- (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Unindexed Searches Tests
- #@TestName preamble
- #@TestIssue none
- #@TestPurpose Prepare for unindexed search privileges tests
- #@TestPreamble none
- #@TestStep Admin changing index-entry-limit.
- #@TestStep Admin importing 50 entries.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all ldap operations,
- and the entries imported without error.
- -->
- <testcase name="getTestCaseName('preamble')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Unindexed Searches: Preamble - \
- Admin changing index-entry-limit'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'backend' ,
- 'propertyType' : 'backend' ,
- 'propertyName' : DIRECTORY_INSTANCE_BE ,
- 'attributeName' : 'index-entry-limit' ,
- 'attributeValue' : '4'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Preamble - \
- Admin adding import task'
- </message>
-
- <call function="'importLdifTask'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'taskID' : STAXCurrentTestcase ,
- 'ldifFile' : ldifFile1
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Unindexed Searches Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
-
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Unindexed Searches Tests
- #@TestName unindexed searches - non-root user
- #@TestIssue none
- #@TestPurpose Unindexed search privilege for normal users
- #@TestPreamble none
- #@TestStep User searches entry.
- #@TestStep Admin adds privilege.
- #@TestStep User searches entry.
- #@TestStep Admin removes privilege.
- #@TestStep User searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 5, and 0 for all
- other ldap operations.
- -->
- <testcase name="getTestCaseName('unindexed search non-root user')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Unindexed Searches: user searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'dsInstancePswd' : 'smellyFish' ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'unindexed-search' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: user searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'dsInstancePswd' : 'smellyFish' ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'unindexed-search' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: user searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'dsInstancePswd' : 'smellyFish' ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Unindexed Searches Tests
- #@TestName unindexed searches - Directory Manager
- #@TestIssue none
- #@TestPurpose Unindexed search privilege for Directory
- Manager
- #@TestPreamble none
- #@TestStep Directory Manager searches entry.
- #@TestStep Alternate Admin removes privilege.
- #@TestStep Directory Manager searches entry.
- #@TestStep Alternate Admin puts back privilege.
- #@TestStep Directory Manager searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0 for all
- other ldap operations.
- -->
- <testcase name="getTestCaseName
- ('unindexed search Directory Manager')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Unindexed Searches: Directory Manager \
- searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: alternative root user \
- removing privilege from Directory Manager'
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : DNToMod ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-unindexed-search' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Directory Manager \
- searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: alternative root user \
- putting back privilege to Directory Manager'
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : DNToMod ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-unindexed-search' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Directory Manager \
- searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Unindexed Searches Tests
- #@TestName unindexed searches - new root user
- #@TestIssue none
- #@TestPurpose Unindexed search privilege for new root user
- #@TestPreamble none
- #@TestStep Directory Manager adds new root user.
- #@TestStep New root user searches entries.
- #@TestStep Alternate root user removes privilege.
- #@TestStep New root user searches entry.
- #@TestStep Alternate root user puts back privilege.
- #@TestStep New root user searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 3, and 0 for all
- other ldap operations.
- -->
- <testcase name="getTestCaseName('unindexed search New Root User')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Unindexed Searches: Directory Manager adding \
- new root user'
- </message>
-
- <call function="'addEntry'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : ldifFile2
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: New root user searching \
- entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule',
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Alternative root user \
- removing privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-unindexed-search' ,
- 'changetype' : 'add'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: New root user searching \
- entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule',
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Alternative root user \
- putting back privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Aroot' ,
- 'dsInstancePswd' : 'PrivsRule' ,
- 'DNToModify' : 'cn=Zroot Manager,cn=Root DNs,cn=config' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-unindexed-search' ,
- 'changetype' : 'delete'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: New root user \
- searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'cn=Zroot' ,
- 'dsInstancePswd' : 'PrivsRule',
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Unindexed Searches Tests
- #@TestName unindexed searches - global configuration
- #@TestIssue none
- #@TestPurpose Unindexed search privilege in the global
- configuration
- #@TestPreamble none
- #@TestStep User searches entries.
- #@TestStep Anonymous search.
- #@TestStep Root user removes privilege in global
- configuration.
- #@TestStep User searches entries.
- #@TestStep Anonymous search.
- #@TestStep Root user puts back privilege in global
- configuration.
- #@TestStep User searches entries.
- #@TestStep Anonymous search.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 1, 2, 7, 8 and 0 for all
- other ldap operations.
- -->
- <testcase name="getTestCaseName
- ('unindexed searches - global configuration')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Unindexed Searches: User searching entries'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'dsInstancePswd' : 'smellyFish' ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Anonymous search'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Admin enabling \
- unindexed-search privilege in the global configuration'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'global-configuration' ,
- 'attributeName' : 'disabled-privilege' ,
- 'attributeValue' : 'unindexed-search'
- }
- </call>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'dsInstancePswd' : 'smellyFish' ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Anonymous search'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*'
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Admin disabling \
- unindexed-search privilege in the global configuration'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'global-configuration' ,
- 'modifyType' : 'reset' ,
- 'attributeName' : 'disabled-privilege'
- }
- </call>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=user.0,ou=People,dc=example,dc=com' ,
- 'dsInstancePswd' : 'smellyFish' ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Unindexed Searches: Anonymous search'
- </message>
-
- <call function="'SearchObject'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : 'dc=example,dc=com' ,
- 'dsFilter' : 'facsimiletelephonenumber=*512*' ,
- 'expectedRC' : 50
- }
- </call>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Unindexed Searches Tests
- #@TestName postamble
- #@TestIssue none
- #@TestPurpose Reset after unindexed saerch tests
- #@TestPreamble none
- #@TestStep Admin changing index-entry-limit.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('postamble')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Unindexed Searches: Postamble - \
- Admin changing index-entry-limit'
- </message>
-
- <call function="'dsconfigSet'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'backend' ,
- 'propertyType' : 'backend' ,
- 'propertyName' : DIRECTORY_INSTANCE_BE ,
- 'attributeName' : 'index-entry-limit' ,
- 'attributeValue' : '4000'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml'%
- (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_users.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_users.xml
index 379353e..276ed46 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_users.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges_users.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -34,3234 +34,3258 @@
<sequence>
<block name="'privileges-users'">
+
+ <try>
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='privileges'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!---
- Place suite-specific test information here.
- #@TestSuiteName Privileges Users Tests
- #@TestSuitePurpose Test the basic Privileges Support in regrad to basic users.
- #@TestSuiteGroup Basic Privileges Users Tests
- #@TestScript privileges_users.xml
- -->
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_setup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_setup'" />
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName bypass-acl
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for normal users
- #@TestPreamble User searches entry.
- #@TestStep Admin removes global search ACI.
- #@TestStep User searches entry.
- #@TestStep Admin adds privilege.
- #@TestStep User searches entry.
- #@TestStep Admin removes privilege.
- #@TestStep User searches entry.
- #@TestStep Admin puts back global search ACI.
- #@TestStep User searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
+ <sequence>
+
+ <script>
+ if not CurrentTestPath.has_key('group'):
+ CurrentTestPath['group']='privileges'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <!---
+ Place suite-specific test information here.
+ #@TestSuiteName Privileges Users Tests
+ #@TestSuitePurpose Test the basic Privileges Support in regrad to basic users.
+ #@TestSuiteGroup Basic Privileges Users Tests
+ #@TestScript privileges_users.xml
-->
- <testcase name="getTestCaseName('bypass-acl')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: bypass-acl, preamble check default privilege'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl, removing search global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'delete' }
- </call>
+
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/privileges/privileges_startup.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/privileges/privileges_acis.xml' % (TESTS_DIR)"/>
+ <call function="'privileges_acis'"/>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName bypass-acl
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for normal users
+ #@TestPreamble User searches entry.
+ #@TestStep Admin removes global search ACI.
+ #@TestStep User searches entry.
+ #@TestStep Admin adds privilege.
+ #@TestStep User searches entry.
+ #@TestStep Admin removes privilege.
+ #@TestStep User searches entry.
+ #@TestStep Admin puts back global search ACI.
+ #@TestStep User searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: bypass-acl, preamble check default privilege'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, removing search global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, Admin deleting privilege'
+ </message>
- <message>
- 'Privileges: Users: bypass-acl, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Users: Putting Back Search Global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
- <message>
- 'Privileges: Users: bypass-acl, user searching entry'
- </message>
+ <message>
+ 'Privileges: Users: Putting Back Search Global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName bypass-acl with proxy
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for normal users with proxy permission
+ #@TestPreamble Admin removes global search ACI.
+ #@TestStep Admin adds privilege.
+ #@TestStep User searches entry.
+ #@TestStep Proxied user searches entry.
+ #@TestStep Admin adds proxy ACI.
+ #@TestStep Proxied user searches entry.
+ #@TestStep Admin deletes proxy ACI.
+ #@TestStep Admin removes privilege.
+ #@TestStep User searches entry.
+ #@TestStep Admin puts back global search ACI.
+ #@TestStep User searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl with proxy')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, preamble, removing search global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, proxied user searching targeted entry'
+ </message>
- <call function="'SearchObject'">
+ <call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
+ 'dsInstanceDn' : 'uid=aproxy,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ProxyRules' ,
'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'attributes' : 'cn sn uid' }
- </call>
+ </call>
- <script>
- returnString = STAXResult[0][1]
- </script>
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
- <call function="'checktestString'">
+ <call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, adding proxy aci'
+ </message>
+
+ <script>
+ proxy_aci="(target=\"ldap:///ou=People, o=Privileges Tests, dc=example,dc=com\")(targetattr=\"*\")(version 3.0; acl \"add_proxy_aci\"; allow (proxy) userdn=\"ldap:///uid=aproxy, ou=People, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : proxy_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, proxied user searching targeted entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=aproxy,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ProxyRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, Admin deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : proxy_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, Putting Back Search Global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName bypass-acl removal with minus notation
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for normal users with minus notation
+ #@TestPreamble Admin removes global search ACI.
+ #@TestStep Admin adds privilege.
+ #@TestStep User searches entry.
+ #@TestStep Admin adds privilege with minus notation.
+ #@TestStep User searches entry.
+ #@TestStep Admin removes privilege with minus notation.
+ #@TestStep User searches entry.
+ #@TestStep Admin removes privilege.
+ #@TestStep User searches entry.
+ #@TestStep Admin puts back global search ACI.
+ #@TestStep User searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl with minus notation')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, preamble, removing search global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, Admin adding privilege with minus notation'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, Admin deleting privilege with minus notation'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : '-bypass-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with proxy, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, Putting Back Search Global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl with minus notation, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName bypass-acl self-modify add
+ #@TestIssue 471
+ #@TestPurpose bypass-acl privilege for normal users with self-modify add
+ #@TestPreamble Admin removes global search ACI.
+ #@TestStep User adds ACI to itself.
+ #@TestStep User searches entry.
+ #@TestStep Admin puts back global search ACI.
+ #@TestStep User searches entry.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 1, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('bypass-acl self-modify add')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: bypass-acl self-modify add, preamble, removing search global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl self-modify add, user adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'bypass-acl' ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl self-modify add, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '0' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl self-modify add, Putting Back Search Global ACI'
+ </message>
+
+ <call function="'modifyGlobalAci'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'aciValue' : GLOBAL_ACI_SEARCH ,
+ 'opType' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: bypass-acl self-modify add, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'cn sn uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestString'">
+ { 'returnString' : returnString ,
+ 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName modify-acl - add aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for normal users - add aci
+ #@TestPreamble none
+ #@TestStep User adds ACI, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User adds ACI.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User adds ACI.
+ #@TestStep Admin removes privilege.
+ #@TestStep User adds second ACI.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep Admin deletes user-added ACI.
+ #@TestStep User adds second ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, 7 and 10, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - add aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, check default, user adding ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, user adding second ACI'
+ </message>
+
+ <script>
+ search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, Admin deleting user-added ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, user adding second ACI'
+ </message>
+
+ <script>
+ search3_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci_scarter\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=scarter, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search3_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName modify-acl - add aci - disable privilege
+ #@TestIssue 1683
+ #@TestPurpose disable privilege for modify-acl privilege for normal users - add aci
+ #@TestPreamble none
+ #@TestStep Admin adds write ACI.
+ #@TestStep User adds ACI.
+ #@TestStep Admin adds disabled-privilege.
+ #@TestStep User adds ACI.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep User adds second ACI.
+ #@TestStep Admin deletes disabled-privilege.
+ #@TestStep Admin deletes user-added ACI.
+ #@TestStep User adds second ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 2, 6, and 9, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - add aci - disable privilege')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50 }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, Admin disabling privilege'
+ </message>
+
+ <call function="'dsconfigSet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'global-configuration' ,
+ 'attributeName' : 'disabled-privilege' ,
+ 'attributeValue' : 'modify-acl' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, user adding second ACI'
+ </message>
+
+ <script>
+ search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, Admin un-disabling privilege'
+ </message>
+
+ <call function="'dsconfigSet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'global-configuration' ,
+ 'attributeName' : 'disabled-privilege' ,
+ 'attributeValue' : 'modify-acl' ,
+ 'modifyType' : 'remove' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, Admin deleting user-added ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci - disable privilege, user adding second ACI'
+ </message>
+
+ <script>
+ search3_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci_scarter\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=scarter, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search3_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName modify-acl - replace aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for normal users - replace aci
+ #@TestPreamble none
+ #@TestStep User replaces ACI, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User replaces ACI.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User replaces ACI.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep User replaces ACI.
+ #@TestStep Admin removes privilege.
+ #@TestStep User replaces ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, 7 and 9, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - replace aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, check default, user replacing ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"rep_search_aci_tmorris\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!--
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName modify-acl - delete aci
+ #@TestIssue 471
+ #@TestPurpose modify-acl privilege for normal users - delete aci
+ #@TestPreamble none
+ #@TestStep User deletes ACI, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User deletes ACI.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User deletes ACI.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep Admin removes privilege.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 3, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('modify-acl - delete aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, preamble, check default, user deleting ACI'
+ </message>
+
+ <script>
+ write_aci_dmiller="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_dmiller\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci_dmiller ,
+ 'changetype' : 'delete' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci_dmiller ,
+ 'changetype' : 'delete' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, user deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci_dmiller ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - delete aci, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName config-read
+ #@TestIssue 472
+ #@TestPurpose config-read privilege for normal users
+ #@TestPreamble none
+ #@TestStep User searches cn=config, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User searches cn=config.
+ #@TestStep Admin removes privilege.
+ #@TestStep User searches cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 5, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('config-read')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: config-read, check default privilege, user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-read, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-read' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-read, user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: cn=config' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'ds-cfg-check-schema:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-read, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-read' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-read, user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' ,
+ 'expectedRC' : 50 }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestStringNotPresent'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: cn=config' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName bypass-acl with proxy
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for normal users with proxy permission
- #@TestPreamble Admin removes global search ACI.
- #@TestStep Admin adds privilege.
- #@TestStep User searches entry.
- #@TestStep Proxied user searches entry.
- #@TestStep Admin adds proxy ACI.
- #@TestStep Proxied user searches entry.
- #@TestStep Admin deletes proxy ACI.
- #@TestStep Admin removes privilege.
- #@TestStep User searches entry.
- #@TestStep Admin puts back global search ACI.
- #@TestStep User searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl with proxy')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, preamble, removing search global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, proxied user searching targeted entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=aproxy,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ProxyRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName config-read - disable privilege
+ #@TestIssue 1683
+ #@TestPurpose config-read privilege for normal users
+ #@TestPreamble none
+ #@TestStep User searches cn=config, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User searches cn=config.
+ #@TestStep Admin removes privilege.
+ #@TestStep User searches cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1 and 5, and 0
+ for all other ldap operations.
+ Proper entries returned for allowed searches.
+ -->
+ <testcase name="getTestCaseName('config-read - disable privilege')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: config-read - disable privilege, check default privilege, user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-read - disable privilege, Admin disabling privilege'
+ </message>
+
+ <call function="'dsconfigSet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'global-configuration' ,
+ 'attributeName' : 'disabled-privilege' ,
+ 'attributeValue' : 'config-read' }
+ </call>
- <message>
- 'Privileges: Users: bypass-acl with proxy, adding proxy aci'
- </message>
-
- <script>
- proxy_aci="(target=\"ldap:///ou=People, o=Privileges Tests, dc=example,dc=com\")(targetattr=\"*\")(version 3.0; acl \"add_proxy_aci\"; allow (proxy) userdn=\"ldap:///uid=aproxy, ou=People, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : proxy_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, proxied user searching targeted entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=aproxy,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ProxyRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
+ <message>
+ 'Privileges: Users: config-read - disable privilege, user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: cn=config' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'ds-cfg-check-schema:' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-read - disable privilege, Admin un-disabling privilege'
+ </message>
+
+ <call function="'dsconfigSet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'global-configuration' ,
+ 'attributeName' : 'disabled-privilege' ,
+ 'attributeValue' : 'config-read' ,
+ 'modifyType' : 'remove' }
+ </call>
- <message>
- 'Privileges: Users: bypass-acl with proxy, Admin deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : proxy_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, Putting Back Search Global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
+ <message>
+ 'Privileges: Users: config-read - disable privilege, user searching cn=config'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'dsBaseDN' : 'cn=config' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'ds-cfg-check-schema' ,
+ 'extraParams' : '-s base' ,
+ 'expectedRC' : 50 }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'checktestStringNotPresent'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: cn=config' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName bypass-acl removal with minus notation
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for normal users with minus notation
- #@TestPreamble Admin removes global search ACI.
- #@TestStep Admin adds privilege.
- #@TestStep User searches entry.
- #@TestStep Admin adds privilege with minus notation.
- #@TestStep User searches entry.
- #@TestStep Admin removes privilege with minus notation.
- #@TestStep User searches entry.
- #@TestStep Admin removes privilege.
- #@TestStep User searches entry.
- #@TestStep Admin puts back global search ACI.
- #@TestStep User searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl with minus notation')">
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName config-write
+ #@TestIssue 472
+ #@TestPurpose config-write privilege for normal users
+ #@TestPreamble none
+ #@TestStep User modifies cn=config, check default behavior.
+ #@TestStep Admin adds write privilege.
+ #@TestStep User modifies cn=config.
+ #@TestStep Admin adds read privilege.
+ #@TestStep User modifies cn=config.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User modifies cn=config.
+ #@TestStep Admin removes read privilege.
+ #@TestStep User modifies cn=config.
+ #@TestStep Admin removes write privilege.
+ #@TestStep User modifies cn=config.
+ #@TestStep Admin removes write ACI.
+ #@TestStep User modifies cn=config.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, 5, 9, 11, and 13, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('config-write')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: config-write, check default privilege, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-write' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-read' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"ds-cfg-check-schema\")(version 3.0; acl \"add_write_config\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-read' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-write' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: modify-acl - add aci, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write, user modifying cn=config'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'ds-cfg-check-schema' ,
+ 'newAttributeValue' : 'true' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName config-write - add global aci
+ #@TestIssue 472
+ #@TestPurpose config-write privilege for normal users - add global aci
+ #@TestPreamble none
+ #@TestStep User adds global ACI, check default behavior.
+ #@TestStep Admin adds read privilege.
+ #@TestStep User adds global ACI.
+ #@TestStep Admin adds write privilege.
+ #@TestStep User adds global ACI.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User adds global ACI.
+ #@TestStep Admin removes write privilege.
+ #@TestStep User adds second global ACI.
+ #@TestStep Admin removes read privilege.
+ #@TestStep User adds second global ACI.
+ #@TestStep Admin removes write ACI.
+ #@TestStep Admin removes user-added global ACI.
+ #@TestStep User adds second global ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, 5, 9, 11, and 14, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('config-write - add global aci')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, check default, user adding ACI'
+ </message>
+
+ <script>
+ another_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-read' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-write' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"ds-cfg-global-aci\")(version 3.0; acl \"add_allow_global_aci\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-write' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, user adding ACI'
+ </message>
+
+ <script>
+ global2_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'config-read' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=config' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci',
+ 'newAttributeValue' : another_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: config-write - add global aci, user adding ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : global2_aci ,
+ 'changetype' : 'add' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName password-reset
+ #@TestIssue 479
+ #@TestPurpose config-write privilege for normal users
+ #@TestPreamble Admin adds write ACI
+ #@TestStep User resets another users password, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User resets another users password.
+ #@TestStep Other user binds with search operation.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep User resets another users password.
+ #@TestStep Admin removes privilege.
+ #@TestStep User resets another users password.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 6, and 8, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('password-reset')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: password-reset, preamble, Admin adding ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"userpassword\")(version 3.0; acl \"add_modify_acl\"; allow (write,add,delete) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, check default privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'bananas' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'password-reset' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, user resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'bananas' ,
+ 'changetype' : 'replace' }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=bhall,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'bananas' ,
+ 'dsBaseDN' : 'ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=bhall,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'uid: bhall' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset - delete aci, Admin deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, user resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'bananas' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'password-reset' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, user resetting password'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'userpassword' ,
+ 'newAttributeValue' : 'bananas' ,
+ 'changetype' : 'replace' ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName update-schema
+ #@TestIssue 468
+ #@TestPurpose update-schema privilege for normal users
+ #@TestPreamble Admin adds write ACI
+ #@TestStep User adds new schema object, check default behavior.
+ #@TestStep Admin adds new entry that uses new object class.
+ #@TestStep Admin adds privilege.
+ #@TestStep User adds new schema object.
+ #@TestStep Admin adds new entry that uses new object class.
+ #@TestStep Admin searches new entry.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep Admin removes privilege.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for step 1, 65 for step 2, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('update-schema')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: update-schema, preamble, Admin adding ACI'
+ </message>
+
+ <script>
+ write_aci="(target=\"ldap:///cn=schema\")(targetattr=\"objectclasses\")(version 3.0; acl \"add_global_write_schema\"; allow (all) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, check default privilege, user adding new schema object'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, Admin adding entry that uses new object class'
+ </message>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
+ 'expectedRC' : 65
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'update-schema' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, user adding new schema object'
+ </message>
+
+ <call function="'modifyEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, Admin adding entry that users new object class'
+ </message>
+
+ <!--
+ <script>
+ listAttr=[]
+ listAttr.append('objectclass: top')
+ listAttr.append('objectclass: person')
+ listAttr.append('objectclass: mozillaobject')
+ listAttr.append('cn: Salmon Fish')
+ listAttr.append('sn: Fish')
+ listAttr.append('givenname: Salmon')
+ listAttr.append('l: Cupertino')
+ listAttr.append('uid: sfish')
+ </script>
+
+ <call function="'addAnEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToAdd' : 'uid=sfish, ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributesToAdd' : listAttr }
+ </call>
+ -->
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data }
+ </call>
+
+ <message>
+ 'Privileges: Users: password-reset, user searching entry'
+ </message>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=sfish,ou=People,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsFilter' : 'objectclass=*' ,
+ 'attributes' : 'uid'}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'dn: uid=sfish,ou=People,o=Privileges Tests' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString ,
+ 'testString' : 'uid: sfish' ,
+ 'expectedResult' : '1' }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, Admin deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: update-schema, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'update-schema' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName privilege-change
+ #@TestIssue 1213
+ #@TestPurpose privilege-change privilege for normal users
+ #@TestPreamble Admin adds write ACI
+ #@TestStep Admin adds privilege-change privilege to first user.
+ #@TestStep First user adds modify-acl privilege to second user.
+ #@TestStep Second user adds an ACI.
+ #@TestStep Admin removes modify-acl privilege.
+ #@TestStep Admin removes privilege-change privilege.
+ #@TestStep Admin deletes user-added ACI.
+ #@TestStep Admin deletes write ACI.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('privilege-change')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: privilege-change, Admin adding write ACI'
+ </message>
+
+ <script>
+ write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, Admin adding privilege to first user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'privilege-change' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, first user adding privilege to second user'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, second user adding ACI'
+ </message>
+
+ <script>
+ search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules' ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'modify-acl' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'privilege-change' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, Admin deleting ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: privilege-change, Admin deleting write ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'dc=example,dc=com' ,
+ 'attributeName' : 'aci' ,
+ 'newAttributeValue' : write_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
+
+ <!---
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName server-shutdown
+ #@TestIssue 477
+ #@TestPurpose server-shutdown privilege for normal users
+ #@TestPreamble none
+ #@TestStep User adds shutdown task, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User adds shutdown task.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User adds shutdown task.
+ #@TestStep Admin removes privilege.
+ #@TestStep User adds shutdown task.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep User adds shutdown task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, 7, and 9, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('server-shutdown')">
+
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, preamble, removing search global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, Admin adding privilege with minus notation'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, Admin deleting privilege with minus notation'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : '-bypass-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with proxy, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, Putting Back Search Global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl with minus notation, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName bypass-acl self-modify add
- #@TestIssue 471
- #@TestPurpose bypass-acl privilege for normal users with self-modify add
- #@TestPreamble Admin removes global search ACI.
- #@TestStep User adds ACI to itself.
- #@TestStep User searches entry.
- #@TestStep Admin puts back global search ACI.
- #@TestStep User searches entry.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 1, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('bypass-acl self-modify add')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: bypass-acl self-modify add, preamble, removing search global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl self-modify add, user adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'bypass-acl' ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl self-modify add, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '0' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl self-modify add, Putting Back Search Global ACI'
- </message>
-
- <call function="'modifyGlobalAci'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'aciValue' : GLOBAL_ACI_SEARCH ,
- 'opType' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: bypass-acl self-modify add, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'uid=scarter,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'cn sn uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestString'">
- { 'returnString' : returnString ,
- 'expectedString' : 'dn: uid=scarter,ou=People,o=Privileges Tests' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName modify-acl - add aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for normal users - add aci
- #@TestPreamble none
- #@TestStep User adds ACI, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User adds ACI.
- #@TestStep Admin adds write ACI.
- #@TestStep User adds ACI.
- #@TestStep Admin removes privilege.
- #@TestStep User adds second ACI.
- #@TestStep Admin deletes write ACI.
- #@TestStep Admin deletes user-added ACI.
- #@TestStep User adds second ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, 7 and 10, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - add aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, check default, user adding ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, Admin adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, user adding second ACI'
- </message>
-
- <script>
- search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, Admin deleting user-added ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, user adding second ACI'
- </message>
-
- <script>
- search3_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci_scarter\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=scarter, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search3_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName modify-acl - add aci - disable privilege
- #@TestIssue 1683
- #@TestPurpose disable privilege for modify-acl privilege for normal users - add aci
- #@TestPreamble none
- #@TestStep Admin adds write ACI.
- #@TestStep User adds ACI.
- #@TestStep Admin adds disabled-privilege.
- #@TestStep User adds ACI.
- #@TestStep Admin deletes write ACI.
- #@TestStep User adds second ACI.
- #@TestStep Admin deletes disabled-privilege.
- #@TestStep Admin deletes user-added ACI.
- #@TestStep User adds second ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 2, 6, and 9, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - add aci - disable privilege')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, Admin adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50 }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, Admin disabling privilege'
- </message>
-
- <call function="'dsconfigSet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'global-configuration' ,
- 'attributeName' : 'disabled-privilege' ,
- 'attributeValue' : 'modify-acl' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, user adding second ACI'
- </message>
-
- <script>
- search2_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci2\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, Admin un-disabling privilege'
- </message>
-
- <call function="'dsconfigSet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'global-configuration' ,
- 'attributeName' : 'disabled-privilege' ,
- 'attributeValue' : 'modify-acl' ,
- 'modifyType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, Admin deleting user-added ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci - disable privilege, user adding second ACI'
- </message>
-
- <script>
- search3_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci_scarter\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=scarter, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search3_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName modify-acl - replace aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for normal users - replace aci
- #@TestPreamble none
- #@TestStep User replaces ACI, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User replaces ACI.
- #@TestStep Admin adds write ACI.
- #@TestStep User replaces ACI.
- #@TestStep Admin deletes write ACI.
- #@TestStep User replaces ACI.
- #@TestStep Admin removes privilege.
- #@TestStep User replaces ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, 7 and 9, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - replace aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, check default, user replacing ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"rep_search_aci_tmorris\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, Admin adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - replace aci, user replacing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=tmorris, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!--
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName modify-acl - delete aci
- #@TestIssue 471
- #@TestPurpose modify-acl privilege for normal users - delete aci
- #@TestPreamble none
- #@TestStep User deletes ACI, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User deletes ACI.
- #@TestStep Admin adds write ACI.
- #@TestStep User deletes ACI.
- #@TestStep Admin deletes write ACI.
- #@TestStep Admin removes privilege.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 3, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('modify-acl - delete aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, preamble, check default, user deleting ACI'
- </message>
-
- <script>
- write_aci_dmiller="(targetattr=\"*\")(version 3.0; acl \"del_search_aci_dmiller\"; allow (write) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci_dmiller ,
- 'changetype' : 'delete' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci_dmiller ,
- 'changetype' : 'delete' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, Admin adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, user deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=dmiller, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci_dmiller ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - delete aci, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName config-read
- #@TestIssue 472
- #@TestPurpose config-read privilege for normal users
- #@TestPreamble none
- #@TestStep User searches cn=config, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User searches cn=config.
- #@TestStep Admin removes privilege.
- #@TestStep User searches cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 5, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('config-read')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: config-read, check default privilege, user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Users: config-read, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-read' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-read, user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'server-shutdown' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: cn=config' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'ds-cfg-check-schema:' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: config-read, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-read' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-read, user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' ,
- 'expectedRC' : 50 }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestStringNotPresent'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: cn=config' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName config-read - disable privilege
- #@TestIssue 1683
- #@TestPurpose config-read privilege for normal users
- #@TestPreamble none
- #@TestStep User searches cn=config, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User searches cn=config.
- #@TestStep Admin removes privilege.
- #@TestStep User searches cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1 and 5, and 0
- for all other ldap operations.
- Proper entries returned for allowed searches.
- -->
- <testcase name="getTestCaseName('config-read - disable privilege')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: config-read - disable privilege, check default privilege, user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Users: config-read - disable privilege, Admin disabling privilege'
- </message>
-
- <call function="'dsconfigSet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'global-configuration' ,
- 'attributeName' : 'disabled-privilege' ,
- 'attributeValue' : 'config-read' }
- </call>
-
- <message>
- 'Privileges: Users: config-read - disable privilege, user searching cn=config'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, Admin adding ACI'
+ </message>
+
+ <script>
+ search_aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-export-backend-id || ds-task-export-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' }
- </call>
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ }
+ </call>
+
+ <if expr="STAFCmdRC != 0">
+ <tcstatus result="'fail'"/>
+ <else>
+ <!--- Start DS -->
+ <sequence>
+
+ <message>
+ 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
+ </message>
- <script>
- returnString = STAXResult[0][1]
- </script>
+ <!--- Start DS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: cn=config' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'ds-cfg-check-schema:' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: config-read - disable privilege, Admin un-disabling privilege'
- </message>
-
- <call function="'dsconfigSet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'global-configuration' ,
- 'attributeName' : 'disabled-privilege' ,
- 'attributeValue' : 'config-read' ,
- 'modifyType' : 'remove' }
- </call>
-
- <message>
- 'Privileges: Users: config-read - disable privilege, user searching cn=config'
- </message>
+ <call function="'checkRC'">
+ { 'returncode' : RC ,
+ 'result' : STAXResult }
+ </call>
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000 }
+ </call>
+ </sequence>
+ <!--- End Block DS Process Active -->
+ </else>
+ </if>
+
+ <message>
+ 'Privileges: Users: server-shutdown, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'server-shutdown' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'dsBaseDN' : 'cn=config' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'ds-cfg-check-schema' ,
- 'extraParams' : '-s base' ,
- 'expectedRC' : 50 }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'checktestStringNotPresent'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: cn=config' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, Admin removing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-shutdown, user adding server shutdown task'
+ </message>
+
+ <call function="'shutdownTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
</sequence>
</testcase>
-
-
+
<!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName config-write
- #@TestIssue 472
- #@TestPurpose config-write privilege for normal users
- #@TestPreamble none
- #@TestStep User modifies cn=config, check default behavior.
- #@TestStep Admin adds write privilege.
- #@TestStep User modifies cn=config.
- #@TestStep Admin adds read privilege.
- #@TestStep User modifies cn=config.
- #@TestStep Admin adds write ACI.
- #@TestStep User modifies cn=config.
- #@TestStep Admin removes read privilege.
- #@TestStep User modifies cn=config.
- #@TestStep Admin removes write privilege.
- #@TestStep User modifies cn=config.
- #@TestStep Admin removes write ACI.
- #@TestStep User modifies cn=config.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, 5, 9, 11, and 13, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('config-write')">
+ Place test-specific test information here.
+ The tag, TestMarker, must be the same as the tag, TestSuiteName.
+ #@TestMarker Privileges Users Tests
+ #@TestName server-restart
+ #@TestIssue 477
+ #@TestPurpose server-restart privilege for normal users
+ #@TestPreamble none
+ #@TestStep User adds restart task, check default behavior.
+ #@TestStep Admin adds privilege.
+ #@TestStep User adds restart task.
+ #@TestStep Admin adds write ACI.
+ #@TestStep User adds restart task.
+ #@TestStep Admin removes privilege.
+ #@TestStep User adds restart task.
+ #@TestStep Admin deletes write ACI.
+ #@TestStep User adds restart task.
+ #@TestPostamble none
+ #@TestResult Success if OpenDS returns 50
+ for steps 1, 3, 7, and 9, and 0
+ for all other ldap operations.
+ -->
+ <testcase name="getTestCaseName('server-restart')">
+
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: config-write, check default privilege, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'Privileges: Users: server-restart, user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Users: config-write, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-write' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, Admin adding privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'server-restart' ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Users: config-write, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-read' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, Admin adding ACI'
+ </message>
+
+ <script>
+ search_aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-export-backend-id || ds-task-export-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
+ </script>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'add' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
}
- </call>
-
- <message>
- 'Privileges: Users: config-write, Admin adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"ds-cfg-check-schema\")(version 3.0; acl \"add_write_config\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-read' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, Admin deleting privilege'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'attributeName' : 'ds-privilege-name' ,
+ 'newAttributeValue' : 'server-restart' ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <!--
+ <message>
+ 'Privileges: Users: server-restart, user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Users: config-write, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-write' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, Admin removing ACI'
+ </message>
+
+ <call function="'modifyAnAttribute'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
+ 'attributeName' : 'ds-cfg-global-aci' ,
+ 'newAttributeValue' : search_aci ,
+ 'changetype' : 'delete' }
+ </call>
+
+ <message>
+ 'Privileges: Users: server-restart, user adding server restart task'
+ </message>
+
+ <call function="'restartTask'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
+ 'dsInstancePswd' : 'ACIRules',
+ 'taskID' : STAXCurrentTestcase,
+ 'expectedRC' : 50
}
- </call>
-
- <message>
- 'Privileges: Users: modify-acl - add aci, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write, user modifying cn=config'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'ds-cfg-check-schema' ,
- 'newAttributeValue' : 'true' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
+ </call>
+ -->
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+ </testcase>
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName config-write - add global aci
- #@TestIssue 472
- #@TestPurpose config-write privilege for normal users - add global aci
- #@TestPreamble none
- #@TestStep User adds global ACI, check default behavior.
- #@TestStep Admin adds read privilege.
- #@TestStep User adds global ACI.
- #@TestStep Admin adds write privilege.
- #@TestStep User adds global ACI.
- #@TestStep Admin adds write ACI.
- #@TestStep User adds global ACI.
- #@TestStep Admin removes write privilege.
- #@TestStep User adds second global ACI.
- #@TestStep Admin removes read privilege.
- #@TestStep User adds second global ACI.
- #@TestStep Admin removes write ACI.
- #@TestStep Admin removes user-added global ACI.
- #@TestStep User adds second global ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, 5, 9, 11, and 14, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('config-write - add global aci')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: config-write - add global aci, check default, user adding ACI'
- </message>
-
- <script>
- another_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-read' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-write' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin adding write ACI'
- </message>
+ </sequence>
- <script>
- write_aci="(targetattr=\"ds-cfg-global-aci\")(version 3.0; acl \"add_allow_global_aci\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-write' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, user adding ACI'
- </message>
-
- <script>
- global2_aci="(target=\"ldap:///ou=People,o=Privileges Tests,dc=example,dc=com\")(targetattr!=\"userPassword||authPassword\")(version 3.0; acl \"Anonymous write access\"; allow (write) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'config-read' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=config' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci',
- 'newAttributeValue' : another_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: config-write - add global aci, user adding ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : global2_aci ,
- 'changetype' : 'add' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName password-reset
- #@TestIssue 479
- #@TestPurpose config-write privilege for normal users
- #@TestPreamble Admin adds write ACI
- #@TestStep User resets another users password, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User resets another users password.
- #@TestStep Other user binds with search operation.
- #@TestStep Admin deletes write ACI.
- #@TestStep User resets another users password.
- #@TestStep Admin removes privilege.
- #@TestStep User resets another users password.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 6, and 8, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('password-reset')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: password-reset, preamble, Admin adding ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"userpassword\")(version 3.0; acl \"add_modify_acl\"; allow (write,add,delete) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, check default privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'bananas' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'password-reset' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, user resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'bananas' ,
- 'changetype' : 'replace' }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=bhall,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'bananas' ,
- 'dsBaseDN' : 'ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=bhall,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'uid: bhall' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: password-reset - delete aci, Admin deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, user resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'bananas' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'password-reset' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, user resetting password'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=bhall, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'userpassword' ,
- 'newAttributeValue' : 'bananas' ,
- 'changetype' : 'replace' ,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName update-schema
- #@TestIssue 468
- #@TestPurpose update-schema privilege for normal users
- #@TestPreamble Admin adds write ACI
- #@TestStep User adds new schema object, check default behavior.
- #@TestStep Admin adds new entry that uses new object class.
- #@TestStep Admin adds privilege.
- #@TestStep User adds new schema object.
- #@TestStep Admin adds new entry that uses new object class.
- #@TestStep Admin searches new entry.
- #@TestStep Admin deletes write ACI.
- #@TestStep Admin removes privilege.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for step 1, 65 for step 2, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('update-schema')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: update-schema, preamble, Admin adding ACI'
- </message>
-
- <script>
- write_aci="(target=\"ldap:///cn=schema\")(targetattr=\"objectclasses\")(version 3.0; acl \"add_global_write_schema\"; allow (all) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, check default privilege, user adding new schema object'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data ,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, Admin adding entry that uses new object class'
- </message>
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data ,
- 'expectedRC' : 65
- }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'update-schema' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, user adding new schema object'
- </message>
-
- <call function="'modifyEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'entryToBeModified' : '%s/privileges/addmozobj.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, Admin adding entry that users new object class'
- </message>
-
- <!--
- <script>
- listAttr=[]
- listAttr.append('objectclass: top')
- listAttr.append('objectclass: person')
- listAttr.append('objectclass: mozillaobject')
- listAttr.append('cn: Salmon Fish')
- listAttr.append('sn: Fish')
- listAttr.append('givenname: Salmon')
- listAttr.append('l: Cupertino')
- listAttr.append('uid: sfish')
- </script>
-
- <call function="'addAnEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : 'uid=sfish, ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributesToAdd' : listAttr }
- </call>
- -->
-
- <call function="'addEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'entryToBeAdded' : '%s/privileges/add_entry_with_new_objclass.ldif' % remote.data }
- </call>
-
- <message>
- 'Privileges: Users: password-reset, user searching entry'
- </message>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=sfish,ou=People,o=Privileges Tests,dc=example,dc=com' ,
- 'dsFilter' : 'objectclass=*' ,
- 'attributes' : 'uid'}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'dn: uid=sfish,ou=People,o=Privileges Tests' ,
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString ,
- 'testString' : 'uid: sfish' ,
- 'expectedResult' : '1' }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, Admin deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: update-schema, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'update-schema' ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName privilege-change
- #@TestIssue 1213
- #@TestPurpose privilege-change privilege for normal users
- #@TestPreamble Admin adds write ACI
- #@TestStep Admin adds privilege-change privilege to first user.
- #@TestStep First user adds modify-acl privilege to second user.
- #@TestStep Second user adds an ACI.
- #@TestStep Admin removes modify-acl privilege.
- #@TestStep Admin removes privilege-change privilege.
- #@TestStep Admin deletes user-added ACI.
- #@TestStep Admin deletes write ACI.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('privilege-change')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: privilege-change, Admin adding write ACI'
- </message>
-
- <script>
- write_aci="(targetattr=\"aci || ds-privilege-name\")(version 3.0; acl \"add_write_acl\"; allow (write) userdn=\"ldap:///all\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, Admin adding privilege to first user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'privilege-change' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, first user adding privilege to second user'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, second user adding ACI'
- </message>
-
- <script>
- search_aci="(targetattr=\"*\")(version 3.0; acl \"add_search_aci\"; allow (search,read) userdn=\"ldap:///uid=auser, o=Privileges Tests,dc=example,dc=com\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules' ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=buser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'modify-acl' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'privilege-change' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, Admin deleting ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'ou=People, o=Privileges Tests, dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: privilege-change, Admin deleting write ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'dc=example,dc=com' ,
- 'attributeName' : 'aci' ,
- 'newAttributeValue' : write_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName server-shutdown
- #@TestIssue 477
- #@TestPurpose server-shutdown privilege for normal users
- #@TestPreamble none
- #@TestStep User adds shutdown task, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User adds shutdown task.
- #@TestStep Admin adds write ACI.
- #@TestStep User adds shutdown task.
- #@TestStep Admin removes privilege.
- #@TestStep User adds shutdown task.
- #@TestStep Admin deletes write ACI.
- #@TestStep User adds shutdown task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, 7, and 9, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('server-shutdown')">
-
+ <finally>
<sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'server-shutdown' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, Admin adding ACI'
- </message>
-
- <script>
- search_aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-export-backend-id || ds-task-export-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- }
- </call>
-
- <if expr="STAFCmdRC != 0">
- <tcstatus result="'fail'"/>
- <else>
- <!--- Start DS -->
- <sequence>
-
- <message>
- 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <!--- Start DS -->
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
- </sequence>
- <!--- End Block DS Process Active -->
- </else>
- </if>
-
- <message>
- 'Privileges: Users: server-shutdown, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'server-shutdown' ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, Admin removing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: server-shutdown, user adding server shutdown task'
- </message>
-
- <call function="'shutdownTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Privileges Users Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
+ </finally>
- <!---
- Place test-specific test information here.
- The tag, TestMarker, must be the same as the tag, TestSuiteName.
- #@TestMarker Privileges Users Tests
- #@TestName server-restart
- #@TestIssue 477
- #@TestPurpose server-restart privilege for normal users
- #@TestPreamble none
- #@TestStep User adds restart task, check default behavior.
- #@TestStep Admin adds privilege.
- #@TestStep User adds restart task.
- #@TestStep Admin adds write ACI.
- #@TestStep User adds restart task.
- #@TestStep Admin removes privilege.
- #@TestStep User adds restart task.
- #@TestStep Admin deletes write ACI.
- #@TestStep User adds restart task.
- #@TestPostamble none
- #@TestResult Success if OpenDS returns 50
- for steps 1, 3, 7, and 9, and 0
- for all other ldap operations.
- -->
- <testcase name="getTestCaseName('server-restart')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'Privileges: Users: server-restart, user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, Admin adding privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'server-restart' ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, Admin adding ACI'
- </message>
-
- <script>
- search_aci="(target=\"ldap:///cn=Scheduled Tasks,cn=Tasks\")(targetattr=\"ds-task-class-name || ds-task-export-backend-id || ds-task-export-ldif-file\")(version 3.0; acl \"Allows writes for tasks\"; allow (write,add,delete) userdn=\"ldap:///anyone\";)"
- </script>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'add' }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, Admin deleting privilege'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'attributeName' : 'ds-privilege-name' ,
- 'newAttributeValue' : 'server-restart' ,
- 'changetype' : 'delete' }
- </call>
-
- <!--
- <message>
- 'Privileges: Users: server-restart, user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, Admin removing ACI'
- </message>
-
- <call function="'modifyAnAttribute'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : 'cn=Access Control Handler,cn=config' ,
- 'attributeName' : 'ds-cfg-global-aci' ,
- 'newAttributeValue' : search_aci ,
- 'changetype' : 'delete' }
- </call>
-
- <message>
- 'Privileges: Users: server-restart, user adding server restart task'
- </message>
-
- <call function="'restartTask'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
- 'dsInstanceDn' : 'uid=auser,o=Privileges Tests,dc=example,dc=com' ,
- 'dsInstancePswd' : 'ACIRules',
- 'taskID' : STAXCurrentTestcase,
- 'expectedRC' : 50
- }
- </call>
- -->
- <call function="'testCase_Postamble'"/>
-
- </sequence>
- </testcase>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/privileges/privileges_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'privileges_cleanup'" />
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/quickstart/quickstart.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/quickstart/quickstart.xml
index a438baa..aa264a1 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/quickstart/quickstart.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/quickstart/quickstart.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_quickstart"/>
@@ -41,8 +41,8 @@
<!--- Check that DS started -->
<call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
+ { 'noOfLoops' : 100 ,
+ 'noOfMilliSeconds' : 3000 }
</call>
<message>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/dynamic/schema_dynamic.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/dynamic/schema_dynamic.xml
index 27ee87e..01ed628 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/dynamic/schema_dynamic.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/dynamic/schema_dynamic.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_schema_dynamic"/>
@@ -53,13 +53,21 @@
<try>
<sequence>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/schema/ldifs/schema_start.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
<!-- List of Import of Test Functions -->
<script>
importList=[]
- importList.append('schema_setup')
importList.append('dynamic/schema_dynamic_tests')
- importList.append('schema_cleanup')
</script>
<!-- Import the files for this test suite -->
@@ -67,9 +75,6 @@
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/%s.xml' % (__groupdir,__import)"/>
</iterate>
-
- <!-- Test Suite Setup -->
- <call function="'%s_setup' % __group"/>
<!-- List of Test Cases -->
<script>
@@ -108,9 +113,18 @@
<finally>
<sequence>
<!-- Test Suite Cleanup -->
- <message>'Finally: Example Cleanup.'</message>
- <call function="'%s_cleanup' % __group"/>
- <call function="'testSuite_Postamble'"/>
+ <message>'Finally: Global Schema Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</finally>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/rfc/schema_rfc.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/rfc/schema_rfc.xml
index 65011ec..8cac279 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/rfc/schema_rfc.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/rfc/schema_rfc.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_schema_rfc"/>
@@ -53,13 +53,21 @@
<try>
<sequence>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/schema/ldifs/schema_start.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
<!-- List of Import of Test Functions -->
<script>
importList=[]
- importList.append('schema_setup')
importList.append('rfc/schema_rfc_tests')
- importList.append('schema_cleanup')
</script>
<!-- Import the files for this test suite -->
@@ -68,9 +76,6 @@
file="'%s/%s.xml' % (__groupdir,__import)"/>
</iterate>
- <!-- Test Suite Setup -->
- <call function="'%s_setup' % __group"/>
-
<!-- Specific to rfc tests -->
<script>
__baseDN='o=rfc tests, dc=example,%s' % server.suffix
@@ -148,12 +153,21 @@
<finally>
<sequence>
<!-- Test Suite Cleanup -->
- <message>'Finally: Example Cleanup.'</message>
- <call function="'%s_cleanup' % __group"/>
- <call function="'testSuite_Postamble'"/>
+ <message>'Finally: Global Schema Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</finally>
-
+
</try>
</block>
</sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema.xml
index 6b64f5a..dd44128 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema.xml
@@ -26,98 +26,75 @@
! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="main_schema"/>
-
- <function name="main_schema" scope="local">
+ <defaultcall function="main_schema" />
+ <function name="main_schema">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
<sequence>
<try>
- <block name="'main_schema'">
+ <block name="'schema'">
<sequence>
-
- <message log="1" level="'Info'">'STAXParentID= %s' % STAXParentID</message>
-
<!--- Load the job environment for the test group execution -->
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
<call function="'loadJobEnvironment'">
{ 'parent' : STAXParentID }
</call>
-
<script>
- _group='schema'
- CurrentTestPath={ 'group' : '%s' % _group }
+ CurrentTestPath['group']='schema'
+ _group=CurrentTestPath['group']
+
</script>
-
- <!--- Test Group information
- #@TestGroupName Schema Test
- #@TestGroupPurpose Verify that schema is working correctly
- -->
- <call function="'testGroup_Preamble'"/>
-
- <!-- List of test suites to run -->
+ <call function="'testGroup_Preamble'" />
<script>
- suiteList=[]
+ suiteList = []
suiteList.append('rfc')
suiteList.append('dynamic')
suiteList.append('solaris')
</script>
-
- <!-- Data global to this test group -->
- <!-- LDAP Server Object -->
- <script>
- server=directory_server()
- server.location = STAF_REMOTE_HOSTNAME
- server.host = DIRECTORY_INSTANCE_HOST
- server.port = DIRECTORY_INSTANCE_PORT
- server.adminport = DIRECTORY_INSTANCE_ADMIN_PORT
- server.dn = DIRECTORY_INSTANCE_DN
- server.password = DIRECTORY_INSTANCE_PSWD
- server.suffix = DIRECTORY_INSTANCE_SFX
- </script>
-
+
<!-- Run the test suites -->
<iterate var="_suite" in="suiteList">
<sequence>
<try>
<sequence>
<import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/%s/%s/%s_%s.xml' %
- (TESTS_DIR,_group,_suite,_group,_suite)"/>
+ file="'%s/testcases/%s/%s/%s_%s.xml' % (TESTS_DIR,_group,_suite,_group,_suite)"/>
<call function="'main_%s_%s' % (_group,_suite)" />
</sequence>
<catch exception="'STAFException.TestSuite.SetupException'">
<sequence>
<message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
- <throw exception="'STAXException.TestGroupException'" />
</sequence>
</catch>
<catch exception="'STAFException.TestSuite.MainException'">
<sequence>
<message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
- <throw exception="'STAXException.TestGroupException'" />
</sequence>
</catch>
<catch exception="'STAFException.TestSuite.CleanupException'">
<sequence>
<message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
- <throw exception="'STAXException.TestGroupException'" />
</sequence>
</catch>
</try>
</sequence>
</iterate>
-
+
</sequence>
</block>
- <finally>
- <!-- Test Group postamble -->
- <call function="'testGroup_Postamble'"/>
- </finally>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
</try>
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema_cleanup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema_cleanup.xml
index ba1924a..0bed774 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema_cleanup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/schema_cleanup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -39,6 +39,9 @@
<sequence>
+ <!-- Subtree delete all entries under suffix -->
+
+ <!-- Stop Directory Server -->
<call function="'runFunction'">
{ 'functionName' : 'StopDsWithScript' ,
'functionMessage' : 'Stop the Directory Server.' ,
@@ -50,7 +53,8 @@
'dsBindPwd' : server.password }
}
</call>
-
+
+ <!-- Remove topology -->
<call function="'runFunction'">
{ 'functionName' : 'removeTopology' ,
'functionMessage' : 'Remove DS topology.' ,
@@ -58,7 +62,7 @@
}
</call>
- </sequence>
+ </sequence>
<catch exception="'STAXException.Server.RemoveTopologyException'" typevar="eType" var="eInfo">
<sequence>
<message log="1" level="'fatal'">
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/solaris/schema_solaris.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/solaris/schema_solaris.xml
index c730f1a..81c2a5d 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/solaris/schema_solaris.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/schema/solaris/schema_solaris.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="main_schema_solaris"/>
@@ -53,13 +53,21 @@
<try>
<sequence>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : False ,
+ 'startServer' : True ,
+ 'loadData' : True ,
+ 'ldifFile' : '%s/schema/ldifs/schema_start.ldif' % remote.data ,
+ 'stopServer' : False
+ }
+ </call>
<!-- List of Import of Test Functions -->
<script>
importList=[]
- importList.append('schema_setup')
importList.append('solaris/schema_solaris_tests')
- importList.append('schema_cleanup')
</script>
<!-- Import the files for this test suite -->
@@ -68,9 +76,6 @@
file="'%s/%s.xml' % (__groupdir,__import)"/>
</iterate>
- <!-- Test Suite Setup -->
- <call function="'%s_setup' % __group"/>
-
<!-- Specific to solaris schema tests -->
<script>
__baseDN='o=Solaris schema tests, dc=example,%s' % server.suffix
@@ -111,9 +116,18 @@
<finally>
<sequence>
<!-- Test Suite Cleanup -->
- <message>'Finally: Solaris Schema Cleanup.'</message>
- <call function="'%s_cleanup' % __group"/>
- <call function="'testSuite_Postamble'"/>
+ <message>'Finally: Global Schema Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</finally>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/account_activation/security_account_activation.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/account_activation/security_account_activation.xml
index 526e70c..50edb4e 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/account_activation/security_account_activation.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/account_activation/security_account_activation.xml
@@ -23,76 +23,83 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_account_activation"/>
- <function name="security_account_activation">
+ <function name="security_account_activation" scope="local">
<sequence>
- <block name="'account-activation'">
-
- <sequence>
-
- <!--- Test Group information
- #@TestGroupName Security
- #@TestGroupPurpose To test the security functionality.
- #@TestSubgroupName Account Activation
- -->
- <script>
- securityPath = '%s/testcases/security' % (TESTS_DIR)
- securityAcc = '%s/account_activation' % securityPath
- </script>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
+ <block name="'account_activation'">
- <call function="'testSuite_Preamble'"/>
+ <try>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
+ <sequence>
+
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='account_activation'
+ </script>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_setup_account_activation.xml' % securityAcc"/>
- <call function="'setup_account_activation'" />
+ <call function="'testSuite_Preamble'"/>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_test_account.xml' % securityAcc"/>
- <call function="'test_account'" />
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <script>
+ testList = []
+ testList.append('setup_account_activation')
+ testList.append('test_account')
+ testList.append('account_expiration')
+ testList.append('teardown_account_activation')
+ </script>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_account_expiration.xml' % securityAcc"/>
- <call function="'account_expiration'" />
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_teardown_account_activation.xml' % securityAcc"/>
- <call function="'teardown_account_activation'" />
+ </sequence>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Account Activation Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax.xml
index 79e5115..8f7a1ab 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax.xml
@@ -23,81 +23,87 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_auth_pwd_syntax"/>
- <function name="security_auth_pwd_syntax">
+ <function name="security_auth_pwd_syntax" scope="local">
- <sequence>
+ <sequence>
- <block name="'auth-pwd-syntax'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <block name="'auth_pwd_syntax'">
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
+ <sequence>
+
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='auth_pwd_syntax'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_setup_auth_pwd_syntax.xml' % (TESTS_DIR)"/>
- <call function="'setup_auth_pwd_syntax'" />
+ <script>
+ testList = []
+ testList.append('setup_auth_pwd_syntax')
+ testList.append('auth_pwd_syntax_MD5_policy')
+ testList.append('auth_pwd_syntax_SHA256_policy')
+ testList.append('auth_pwd_syntax_SHA384_policy')
+ testList.append('auth_pwd_syntax_SHA512_policy')
+ testList.append('auth_pwd_syntax_SHA1_policy')
+ testList.append('auth_pwd_syntax_def_policy')
+ testList.append('teardown_auth_pwd_syntax')
+ </script>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax_MD5_policy.xml' % (TESTS_DIR)"/>
- <call function="'auth_pwd_syntax_MD5_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax_SHA256_policy.xml' % (TESTS_DIR)"/>
- <call function="'auth_pwd_syntax_SHA256_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax_SHA384_policy.xml' % (TESTS_DIR)"/>
- <call function="'auth_pwd_syntax_SHA384_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax_SHA512_policy.xml' % (TESTS_DIR)"/>
- <call function="'auth_pwd_syntax_SHA512_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax_SHA1_policy.xml' % (TESTS_DIR)"/>
- <call function="'auth_pwd_syntax_SHA1_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_auth_pwd_syntax_def_policy.xml' % (TESTS_DIR)"/>
- <call function="'auth_pwd_syntax_def_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/auth_pwd_syntax/security_teardown_auth_pwd_syntax.xml' % (TESTS_DIR)"/>
- <call function="'teardown_auth_pwd_syntax'" />
-
+ <iterate var="_test" in="testList">
+ <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+ </sequence>
+ </iterate>
+
+ </sequence>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Auth Password Syntax Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
- </sequence>
+
+ </sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml
index b0f33a1..1b70cdc 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/bind_no_pwd/security_bind_no_pwd.xml
@@ -23,61 +23,82 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_bind_no_pwd"/>
- <function name="security_bind_no_pwd">
+ <function name="security_bind_no_pwd" scope="local">
<sequence>
- <block name="'bind-no-pwd'">
-
- <sequence>
+ <block name="'bind_no_pwd'">
+
+ <try>
+
+ <sequence>
+
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='bind_no_pwd'
+ </script>
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/bind_no_pwd/security_setup_bind_no_pwd.xml' % (TESTS_DIR)"/>
- <call function="'setup_bind_no_pwd'" />
+ <call function="'testSuite_Preamble'"/>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/bind_no_pwd/security_pwd_null.xml' % (TESTS_DIR)"/>
- <call function="'pwd_null'" />
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <script>
+ testList = []
+ testList.append('setup_bind_no_pwd')
+ testList.append('pwd_null')
+ testList.append('teardown_bind_no_pwd')
+ </script>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/bind_no_pwd/security_teardown_bind_no_pwd.xml' % (TESTS_DIR)"/>
- <call function="'teardown_bind_no_pwd'" />
+ <iterate var="_test" in="testList">
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
+ </sequence>
+ </iterate>
+
+ </sequence>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Bind No Password Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
- </sequence>
+
+ </sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth.xml
index 35c6e7e..febd2aa 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth.xml
@@ -23,77 +23,83 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="client_auth"/>
- <function name="client_auth">
+ <function name="client_auth" scope="local">
<sequence>
<block name="'client_auth'">
-
- <sequence>
-
- <script>
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
- <call function="'testSuite_Preamble'"/>
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/client_auth_lib.xml' % (TESTS_DIR)" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
- <!-- client authentication setup -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/client_auth_setup.xml' % (TESTS_DIR)"/>
- <call function="'client_auth_setup'" />
-
-
- <!-- fingerprint certificates mapper -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/fingerprint_mapper.xml' % (TESTS_DIR)"/>
- <call function="'fingerprint_mapper'" />
-
-
- <!-- subject DN to user attribut certificate mapper -->
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/subject_dn_mapper.xml' % (TESTS_DIR)"/>
- <call function="'subject_dn_mapper'" />
-
- <!-- subject attribute to user attribut certificate mapper -->
+ <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/subject_attribute_mapper.xml' % (TESTS_DIR)"/>
- <call function="'subject_attribute_mapper'" />
-
- <!-- subject equals dn certificate mapper -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/equal_dn_mapper.xml' % (TESTS_DIR)"/>
- <call function="'equal_dn_mapper'" />
-
- <!-- client authentication teardown -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/client_auth/client_auth_teardown.xml' % (TESTS_DIR)"/>
- <call function="'client_auth_teardown'" />
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='client_auth'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/client_auth_lib.xml' % (TESTS_DIR,_group,_suite)"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
+ <script>
+ testList = []
+ testList.append('client_auth_setup')
+ testList.append('fingerprint_mapper')
+ testList.append('subject_dn_mapper')
+ testList.append('subject_attribute_mapper')
+ testList.append('equal_dn_mapper')
+ testList.append('client_auth_teardown')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
-
- <call function="'testSuite_Postamble'"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
- </sequence>
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Client Auth Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml
index 6b2af30..d84ac7e 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/client_auth/client_auth_setup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="client_auth_setup"/>
@@ -353,7 +353,7 @@
listAttr.append('objectclass:person')
listAttr.append('objectclass:ds-certificate-user')
listAttr.append('objectclass:strongAuthenticationUser')
- listAttr.append('userCertificate;binary: bad_certificate')
+ listAttr.append('userCertificate;binary:: YmFkX2NlcnRpZmljYXRlCgoK')
listAttr.append('givenname:%s' % USER_1_CERT)
listAttr.append('sn:%s' % USER_1_CERT)
listAttr.append('cn:%s' % USER_1_CERT)
@@ -440,7 +440,7 @@
listAttr.append('objectclass:person')
listAttr.append('objectclass:ds-certificate-user')
listAttr.append('objectclass:strongAuthenticationUser')
- listAttr.append('userCertificate;binary: bad_certificate')
+ listAttr.append('userCertificate;binary:: YmFkX2NlcnRpZmljYXRlCgoK')
listAttr.append('givenname:%s' % USER_2_CERT)
listAttr.append('sn:%s' % USER_2_CERT)
listAttr.append('cn:%s' % USER_2_CERT)
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_custom_jks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_custom_jks.xml
index 1cd5f81..26c5462 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_custom_jks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_custom_jks.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="bob_custom_jks"/>
+ <defaultcall function="security_bob_custom_jks"/>
- <function name="bob_custom_jks">
+ <function name="security_bob_custom_jks">
<!---
Place suite-specific test information here.
#@TestSuiteName JKS Tests
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_jks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_jks.xml
index 72095cb..86b19cf 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_jks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_bob_jks.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="bob_jks"/>
+ <defaultcall function="security_bob_jks"/>
- <function name="bob_jks">
+ <function name="security_bob_jks">
<!---
Place suite-specific test information here.
#@TestSuiteName JKS Tests
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_jks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_jks.xml
index 44af562..3905ba3 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_jks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/jks/security_jks.xml
@@ -23,53 +23,76 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_jks"/>
- <function name="security_jks">
+ <function name="security_jks" scope="local">
<sequence>
<block name="'jks'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/jks/security_bob_jks.xml' % (TESTS_DIR)"/>
- <call function="'bob_jks'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/jks/security_bob_custom_jks.xml' % (TESTS_DIR)"/>
- <call function="'bob_custom_jks'" />
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
+ <sequence>
- <call function="'testSuite_Postamble'"/>
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='jks'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
- </sequence>
+ <script>
+ testList = []
+ testList.append('security_bob_jks')
+ testList.append('security_bob_custom_jks')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global JKS Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
</block>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_bob_pkcs12.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_bob_pkcs12.xml
index ed88109..1fe6b6e 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_bob_pkcs12.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_bob_pkcs12.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="bob_pkcs12"/>
+ <defaultcall function="security_bob_pkcs12"/>
- <function name="bob_pkcs12">
+ <function name="security_bob_pkcs12">
<!---
Place suite-specific test information here.
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_pkcs12.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_pkcs12.xml
index 21edb0f..e797292 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_pkcs12.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_pkcs12.xml
@@ -23,62 +23,82 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_pkcs12"/>
- <function name="security_pkcs12">
+ <function name="security_pkcs12" scope="local">
<sequence>
<block name="'pkcs12'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pkcs12/security_setup_pkcs12.xml' % (TESTS_DIR)"/>
- <call function="'setup_pkcs12'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pkcs12/security_bob_pkcs12.xml' % (TESTS_DIR)"/>
- <call function="'bob_pkcs12'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pkcs12/security_teardown_pkcs12.xml' % (TESTS_DIR)"/>
- <call function="'teardown_pkcs12'" />
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
- <call function="'testSuite_Postamble'"/>
+ <sequence>
- </sequence>
-
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='pkcs12'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <script>
+ testList = []
+ testList.append('security_setup_pkcs12')
+ testList.append('security_bob_pkcs12')
+ testList.append('security_teardown_pkcs12')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global PKCS#12 Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_setup_pkcs12.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_setup_pkcs12.xml
index 3125608..dba8070 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_setup_pkcs12.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_setup_pkcs12.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="setup_pkcs12"/>
+ <defaultcall function="security_setup_pkcs12"/>
- <function name="setup_pkcs12">
+ <function name="security_setup_pkcs12">
<!---
Place group-specific test information here.
#@TestGroupName Security
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_teardown_pkcs12.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_teardown_pkcs12.xml
index 4c7b838..97c1c07 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_teardown_pkcs12.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pkcs12/security_teardown_pkcs12.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="teardown_pkcs12"/>
+ <defaultcall function="security_teardown_pkcs12"/>
- <function name="teardown_pkcs12">
+ <function name="security_teardown_pkcs12">
<!---
Place suite-specific test information here.
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
index 7b3966f..89a735d 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy/security_pwd_policy.xml
@@ -23,125 +23,93 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_pwd_policy"/>
- <function name="security_pwd_policy">
+ <function name="security_pwd_policy" scope="local">
<sequence>
- <block name="'pwd-policy'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
+ <block name="'pwd_policy'">
+
+ <try>
+
+ <sequence>
+
+ <script>
CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <!---
- Place group-specific test information here.
- #@TestGroupName Security
- #@TestGroupPurpose To test the security functionality.
- #@TestSubgroupName Password Policy
- -->
-
- <call function="'testSuite_Preamble'"/>
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='pwd_policy'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+ <script>
+ testList = []
+ testList.append('setup_pwd_policy')
+ testList.append('user_pwd_policy')
+ testList.append('force_pwd_change')
+ testList.append('force_pwd_change_all_users')
+# DISABLED testList.append('enable_max_pwd_age')
+# DISABLED testList.append('disable_max_pwd_age')
+ testList.append('min_pwd_age')
+ testList.append('lockout_fail_cnt')
+ testList.append('grace_login')
+ testList.append('mult_pwd_policies')
+ testList.append('preencoded_pwds')
+ testList.append('lockout_duration')
+ testList.append('last_login')
+ testList.append('teardown_pwd_policy')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
-
+ </sequence>
+ </iterate>
+
+ </sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_setup_pwd_policy.xml'
- % (TESTS_DIR)"/>
- <call function="'setup_pwd_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_user_pwd_policy.xml'
- % (TESTS_DIR)"/>
- <call function="'user_pwd_policy'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_force_pwd_change.xml'
- % (TESTS_DIR)"/>
- <call function="'force_pwd_change'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
-file="'%s/testcases/security/pwd_policy/security_force_pwd_change_all_users.xml'
-% (TESTS_DIR)"/>
- <call function="'force_pwd_change_all_users'" />
- <!--
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_enable_max_pwd_age.xml' % (TESTS_DIR)"/>
- <call function="'enable_max_pwd_age'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_disable_max_pwd_age.xml' % (TESTS_DIR)"/>
- <call function="'disable_max_pwd_age'" />
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_min_pwd_age.xml'
- % (TESTS_DIR)"/>
- <call function="'min_pwd_age'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_lockout_fail_cnt.xml'
- % (TESTS_DIR)"/>
- <call function="'lockout_fail_cnt'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_grace_login.xml'
- % (TESTS_DIR)"/>
- <call function="'grace_login'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_mult_pwd_policies.xml'
- % (TESTS_DIR)"/>
- <call function="'mult_pwd_policies'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_preencoded_pwds.xml'
- % (TESTS_DIR)"/>
- <call function="'preencoded_pwds'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_lockout_duration.xml'
- % (TESTS_DIR)"/>
- <call function="'lockout_duration'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_last_login.xml'
- % (TESTS_DIR)"/>
- <call function="'last_login'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy/security_teardown_pwd_policy.xml'
- % (TESTS_DIR)"/>
- <call function="'teardown_pwd_policy'" />
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Password Policy Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_pwd_policy_root.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_pwd_policy_root.xml
index 0b99094..2af005e 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_pwd_policy_root.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_pwd_policy_root.xml
@@ -23,58 +23,81 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_pwd_policy_root"/>
- <function name="security_pwd_policy_root">
+ <function name="security_pwd_policy_root" scope="local">
<sequence>
- <block name="'pwd-policy-root'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <block name="'pwd_policy_root'">
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy_root/security_root_user_tests.xml' % (TESTS_DIR)"/>
- <call function="'root_user_tests'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_policy_root/security_root_auth.xml' % (TESTS_DIR)"/>
- <call function="'security_root_auth'" />
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
- <call function="'testSuite_Postamble'"/>
+ <sequence>
- </sequence>
-
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='pwd_policy_root'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <script>
+ testList = []
+ testList.append('root_user_tests')
+ testList.append('root_auth')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Start TLS Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_auth.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_auth.xml
index 9858bcb..cf1443c 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_auth.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_auth.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="security_root_auth"/>
+ <defaultcall function="root_auth"/>
- <function name="security_root_auth">
+ <function name="root_auth">
<sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_user_tests.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_user_tests.xml
index 974a5bc..5c7ad3f 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_user_tests.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_policy_root/security_root_user_tests.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml
index fc0bb12..84012a3 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_storage/security_pwd_storage.xml
@@ -23,120 +23,97 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_pwd_storage"/>
- <function name="security_pwd_storage">
+ <function name="security_pwd_storage" scope="local">
<sequence>
- <block name="'pwd-storage'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
+ <block name="'pwd_storage'">
- <call function="'testSuite_Preamble'"/>
+ <try>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_setup_pwd_storage.xml' % (TESTS_DIR)"/>
- <call function="'setup_pwd_storage'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_SSHA.xml' % (TESTS_DIR)"/>
- <call function="'pwd_SSHA'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_SHA.xml' % (TESTS_DIR)"/>
- <call function="'pwd_SHA'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_SSHA256.xml' % (TESTS_DIR)"/>
- <call function="'pwd_SSHA256'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_SSHA384.xml' % (TESTS_DIR)"/>
- <call function="'pwd_SSHA384'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_SSHA512.xml' % (TESTS_DIR)"/>
- <call function="'pwd_SSHA512'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_MD5.xml' % (TESTS_DIR)"/>
- <call function="'pwd_MD5'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_SMD5.xml' % (TESTS_DIR)"/>
- <call function="'pwd_SMD5'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_BASE64.xml' % (TESTS_DIR)"/>
- <call function="'pwd_BASE64'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_3DES.xml' % (TESTS_DIR)"/>
- <call function="'pwd_3DES'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_AES.xml' % (TESTS_DIR)"/>
- <call function="'pwd_AES'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_RC4.xml' % (TESTS_DIR)"/>
- <call function="'pwd_RC4'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_blowfish.xml' % (TESTS_DIR)"/>
- <call function="'pwd_BLOWFISH'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_CLEAR.xml' % (TESTS_DIR)"/>
- <call function="'pwd_CLEAR'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_pwd_CRYPT.xml' % (TESTS_DIR)"/>
- <call function="'pwd_CRYPT'" />
- <!--
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_multiple_schemes.xml' % (TESTS_DIR)"/>
- <call function="'multiple_schemes'" />
- -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_deprecated_schemes.xml' % (TESTS_DIR)"/>
- <call function="'deprecated_schemes'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/pwd_storage/security_teardown_pwd_storage.xml' % (TESTS_DIR)"/>
- <call function="'teardown_pwd_storage'" />
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
- <call function="'testSuite_Postamble'"/>
+ <sequence>
- </sequence>
-
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='pwd_storage'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <script>
+ testList = []
+ testList.append('setup_pwd_storage')
+ testList.append('pwd_SSHA')
+ testList.append('pwd_SHA')
+ testList.append('pwd_SSHA256')
+ testList.append('pwd_SSHA384')
+ testList.append('pwd_SSHA512')
+ testList.append('pwd_MD5')
+ testList.append('pwd_SMD5')
+ testList.append('pwd_BASE64')
+ testList.append('pwd_3DES')
+ testList.append('pwd_AES')
+ testList.append('pwd_RC4')
+ testList.append('pwd_BLOWFISH')
+ testList.append('pwd_CLEAR')
+ testList.append('pwd_CRYPT')
+# DISABLED testList.append('multiple_schemes')
+ testList.append('deprecated_schemes')
+ testList.append('teardown_pwd_storage')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Password Storage Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
- </sequence>
+
+ </sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_validator/security_pwd_validator.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_validator/security_pwd_validator.xml
index 80c6aee..b9bc992 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_validator/security_pwd_validator.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/pwd_validator/security_pwd_validator.xml
@@ -23,108 +23,91 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_pwd_validator"/>
- <function name="security_pwd_validator">
+ <function name="security_pwd_validator" scope="local">
<sequence>
- <block name="'pwd-validator'">
-
- <sequence>
-
-
- <!--- Test Group information
- #@TestGroupName Security
- #@TestGroupPurpose To test the security functionality.
- #@TestSubgroupName Password Validator
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
+ <block name="'pwd_validator'">
+
+ <try>
+
+ <sequence>
+
+ <script>
CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <script>
- securityPath = '%s/testcases/security/pwd_validator' % TESTS_DIR
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='pwd_validator'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+ <script>
+ testList = []
+ testList.append('setup_pwd_validator')
+ testList.append('pwd_length')
+ testList.append('attribute_value')
+ testList.append('character_set')
+ testList.append('history_based')
+ testList.append('similarity_based')
+ testList.append('dictionary')
+ testList.append('unique_chars')
+ testList.append('repeat_chars')
+ testList.append('mult_validators')
+ testList.append('skip_val_for_admins')
+ testList.append('teardown_pwd_validator')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
-
+ </sequence>
+ </iterate>
+
+ </sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_setup_pwd_validator.xml' % securityPath"/>
- <call function="'setup_pwd_validator'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_pwd_length.xml' % securityPath"/>
- <call function="'pwd_length'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_attribute_value.xml' % securityPath"/>
- <call function="'attribute_value'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_character_set.xml' % securityPath"/>
- <call function="'character_set'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_history_based.xml' % securityPath"/>
- <call function="'history_based'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_similarity_based.xml' % securityPath"/>
- <call function="'similarity_based'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_dictionary.xml' % securityPath"/>
- <call function="'dictionary'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_unique_chars.xml' % securityPath"/>
- <call function="'unique_chars'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_repeat_chars.xml' % securityPath"/>
- <call function="'repeat_chars'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_mult_validators.xml' % securityPath"/>
- <call function="'mult_validators'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_skip_val_for_admins.xml' % securityPath"/>
- <call function="'skip_val_for_admins'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/security_teardown_pwd_validator.xml' % securityPath"/>
- <call function="'teardown_pwd_validator'" />
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Password Validator Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/sasl/security_sasl.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/sasl/security_sasl.xml
index fd1689c..fb4df11 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/sasl/security_sasl.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/sasl/security_sasl.xml
@@ -23,78 +23,86 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_sasl"/>
- <function name="security_sasl">
+ <function name="security_sasl" scope="local">
<sequence>
<block name="'sasl'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_setup_sasl.xml' % (TESTS_DIR)"/>
- <call function="'setup_sasl'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_sasl_anon.xml' % (TESTS_DIR)"/>
- <call function="'sasl_anon'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_sasl_plain.xml' % (TESTS_DIR)"/>
- <call function="'sasl_plain'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_sasl_cram-md5.xml' % (TESTS_DIR)"/>
- <call function="'sasl_cram-md5'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_sasl_digest-md5.xml' % (TESTS_DIR)"/>
- <call function="'sasl_digest-md5'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_sasl_new.xml' % (TESTS_DIR)"/>
- <call function="'sasl_new'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/sasl/security_teardown_sasl.xml' % (TESTS_DIR)"/>
- <call function="'teardown_sasl'" />
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
+ <sequence>
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='sasl'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <script>
+ testList = []
+ testList.append('setup_sasl')
+ testList.append('sasl_anon')
+ testList.append('sasl_plain')
+ testList.append('sasl_cram-md5')
+ testList.append('sasl_digest-md5')
+ testList.append('sasl_new')
+ testList.append('teardown_sasl')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/security_%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global SASL Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
+
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/security.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/security.xml
index 560fbee..5a85b63 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/security.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/security.xml
@@ -23,69 +23,86 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
-
- <defaultcall function="main_security"/>
-
+ <defaultcall function="main_security" />
<function name="main_security">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
-
- <sequence>
-
- <block name="'security'">
-
- <sequence>
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
-
- <!--- Test Group information
- #@TestGroupName Security tests
- #@TestGroupPurpose Test the security.
- -->
- <script>
- CurrentTestPath['group']='security'
- </script>
-
- <call function="'testGroup_Preamble'"/>
-
- <script>
- testList = []
- testList.append(['client_auth','client_auth'])
- testList.append(['jks','security_jks'])
- testList.append(['pkcs12','security_pkcs12'])
- testList.append(['startTLS','security_startTLS'])
- testList.append(['sasl','security_sasl'])
- testList.append(['pwd_policy','security_pwd_policy'])
- testList.append(['pwd_policy_root','security_pwd_policy_root'])
- testList.append(['auth_pwd_syntax','security_auth_pwd_syntax'])
- testList.append(['pwd_validator','security_pwd_validator'])
- testList.append(['pwd_storage','security_pwd_storage'])
- testList.append(['bind_no_pwd','security_bind_no_pwd'])
- testList.append(['account_activation','security_account_activation'])
- </script>
- <iterate var="_test" in="testList">
+ <sequence>
+ <try>
+ <block name="'security'">
<sequence>
+ <!--- Load the job environment for the test group execution -->
<import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/%s/%s.xml' %
- (TESTS_DIR,_test[0],_test[1])"/>
- <call function="'%s' % _test[1]" />
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='security'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append(['client_auth','client_auth'])
+ suiteList.append(['jks','security_jks'])
+ suiteList.append(['pkcs12','security_pkcs12'])
+ suiteList.append(['startTLS','security_startTLS'])
+ suiteList.append(['sasl','security_sasl'])
+ suiteList.append(['pwd_policy','security_pwd_policy'])
+ suiteList.append(['pwd_policy_root','security_pwd_policy_root'])
+ suiteList.append(['auth_pwd_syntax','security_auth_pwd_syntax'])
+ suiteList.append(['pwd_validator','security_pwd_validator'])
+ suiteList.append(['pwd_storage','security_pwd_storage'])
+ suiteList.append(['bind_no_pwd','security_bind_no_pwd'])
+ suiteList.append(['account_activation','security_account_activation'])
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/%s.xml' % (TESTS_DIR,_group,_suite[0],_suite[1])"/>
+ <call function="'%s' % _suite[1]" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite[0]</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite[0]</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite[0]</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
</sequence>
- </iterate>
-
-
- <call function="'testGroup_Postamble'"/>
-
- </sequence>
- </block>
- </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_bob_startTLS.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_bob_startTLS.xml
index 7937af2..5b2f10c 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_bob_startTLS.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_bob_startTLS.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="bob_startTLS"/>
+ <defaultcall function="security_bob_startTLS"/>
- <function name="bob_startTLS">
+ <function name="security_bob_startTLS">
<sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_force_pwd_change_startTLS.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_force_pwd_change_startTLS.xml
index 690df8f..d748092 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_force_pwd_change_startTLS.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_force_pwd_change_startTLS.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="force_pwd_change_startTLS"/>
+ <defaultcall function="security_force_pwd_change_startTLS"/>
- <function name="force_pwd_change_startTLS">
+ <function name="security_force_pwd_change_startTLS">
<sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_setup_startTLS.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_setup_startTLS.xml
index 18980a2..dd12e6b 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_setup_startTLS.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_setup_startTLS.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="setup_startTLS"/>
+ <defaultcall function="security_setup_startTLS"/>
- <function name="setup_startTLS">
+ <function name="security_setup_startTLS">
<sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_startTLS.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_startTLS.xml
index d81f53a..9807633 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_startTLS.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_startTLS.xml
@@ -23,68 +23,83 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="security_startTLS"/>
- <function name="security_startTLS">
+ <function name="security_startTLS" scope="local">
<sequence>
- <block name="'start-tls'">
-
- <sequence>
-
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group']='security'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
+ <block name="'startTLS'">
+ <try>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_setup.xml' % (TESTS_DIR)"/>
- <call function="'security_setup'"/>
-
-
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/startTLS/security_setup_startTLS.xml' % (TESTS_DIR)"/>
- <call function="'setup_startTLS'" />
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/startTLS/security_bob_startTLS.xml' % (TESTS_DIR)"/>
- <call function="'bob_startTLS'" />
+ <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/startTLS/security_force_pwd_change_startTLS.xml' % (TESTS_DIR)"/>
- <call function="'force_pwd_change_startTLS'" />
+ <script>
+ CurrentTestPath['group']='security'
+ CurrentTestPath['suite']=STAXCurrentBlock
+ _group=CurrentTestPath['group']
+ _suite='startTLS'
+ </script>
+
+ <call function="'testSuite_Preamble'"/>
+
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/startTLS/security_teardown_startTLS.xml' % (TESTS_DIR)"/>
- <call function="'teardown_startTLS'" />
+ <script>
+ testList = []
+ testList.append('security_setup_startTLS')
+ testList.append('security_bob_startTLS')
+ testList.append('security_force_pwd_change_startTLS')
+ testList.append('security_teardown_startTLS')
+ </script>
+
+ <iterate var="_test" in="testList">
+ <sequence>
+
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s/%s.xml' % (TESTS_DIR,_group,_suite,_test)"/>
+ <call function="'%s' % _test" />
+
+ </sequence>
+ </iterate>
+
+ </sequence>
+
+ <finally>
+ <sequence>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Global Start TLS Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
+ </sequence>
+ </finally>
-
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/security/security_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'security_cleanup'"/>
-
-
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
+ </try>
+
</block>
-
+
</sequence>
</function>
-</stax>
+</stax>
\ No newline at end of file
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_teardown_startTLS.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_teardown_startTLS.xml
index f828304..67e8ee2 100755
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_teardown_startTLS.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/security/startTLS/security_teardown_startTLS.xml
@@ -23,13 +23,13 @@
!
! CDDL HEADER END
!
- ! Copyright 2006-2008 Sun Microsystems, Inc.
+ ! Copyright 2006-2009 Sun Microsystems, Inc.
! -->
<stax>
- <defaultcall function="teardown_startTLS"/>
+ <defaultcall function="security_teardown_startTLS"/>
- <function name="teardown_startTLS">
+ <function name="security_teardown_startTLS">
<sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml
index 81bb1e2..3a2ddef 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2008 Sun Microsystems, Inc.
+ ! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -108,38 +108,6 @@
<sequence>
<!--- Test Case information
- #@TestMarker setup
- #@TestName setup: add initial entries
- #@TestIssue none
- #@TestPurpose Load the data needed by the test suite.
- #@TestPreamble none
- #@TestStep Load the data needed by the test suite.
- #@TestPostamble none
- #@TestResult Success if importLdif returns 0.
- -->
- <testcase name="getTestCaseName('setup: add initial entries')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'setup: add initial entries'
- </message>
-
- <call function="'importLdif'">
- {
- 'ldifFile' : '%s/snmp/snmp_start.ldif' % remote.data
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
#@TestMarker setup
#@TestName setup: start DS
#@TestIssue none
@@ -181,6 +149,57 @@
</testcase>
<!--- Test Case information
+ #@TestMarker setup
+ #@TestName setup: add initial entries
+ #@TestIssue none
+ #@TestPurpose Load the data needed by the test suite.
+ #@TestPreamble none
+ #@TestStep Load the data needed by the test suite.
+ #@TestPostamble none
+ #@TestResult Success if importLdif returns 0.
+ -->
+ <testcase name="getTestCaseName('setup: add initial entries')">
+
+ <sequence>
+
+ <call function="'testCase_Preamble'"/>
+
+ <message>
+ 'setup: add initial entries'
+ </message>
+
+ <call function="'dsconfigSet'">
+ {
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'password-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'Default Password Policy',
+ 'attributeName' : 'allow-pre-encoded-passwords',
+ 'attributeValue' : 'true'
+ }
+ </call>
+
+ <call function="'addEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'entryToBeAdded' : '%s/snmp/snmp_start.ldif'
+ % remote.data,
+ 'verbose' : False
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+
+ </sequence>
+
+ </testcase>
+
+ <!--- Test Case information
#@TestMarker setup
#@TestName setup: get default SNMP connection handler
properties
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/allowed-tasks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/allowed-tasks.xml
index 1b2e940..3909f37 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/allowed-tasks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/allowed-tasks.xml
@@ -23,87 +23,110 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="allowed-tasks"/>
<function name="allowed-tasks" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
- <!--- Test Suite information
- #@TestSuiteName Allowed tasks
- #@TestSuitePurpose Control which tasks are allowed
- #@TestSuiteID export Tests
- #@TestSuiteGroup export
- #@TestGroup tasks
- #@TestScript allowed-tasks.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
-
-
-
- <!--- Test Case information
- #@TestMarker Allowed tasks
- #@TestName Tasks control
- #@TestPurpose Control which tasks are allowed
- #@TestPreamble
- #@TestStep Change the list of allowed tasks
- #@TestStep Check we can only schedule allowed tasks
- #@TestPostamble
- #@TestResult
- -->
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+ <!--- Test Suite information
+ #@TestSuiteName Allowed tasks
+ #@TestSuitePurpose Control which tasks are allowed
+ #@TestSuiteID export Tests
+ #@TestSuiteGroup export
+ #@TestGroup tasks
+ #@TestScript allowed-tasks.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- <testcase name="getTestCaseName('Control which tasks are allowed')">
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+
+ <!--- Test Case information
+ #@TestMarker Allowed tasks
+ #@TestName Tasks control
+ #@TestPurpose Control which tasks are allowed
+ #@TestPreamble
+ #@TestStep Change the list of allowed tasks
+ #@TestStep Check we can only schedule allowed tasks
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('Control which tasks are allowed')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-global-configuration-prop',
+ 'optionsString' : '--remove allowed-task:org.opends.server.tasks.ExportTask',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- the export task is not allowed. the task must be rejected -->
+
+ <call function="'exportLdif'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'ldifFile' : '%s/tasks/export_asynchronous' % remote.data,
+ 'startTask' : '0',
+ 'backEnd' : DIRECTORY_INSTANCE_BE,
+ 'expectedRC' : 1}
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-global-configuration-prop',
+ 'optionsString' : '--add allowed-task:org.opends.server.tasks.ExportTask',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-global-configuration-prop',
- 'optionsString' : '--remove allowed-task:org.opends.server.tasks.ExportTask',
- 'expectedRC' : 0
- }
- </call>
-
- <!-- the export task is not allowed. the task must be rejected -->
-
- <call function="'exportLdif'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'ldifFile' : '%s/tasks/export_asynchronous' % remote.data,
- 'startTask' : '0',
- 'backEnd' : DIRECTORY_INSTANCE_BE,
- 'expectedRC' : 1}
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'subcommand' : 'set-global-configuration-prop',
- 'optionsString' : '--add allowed-task:org.opends.server.tasks.ExportTask',
- 'expectedRC' : 0
- }
- </call>
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Tasks Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
+
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml
index 06f4d66..6293d94 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/backup_db.xml
@@ -29,500 +29,525 @@
<defaultcall function="backup_db"/>
<function name="backup_db" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
- <!--- Test Suite information
- #@TestSuiteName Backup tasks
- #@TestSuitePurpose Validate the backup functionality in mode task
- #@TestSuiteID backup Tests
- #@TestSuiteGroup backup
- #@TestGroup tasks
- #@TestScript backup_db.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+
+ <!--- Test Suite information
+ #@TestSuiteName Backup tasks
+ #@TestSuitePurpose Validate the backup functionality in mode task
+ #@TestSuiteID backup Tests
+ #@TestSuiteGroup backup
+ #@TestGroup tasks
+ #@TestScript backup_db.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- <!--- Test Case information
- #@TestMarker Backup tasks
- #@TestName Schedule a recurring Backup task
- #@TestPurpose Schedule a recurring Backup in task mode
- #@TestPreamble
- #@TestStep Create a recurring Backup in task mode
- #@TestStep specify the recurringTask option with the value
- #@TestStep non null to schedule a recurring execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule recurring backup task for scheduled execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <!--- ReStart DS to clear the output of manage-tasks-->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
-
- <call function="'backup'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
- 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
- 'backupID' : 'recurring-backup-1',
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-backup-1',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 120000 }
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-backup-1',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Completed successfully',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <!-- cancel the recurring task recurring-backup-1 with manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsCancel' : 'recurring-backup-1',
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Task recurring-backup-1 canceled',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Backup tasks
- #@TestName Backup task in asynchronous mode
- #@TestPurpose Schedule a backup in task mode to be executed immedialy in asynchronous mode
- #@TestPreamble
- #@TestStep Execute a backup in mode task
- #@TestStep Execute manage-tasks tools and check a backup task is managed
- #@TestStep Specify the -t 0
- #@TestStep The task is scheduled for immediate execution
- #@TestSteps The script returns immedialy after scheduling the task
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule backup task for immediate execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <call function="'backup'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'backupDir' : '%s/tasks/backup_asynchronous' % remote.data,
- 'startTask' : '0',
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <script>checkRC=9999</script>
- <loop from="1" to="10" var="loop" while="checkRC != 0">
- <sequence>
- <message>'LOOP %s' % loop</message>
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- currentDate=strftime("%Y%m%d",localtime())
- </script>
-
- <call function="'searchString'">
- { 'expectedString' : '%s.* Backup Completed successfully' \
- % currentDate,
- 'returnString' : returnString ,
- 'expectedRC' : 'noCheck' }
- </call>
-
- <script>
- checkRC = STAXResult[0]
- </script>
-
- </sequence>
- </loop>
-
- <message>'--- Check log files backup_asynchronous ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
- 'foldername' : '%s/tasks' % remote.data,
- 'filename' : 'backup_asynchronous'
- }
- </call>
-
- <!-- check the export ldif file has been created-->
- <if expr="len(cmdResult) == 0">
- <call function="'testFailed'"/>
- <else>
- <call function="'testPassed'"/>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Backup tasks
- #@TestName Backup task in synchronous mode
- #@TestPurpose Schedule a Backup in task mode to be executed immedialy in synchronous mode
- #@TestPreamble
- #@TestStep Execute a backup in mode task
- #@TestStep Don't specify the -t option
- #@TestStep The task is scheduled for immediate execution and the script must wait the end of the task to return
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule backup task for immediate execution in synchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'backup'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'backupDir' : '%s/tasks/backup_synchronous' % remote.data,
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <message>'--- Check log files ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
- 'foldername' : '%s/tasks' % remote.data,
- 'filename' : 'backup_synchronous'
- }
- </call>
- <!-- check the export ldif file has been created-->
- <if expr="len(cmdResult) == 0">
- <call function="'testFailed'"/>
- <else>
- <call function="'testPassed'"/>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Backup tasks
- #@TestName Schedule a Backup task
- #@TestPurpose Schedule a Backup in task mode
- #@TestPreamble
- #@TestStep Execute a Backup in task mode
- #@TestStep specify the -t option with the value non null to schedule an execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule backup task for scheduled execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <call function="'backup'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'startTask' : '20061212000000',
- 'backupDir' : '%s/tasks/backup_schedule_asynchronous' % remote.data,
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- { 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
- 'returnString' : returnString ,
- 'knownIssue' : '3909' ,
- 'expectedRC' : '1' }
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker Backup tasks
+ #@TestName Schedule a recurring Backup task
+ #@TestPurpose Schedule a recurring Backup in task mode
+ #@TestPreamble
+ #@TestStep Create a recurring Backup in task mode
+ #@TestStep specify the recurringTask option with the value
+ #@TestStep non null to schedule a recurring execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule recurring backup task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!--- ReStart DS to clear the output of manage-tasks-->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
</call>
-
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000 }
+ </call>
+
+ <call function="'backup'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
+ 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
+ 'backupID' : 'recurring-backup-1',
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-backup-1',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 120000 }
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-backup-1',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Completed successfully',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <!-- cancel the recurring task recurring-backup-1 with manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsCancel' : 'recurring-backup-1',
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Task recurring-backup-1 canceled',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
<!--- Test Case information
- #@TestMarker Backup tasks
- #@TestName Schedule a recurring Backup task with the same name as previously
- #@TestPurpose Schedule a recurring Backup in task mode with the same name see issue 3373
- #@TestPreamble
- #@TestStep Create a recurring Backup in task mode with the same name as previously
- #@TestStep specify the recurringTask option with the value
- #@TestStep non null to schedule a recurring execution
- #@TestPostamble
- #@TestResult
- -->
+ #@TestMarker Backup tasks
+ #@TestName Backup task in asynchronous mode
+ #@TestPurpose Schedule a backup in task mode to be executed immedialy in asynchronous mode
+ #@TestPreamble
+ #@TestStep Execute a backup in mode task
+ #@TestStep Execute manage-tasks tools and check a backup task is managed
+ #@TestStep Specify the -t 0
+ #@TestStep The task is scheduled for immediate execution
+ #@TestSteps The script returns immedialy after scheduling the task
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule backup task for immediate execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <call function="'backup'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'backupDir' : '%s/tasks/backup_asynchronous' % remote.data,
+ 'startTask' : '0',
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <script>checkRC=9999</script>
+ <loop from="1" to="10" var="loop" while="checkRC != 0">
+ <sequence>
+ <message>'LOOP %s' % loop</message>
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ currentDate=strftime("%Y%m%d",localtime())
+ </script>
+
+ <call function="'searchString'">
+ { 'expectedString' : '%s.* Backup Completed successfully' \
+ % currentDate,
+ 'returnString' : returnString ,
+ 'expectedRC' : 'noCheck' }
+ </call>
+
+ <script>
+ checkRC = STAXResult[0]
+ </script>
+
+ </sequence>
+ </loop>
+
+ <message>'--- Check log files backup_asynchronous ---'</message>
+ <call function="'listFolder'">
+ { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
+ 'foldername' : '%s/tasks' % remote.data,
+ 'filename' : 'backup_asynchronous'
+ }
+ </call>
+
+ <!-- check the export ldif file has been created-->
+ <if expr="len(cmdResult) == 0">
+ <call function="'testFailed'"/>
+ <else>
+ <call function="'testPassed'"/>
+ </else>
+ </if>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Backup tasks
+ #@TestName Backup task in synchronous mode
+ #@TestPurpose Schedule a Backup in task mode to be executed immedialy in synchronous mode
+ #@TestPreamble
+ #@TestStep Execute a backup in mode task
+ #@TestStep Don't specify the -t option
+ #@TestStep The task is scheduled for immediate execution and the script must wait the end of the task to return
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule backup task for immediate execution in synchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'backup'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'backupDir' : '%s/tasks/backup_synchronous' % remote.data,
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <message>'--- Check log files ---'</message>
+ <call function="'listFolder'">
+ { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
+ 'foldername' : '%s/tasks' % remote.data,
+ 'filename' : 'backup_synchronous'
+ }
+ </call>
+ <!-- check the export ldif file has been created-->
+ <if expr="len(cmdResult) == 0">
+ <call function="'testFailed'"/>
+ <else>
+ <call function="'testPassed'"/>
+ </else>
+ </if>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Backup tasks
+ #@TestName Schedule a Backup task
+ #@TestPurpose Schedule a Backup in task mode
+ #@TestPreamble
+ #@TestStep Execute a Backup in task mode
+ #@TestStep specify the -t option with the value non null to schedule an execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule backup task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <call function="'backup'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'startTask' : '20061212000000',
+ 'backupDir' : '%s/tasks/backup_schedule_asynchronous' % remote.data,
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchString'">
+ { 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
+ 'returnString' : returnString ,
+ 'knownIssue' : '3909' ,
+ 'expectedRC' : '1' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Backup tasks
+ #@TestName Schedule a recurring Backup task with the same name as previously
+ #@TestPurpose Schedule a recurring Backup in task mode with the same name see issue 3373
+ #@TestPreamble
+ #@TestStep Create a recurring Backup in task mode with the same name as previously
+ #@TestStep specify the recurringTask option with the value
+ #@TestStep non null to schedule a recurring execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+
+ <testcase name="getTestCaseName('schedule recurring backup task with the same name as previously')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!--- ReStart DS to clear the output of manage-tasks-->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ </call>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-backup-1',
+ 'expectedResult' : '0' }
+ </call>
+
+ <call function="'backup'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
+ 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
+ 'backupID' : 'recurring-backup-1',
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-backup-1',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 120000 }
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-backup-1',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Completed successfully',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ </call>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ {
+ 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'grep'">
+ {
+ 'location' : STAF_REMOTE_HOSTNAME ,
+ 'filename' : '%s/%s/logs/server.out' % (DIRECTORY_INSTANCE_DIR, OPENDSNAME) ,
+ 'testString': 'because another task already exists with the same ID' ,
+ 'expectedRC': 1
+ }
+ </call>
+
+ <!---
+ <call function="'setKnownIssue'">
+ { 'issueId' : '3773' }
+ </call>
+ -->
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
-
-<testcase name="getTestCaseName('schedule recurring backup task with the same name as previously')">
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <!--- ReStart DS to clear the output of manage-tasks-->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-backup-1',
- 'expectedResult' : '0' }
- </call>
-
- <call function="'backup'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
- 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
- 'backupID' : 'recurring-backup-1',
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-backup-1',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 120000 }
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-backup-1',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Completed successfully',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : '%s/%s/logs/server.out' % (DIRECTORY_INSTANCE_DIR, OPENDSNAME) ,
- 'testString': 'because another task already exists with the same ID' ,
- 'expectedRC': 1
- }
- </call>
-
- <!---
- <call function="'setKnownIssue'">
- { 'issueId' : '3773' }
- </call>
- -->
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Tasks Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml
index 020d147..ba5d6bc 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/export-ldif.xml
@@ -29,362 +29,385 @@
<defaultcall function="export-ldif"/>
<function name="export-ldif" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
- <!--- Test Suite information
- #@TestSuiteName Export tasks
- #@TestSuitePurpose Validate the export functionality in mode task
- #@TestSuiteID export Tests
- #@TestSuiteGroup export
- #@TestGroup tasks
- #@TestScript export_ldif.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
-
- <!--- Test Case information
- #@TestMarker Export tasks
- #@TestName Export task in asynchronous mode
- #@TestPurpose Schedule a Export in task mode to be executed immedialy in asynchronous mode
- #@TestPreamble
- #@TestStep Execute a export-ldif in a task
- #@TestStep Specify the -t option with the value 0
- #@TestStep The task is scheduled for immediate execution
- #@TestStep The script returns immedialy after scheduling the task
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule export-ldif task for immediate execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'exportLdif'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'ldifFile' : '%s/tasks/export_asynchronous' % remote.data,
- 'startTask' : '0',
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <script>checkRC=9999</script>
- <loop from="1" to="10" var="loop" while="checkRC != 0">
- <sequence>
- <message>'LOOP %s' % loop</message>
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- {'location' : STAF_REMOTE_HOSTNAME,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- currentDate=strftime("%Y%m%d",localtime())
- </script>
-
- <call function="'searchString'">
- { 'expectedString' : '%s.* Export Completed successfully' \
- % currentDate,
- 'returnString' : returnString ,
- 'expectedRC' : 'noCheck' }
- </call>
-
- <script>
- checkRC = STAXResult[0]
- </script>
-
- </sequence>
- </loop>
-
- <message>'--- Check log files export_asynchronous ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
- 'foldername' : '%s/tasks' % remote.data,
- 'filename' : 'export_asynchronous'
- }
- </call>
-
- <!-- check the export ldif file has been created-->
- <if expr="len(cmdResult) == 0">
- <call function="'testFailed'"/>
- <else>
- <call function="'testPassed'"/>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Export tasks
- #@TestName Export task in synchronous mode
- #@TestPurpose Schedule a Export in task mode to be executed immedialy in synchronous mode
- #@TestPreamble
- #@TestStep Execute a export-ldif in a task
- #@TestStep Execute manage-tasks output and check the Export task is returned
- #@TestStep Don't specify the -t option
- #@TestStep The task is scheduled for immediate execution and the script must wait the end of the export
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule export-ldif task for immediate execution in synchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'exportLdif'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'ldifFile' : '%s/tasks/export_synchronous' % remote.data,
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
+ <!--- Test Suite information
+ #@TestSuiteName Export tasks
+ #@TestSuitePurpose Validate the export functionality in mode task
+ #@TestSuiteID export Tests
+ #@TestSuiteGroup export
+ #@TestGroup tasks
+ #@TestScript export_ldif.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Completed successfully',
- 'expectedResult' : '1' }
- </call>
-
-
- <message>'--- Check log files ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
- 'foldername' : '%s/tasks' % remote.data,
- 'filename' : 'export_synchronous'
- }
- </call>
- <!-- check the export ldif file has been created-->
- <if expr="len(cmdResult) == 0">
- <call function="'testFailed'"/>
- <else>
- <call function="'testPassed'"/>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Export tasks
- #@TestName Schedule a Export task
- #@TestPurpose Schedule a Export in task mode
- #@TestPreamble
- #@TestStep Execute a export-ldif in a task
- #@TestStep Specify the -t option with the value non null to schedule an execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule export-ldif task for scheduled execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <call function="'exportLdif'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'ldifFile' : '%s/tasks/export_schedule_asynchronous' % remote.data,
- 'startTask' : '20061212000000',
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- { 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
- 'returnString' : returnString ,
- 'knownIssue' : '3909' ,
- 'expectedRC' : '1' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
<!--- Test Case information
- #@TestMarker Export tasks
- #@TestName Schedule a recurring Export task
- #@TestPurpose Schedule a recurring Export in task mode
- #@TestPreamble
- #@TestStep Create a recurring Export in task mode
- #@TestStep specify the recurringTask option with the value
- #@TestStep non null to schedule a recurring execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule recurring export task')">
+ #@TestMarker Export tasks
+ #@TestName Export task in asynchronous mode
+ #@TestPurpose Schedule a Export in task mode to be executed immedialy in asynchronous mode
+ #@TestPreamble
+ #@TestStep Execute a export-ldif in a task
+ #@TestStep Specify the -t option with the value 0
+ #@TestStep The task is scheduled for immediate execution
+ #@TestStep The script returns immedialy after scheduling the task
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule export-ldif task for immediate execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'exportLdif'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'ldifFile' : '%s/tasks/export_asynchronous' % remote.data,
+ 'startTask' : '0',
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <script>checkRC=9999</script>
+ <loop from="1" to="10" var="loop" while="checkRC != 0">
+ <sequence>
+ <message>'LOOP %s' % loop</message>
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ {'location' : STAF_REMOTE_HOSTNAME,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ currentDate=strftime("%Y%m%d",localtime())
+ </script>
+
+ <call function="'searchString'">
+ { 'expectedString' : '%s.* Export Completed successfully' \
+ % currentDate,
+ 'returnString' : returnString ,
+ 'expectedRC' : 'noCheck' }
+ </call>
+
+ <script>
+ checkRC = STAXResult[0]
+ </script>
+
+ </sequence>
+ </loop>
+
+ <message>'--- Check log files export_asynchronous ---'</message>
+ <call function="'listFolder'">
+ { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
+ 'foldername' : '%s/tasks' % remote.data,
+ 'filename' : 'export_asynchronous'
+ }
+ </call>
+
+ <!-- check the export ldif file has been created-->
+ <if expr="len(cmdResult) == 0">
+ <call function="'testFailed'"/>
+ <else>
+ <call function="'testPassed'"/>
+ </else>
+ </if>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Export tasks
+ #@TestName Export task in synchronous mode
+ #@TestPurpose Schedule a Export in task mode to be executed immedialy in synchronous mode
+ #@TestPreamble
+ #@TestStep Execute a export-ldif in a task
+ #@TestStep Execute manage-tasks output and check the Export task is returned
+ #@TestStep Don't specify the -t option
+ #@TestStep The task is scheduled for immediate execution and the script must wait the end of the export
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule export-ldif task for immediate execution in synchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'exportLdif'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'ldifFile' : '%s/tasks/export_synchronous' % remote.data,
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Completed successfully',
+ 'expectedResult' : '1' }
+ </call>
+
+
+ <message>'--- Check log files ---'</message>
+ <call function="'listFolder'">
+ { 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
+ 'foldername' : '%s/tasks' % remote.data,
+ 'filename' : 'export_synchronous'
+ }
+ </call>
+ <!-- check the export ldif file has been created-->
+ <if expr="len(cmdResult) == 0">
+ <call function="'testFailed'"/>
+ <else>
+ <call function="'testPassed'"/>
+ </else>
+ </if>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Export tasks
+ #@TestName Schedule a Export task
+ #@TestPurpose Schedule a Export in task mode
+ #@TestPreamble
+ #@TestStep Execute a export-ldif in a task
+ #@TestStep Specify the -t option with the value non null to schedule an execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule export-ldif task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <call function="'exportLdif'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'ldifFile' : '%s/tasks/export_schedule_asynchronous' % remote.data,
+ 'startTask' : '20061212000000',
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchString'">
+ { 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
+ 'returnString' : returnString ,
+ 'knownIssue' : '3909' ,
+ 'expectedRC' : '1' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Export tasks
+ #@TestName Schedule a recurring Export task
+ #@TestPurpose Schedule a recurring Export in task mode
+ #@TestPreamble
+ #@TestStep Create a recurring Export in task mode
+ #@TestStep specify the recurringTask option with the value
+ #@TestStep non null to schedule a recurring execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule recurring export task')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!--- ReStart DS to clear the output of manage-tasks-->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ </call>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'exportLdif'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'ldifFile' : '%s/tasks/export_schedule_recurring' % remote.data,
+ 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
+ 'backEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'ExportTask-',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 120000 }
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'ExportTask-*',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Completed successfully',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <!-- cancel the recurring task ExportTask-* with manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsCancel' : 'ExportTask-*',
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Task ExportTask-',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'canceled',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <!--- ReStart DS to clear the output of manage-tasks-->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'exportLdif'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'ldifFile' : '%s/tasks/export_schedule_recurring' % remote.data,
- 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
- 'backEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'ExportTask-',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 120000 }
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'ExportTask-*',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Completed successfully',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <!-- cancel the recurring task ExportTask-* with manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsCancel' : 'ExportTask-*',
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Task ExportTask-',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'canceled',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Tasks Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml
index 74defe8..2437a19 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/import-ldif.xml
@@ -29,352 +29,377 @@
<defaultcall function="import-ldif"/>
<function name="import-ldif" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
- <!--- Test Suite information
- #@TestSuiteName Import Tasks
- #@TestSuitePurpose Validate the Import functionality in mode task
- #@TestSuiteID Import Tests
- #@TestSuiteGroup Import
- #@TestGroup tasks
- #@TestScript import_ldif.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
-
- <!--- Test Case information
- #@TestMarker Import Tasks
- #@TestName Import task in synchronous mode
- #@TestPurpose Schedule a import in task mode to be executed immedialy in synchronous mode
- #@TestPreamble
- #@TestStep Execute a import-ldif in a task
- #@TestStep Execute manage-tasks output and check the Import task is returned
- #@TestStep Don't specify the -t option
- #@TestStep The task is scheduled for immediate execution and the script must wait the end of the import
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule import-ldif task for immediate execution in synchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
- 'dsAppend' : ' ',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+
+ <!--- Test Suite information
+ #@TestSuiteName Import Tasks
+ #@TestSuitePurpose Validate the Import functionality in mode task
+ #@TestSuiteID Import Tests
+ #@TestSuiteGroup Import
+ #@TestGroup tasks
+ #@TestScript import_ldif.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Import',
- 'expectedResult' : '1' }
- </call>
-
-
- <!-- Check data are imported -->
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
- 'uid=tmorris, dc=example,dc=com'],
- 'startDS' : 'False'
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
}
</call>
-
- <!-- Delete entries -->
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
- </call>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
-
- #@TestMarker Import Tasks
- #@TestName Import task in asynchronous mode
- #@TestPurpose Schedule a import in task mode to be executed immedialy in asynchronous mode
- #@TestPreamble
- #@TestStep Execute a import-ldif in a task
- #@TestStep specify the -t option with the value 0
- #@TestStep The task is scheduled for immediate execution
- @TestStep The script returns immedialy after scheduling the task
- #@TestPostamble
- -->
-
- <testcase name="getTestCaseName('schedule import-ldif task for immediate execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
- 'dsAppend' : ' ',
- 'startTask' : '0',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
- </call>
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 40000 }
- </call>
-
- <!-- Check data are imported -->
- <call function="'checkImport'">
- { 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
- 'uid=tmorris, dc=example,dc=com'],
- 'startDS' : 'False'
- }
- </call>
-
- <!-- Delete entries -->
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
- </call>
- <call function="'DeleteEntry'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
-
- #@TestMarker Import Tasks
- #@TestName Schedule a Import task
- #@TestPurpose Schedule a import in task mode
- #@TestPreamble
- #@TestStep Execute a import-ldif in a task
- @TestStep specify the -t option with the value non null to schedule an execution
- #@TestPostamble
- -->
-
-
- <testcase name="getTestCaseName('schedule import-ldif task for scheduled execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
- 'dsAppend' : ' ',
- 'startTask' : '20061212000000',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- { 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
- 'returnString' : returnString ,
- 'knownIssue' : '3909' ,
- 'expectedRC' : '1' }
- </call>
-
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
+
<!--- Test Case information
- #@TestMarker Import Tasks
- #@TestName Schedule a recurring Import task
- #@TestPurpose Schedule a recurring Import in task mode
- #@TestPreamble
- #@TestStep Create a recurring Import in task mode
- #@TestStep specify the recurringTask option with the value
- #@TestStep non null to schedule a recurring execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule recurring import task')">
+ #@TestMarker Import Tasks
+ #@TestName Import task in synchronous mode
+ #@TestPurpose Schedule a import in task mode to be executed immedialy in synchronous mode
+ #@TestPreamble
+ #@TestStep Execute a import-ldif in a task
+ #@TestStep Execute manage-tasks output and check the Import task is returned
+ #@TestStep Don't specify the -t option
+ #@TestStep The task is scheduled for immediate execution and the script must wait the end of the import
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule import-ldif task for immediate execution in synchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
+ 'dsAppend' : ' ',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Import',
+ 'expectedResult' : '1' }
+ </call>
+
+
+ <!-- Check data are imported -->
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
+ 'uid=tmorris, dc=example,dc=com'],
+ 'startDS' : 'False'
+ }
+ </call>
+
+ <!-- Delete entries -->
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
+ </call>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+
+ #@TestMarker Import Tasks
+ #@TestName Import task in asynchronous mode
+ #@TestPurpose Schedule a import in task mode to be executed immedialy in asynchronous mode
+ #@TestPreamble
+ #@TestStep Execute a import-ldif in a task
+ #@TestStep specify the -t option with the value 0
+ #@TestStep The task is scheduled for immediate execution
+ @TestStep The script returns immedialy after scheduling the task
+ #@TestPostamble
+ -->
+
+ <testcase name="getTestCaseName('schedule import-ldif task for immediate execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
+ 'dsAppend' : ' ',
+ 'startTask' : '0',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 40000 }
+ </call>
+
+ <!-- Check data are imported -->
+ <call function="'checkImport'">
+ { 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
+ 'uid=tmorris, dc=example,dc=com'],
+ 'startDS' : 'False'
+ }
+ </call>
+
+ <!-- Delete entries -->
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
+ </call>
+ <call function="'DeleteEntry'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+
+ #@TestMarker Import Tasks
+ #@TestName Schedule a Import task
+ #@TestPurpose Schedule a import in task mode
+ #@TestPreamble
+ #@TestStep Execute a import-ldif in a task
+ @TestStep specify the -t option with the value non null to schedule an execution
+ #@TestPostamble
+ -->
+
+
+ <testcase name="getTestCaseName('schedule import-ldif task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
+ 'dsAppend' : ' ',
+ 'startTask' : '20061212000000',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchString'">
+ { 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
+ 'returnString' : returnString ,
+ 'knownIssue' : '3909' ,
+ 'expectedRC' : '1' }
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Import Tasks
+ #@TestName Schedule a recurring Import task
+ #@TestPurpose Schedule a recurring Import in task mode
+ #@TestPreamble
+ #@TestStep Create a recurring Import in task mode
+ #@TestStep specify the recurringTask option with the value
+ #@TestStep non null to schedule a recurring execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule recurring import task')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!--- ReStart DS to clear the output of manage-tasks-->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ </call>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'ImportLdifWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
+ 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
+ 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'ImportTask-',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 120000 }
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'ImportTask-*',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Completed successfully',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <!-- cancel the recurring task ExportTask-* with manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsCancel' : 'ImportTask-*',
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Task ImportTask-',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'canceled',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <!--- ReStart DS to clear the output of manage-tasks-->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'ImportLdifWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
- 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
- 'dsBackEnd' : DIRECTORY_INSTANCE_BE}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'ImportTask-',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 120000 }
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'ImportTask-*',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Completed successfully',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <!-- cancel the recurring task ExportTask-* with manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsCancel' : 'ImportTask-*',
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Task ImportTask-',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'canceled',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Tasks Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restart_db.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restart_db.xml
index 60e027a..561e727 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restart_db.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restart_db.xml
@@ -29,116 +29,141 @@
<defaultcall function="restart_db"/>
<function name="restart_db" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
- <!--- Test Suite information
- #@TestSuiteName Restart tasks
- #@TestSuitePurpose Validate the stop and restart functionality in mode task
- #@TestSuiteID restart Tests
- #@TestSuiteGroup restart
- #@TestGroup tasks
- #@TestScript restart_db.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
+
+ <!--- Test Suite information
+ #@TestSuiteName Restart tasks
+ #@TestSuitePurpose Validate the stop and restart functionality in mode task
+ #@TestSuiteID restart Tests
+ #@TestSuiteGroup restart
+ #@TestGroup tasks
+ #@TestScript restart_db.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
-
- <!--- Test Case information
- #@TestMarker Restart tasks
- #@TestName Restart task in asynchronous mode
- #@TestPurpose Schedule a restart in task mode to be executed immedialy in asynchronous mode
- #@TestPreamble
- #@TestStep Execute a restart in task
- #@TestStep Specify the -t option with the value non null to schedule an execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule restart task for scheduled execution in asynchronous mode')">
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker Restart tasks
+ #@TestName Restart task in asynchronous mode
+ #@TestPurpose Schedule a restart in task mode to be executed immedialy in asynchronous mode
+ #@TestPreamble
+ #@TestStep Execute a restart in task
+ #@TestStep Specify the -t option with the value non null to schedule an execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule restart task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsRestart' : ' ',
+ 'dsStopTime' : '20061212000000',
+ 'knownIssue' : '3909' ,
+ 'expectedRC' : '89'
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Restart tasks
+ #@TestName Stop task in asynchronous mode
+ #@TestPurpose Schedule a stop in task mode to be executed immedialy in asynchronous mode
+ #@TestPreamble
+ #@TestStep Execute a stop in task mode
+ #@TestStep Specify the -t option with the value non null to schedule an execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule stop server task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsStopTime' : '20061212000000',
+ 'knownIssue' : '3909' ,
+ 'expectedRC' : '89'
+ }
+ </call>
+
+ <call function="'SearchObject'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsFilter' : 'objectclass=*' ,
+ 'dsScope' : 'base',
+ 'expectedRC' : 91 }
+ </call>
+
+ <!--- Start DS -->
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD,
- 'dsRestart' : ' ',
- 'dsStopTime' : '20061212000000',
- 'knownIssue' : '3909' ,
- 'expectedRC' : '89'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Tasks Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Restart tasks
- #@TestName Stop task in asynchronous mode
- #@TestPurpose Schedule a stop in task mode to be executed immedialy in asynchronous mode
- #@TestPreamble
- #@TestStep Execute a stop in task mode
- #@TestStep Specify the -t option with the value non null to schedule an execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule stop server task for scheduled execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD,
- 'dsStopTime' : '20061212000000',
- 'knownIssue' : '3909' ,
- 'expectedRC' : '89'
- }
- </call>
-
- <call function="'SearchObject'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsFilter' : 'objectclass=*' ,
- 'dsScope' : 'base',
- 'expectedRC' : 91 }
- </call>
-
- <!--- Start DS -->
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
index 473d31b..2f5c83e 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/restore_db.xml
@@ -29,287 +29,313 @@
<defaultcall function="restore_db"/>
<function name="restore_db" scope="local">
<block name="STAXCurrentFunction">
- <sequence>
- <script>
- CurrentTestPath['suite']=STAXCurrentFunction
- </script>
- <call function="'testSuite_Preamble'" />
-
-
- <!--- Test Suite information
- #@TestSuiteName Restore tasks
- #@TestSuitePurpose Validate the restore functionality in mode task
- #@TestSuiteID restore Tests
- #@TestSuiteGroup restore
- #@TestGroup tasks
- #@TestScript restore_db.xml
- #@TestHTMLLink http://opends.dev.java.net/
- -->
-
- <!--- Test Case information
- #@TestMarker Restore tasks
- #@TestName Restore task in asynchronous mode
- #@TestPurpose schedule a restore in task mode to be executed immedialy in asynchronous mode
- #@TestPreamble
- #@TestStep Execute a restore in a task
- #@TestStep Specify the -t option with the value 0 to schedule for immediate execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule restore task for immediate execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <call function="'restore'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'backupDir' : '%s/tasks/backup_asynchronous' % remote.data,
- 'startTask' : '0'}
- </call>
-
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Restore tasks
- #@TestName Restore task in synchronous mode
- #@TestPurpose Schedule a restore in task mode to be executed immedialy in synchronous mode
- #@TestPreamble
- #@TestStep Execute a restore in a task
- #@TestStep Execute manage-tasks tools and check an Restore tasks is managed
- #@TestStep Don't specify the -t option
- #@TestStep The task is scheduled for immediate execution and the script must wait the end of the restore
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule restore task for immediate execution in synchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
-
- <call function="'restore'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'backupDir' : '%s/tasks/backup_synchronous' % remote.data}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
+ <try>
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Restore',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case information
- #@TestMarker Restore tasks
- #@TestName Schedule a Restore task
- #@TestPurpose Schedule a restore in task mode
- #@TestPreamble
- #@TestStep Execute a restore in a task
- #@TestStep Specify the -t option with the value non null to schedule an execution
- #@TestPostamble
- -->
-
- <testcase name="getTestCaseName('schedule restore task for scheduled execution in asynchronous mode')">
- <sequence>
- <call function="'testCase_Preamble'"/>
-
- <script>
- import java.util.Calendar
- import java.text.SimpleDateFormat
+ <!--- Test Suite information
+ #@TestSuiteName Restore tasks
+ #@TestSuitePurpose Validate the restore functionality in mode task
+ #@TestSuiteID restore Tests
+ #@TestSuiteGroup restore
+ #@TestGroup tasks
+ #@TestScript restore_db.xml
+ #@TestHTMLLink http://opends.dev.java.net/
+ -->
- cal = java.util.Calendar.getInstance()
- cal.add(java.util.Calendar.SECOND,10)
-
- dateFormat = java.text.SimpleDateFormat("yyyyMMddHHmmss")
-
- mydate = dateFormat.format(cal.getTime())
- </script>
-
- <call function="'restore'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'startTask' : '%s' % mydate,
- 'backupDir' : '%s/tasks/backup_schedule_asynchronous' % remote.data
- }
- </call>
+ <call function="'common_setup'">
+ {
+ 'quickStart' : True ,
+ 'startServer' : True ,
+ 'stopServer' : False
+ }
+ </call>
+
+ <!--- Test Case information
+ #@TestMarker Restore tasks
+ #@TestName Restore task in asynchronous mode
+ #@TestPurpose schedule a restore in task mode to be executed immedialy in asynchronous mode
+ #@TestPreamble
+ #@TestStep Execute a restore in a task
+ #@TestStep Specify the -t option with the value 0 to schedule for immediate execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule restore task for immediate execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <call function="'restore'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'backupDir' : '%s/tasks/backup_asynchronous' % remote.data,
+ 'startTask' : '0'}
+ </call>
+
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Restore tasks
+ #@TestName Restore task in synchronous mode
+ #@TestPurpose Schedule a restore in task mode to be executed immedialy in synchronous mode
+ #@TestPreamble
+ #@TestStep Execute a restore in a task
+ #@TestStep Execute manage-tasks tools and check an Restore tasks is managed
+ #@TestStep Don't specify the -t option
+ #@TestStep The task is scheduled for immediate execution and the script must wait the end of the restore
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule restore task for immediate execution in synchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+
+ <call function="'restore'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'backupDir' : '%s/tasks/backup_synchronous' % remote.data}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
-
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case information
- #@TestMarker Restore tasks
- #@TestName Schedule a recurring Restore task
- #@TestPurpose Schedule a recurring Restore in task mode
- #@TestPreamble
- #@TestStep Create a recurring Restore in task mode
- #@TestStep specify the recurringTask option with the value
- #@TestStep non null to schedule a recurring execution
- #@TestPostamble
- #@TestResult
- -->
-
- <testcase name="getTestCaseName('schedule recurring restore task for scheduled execution in asynchronous mode')">
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Restore',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+
+ <!--- Test Case information
+ #@TestMarker Restore tasks
+ #@TestName Schedule a Restore task
+ #@TestPurpose Schedule a restore in task mode
+ #@TestPreamble
+ #@TestStep Execute a restore in a task
+ #@TestStep Specify the -t option with the value non null to schedule an execution
+ #@TestPostamble
+ -->
+
+ <testcase name="getTestCaseName('schedule restore task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <script>
+ import java.util.Calendar
+ import java.text.SimpleDateFormat
+
+ cal = java.util.Calendar.getInstance()
+ cal.add(java.util.Calendar.SECOND,10)
+
+ dateFormat = java.text.SimpleDateFormat("yyyyMMddHHmmss")
+
+ mydate = dateFormat.format(cal.getTime())
+ </script>
+
+ <call function="'restore'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'startTask' : '%s' % mydate,
+ 'backupDir' : '%s/tasks/backup_schedule_asynchronous' % remote.data
+ }
+ </call>
+
+
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case information
+ #@TestMarker Restore tasks
+ #@TestName Schedule a recurring Restore task
+ #@TestPurpose Schedule a recurring Restore in task mode
+ #@TestPreamble
+ #@TestStep Create a recurring Restore in task mode
+ #@TestStep specify the recurringTask option with the value
+ #@TestStep non null to schedule a recurring execution
+ #@TestPostamble
+ #@TestResult
+ -->
+
+ <testcase name="getTestCaseName('schedule recurring restore task for scheduled execution in asynchronous mode')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+
+ <!--- ReStart DS to clear the output of manage-tasks-->
+ <call function="'StopDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+ </call>
+
+ <call function="'StartDsWithScript'">
+ { 'location' : STAF_REMOTE_HOSTNAME }
+ </call>
+
+ <!--- Check that DS started -->
+ <call function="'isAlive'">
+ { 'noOfLoops' : 10 ,
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
+
+ <call function="'restore'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
+ 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
+ 'backupID' : 'recurring-restore-1'}
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-restore-1',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'Sleep'">
+ { 'location' : STAF_REMOTE_HOSTNAME,
+ 'sleepForMilliSeconds' : 120000 }
+ </call>
+
+ <!-- manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'recurring-restore-1',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Completed successfully',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Waiting on start time',
+ 'expectedResult' : '1' }
+ </call>
+
+ <!-- cancel the recurring task recurring-restore-1 with manage-tasks -->
+ <call function="'manage-tasks'">
+ { 'location' : STAF_REMOTE_HOSTNAME ,
+ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsCancel' : 'recurring-restore-1',
+ 'dsQuiet' : ' '
+ }
+ </call>
+
+ <script>
+ returnString = STAXResult[0][1]
+ </script>
+
+ <call function="'searchStringForSubstring'">
+ { 'returnString' : returnString,
+ 'testString' : 'Task recurring-restore-1 canceled',
+ 'expectedResult' : '1' }
+ </call>
+
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ </sequence>
+ <finally>
<sequence>
- <call function="'testCase_Preamble'"/>
-
- <!--- ReStart DS to clear the output of manage-tasks-->
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- { 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'restore'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
- 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
- 'backupID' : 'recurring-restore-1'}
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-restore-1',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'Sleep'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'sleepForMilliSeconds' : 120000 }
- </call>
-
- <!-- manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'recurring-restore-1',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Completed successfully',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Waiting on start time',
- 'expectedResult' : '1' }
- </call>
-
- <!-- cancel the recurring task recurring-restore-1 with manage-tasks -->
- <call function="'manage-tasks'">
- { 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsCancel' : 'recurring-restore-1',
- 'dsQuiet' : ' '
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchStringForSubstring'">
- { 'returnString' : returnString,
- 'testString' : 'Task recurring-restore-1 canceled',
- 'expectedResult' : '1' }
- </call>
-
- <call function="'testCase_Postamble'"/>
+ <!-- Test Suite Cleanup -->
+ <message>'Finally: Tasks Cleanup.'</message>
+ <try>
+ <call function="'common_cleanup'" />
+ <catch exception="'STAFException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <call function="'testSuite_Postamble'"/>
+ </finally>
+ </try>
</sequence>
- </testcase>
-
-
- <call function="'testSuite_Postamble'" />
- </sequence>
+ </finally>
+
+ </try>
</block>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/tasks.xml b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/tasks.xml
index 94eaac1..30ad0c2 100644
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/tasks.xml
+++ b/opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/tasks/tasks.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<!--
@@ -33,46 +33,77 @@
-->
<stax>
- <defaultcall function="main_tasks"/>
+ <defaultcall function="main_tasks" />
<function name="main_tasks">
<function-list-args>
<function-required-arg name="STAXParentID"/>
</function-list-args>
+
<sequence>
- <block name="'tasks'">
- <sequence>
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
- <script>
- CurrentTestPath['group']='tasks'
- </script>
-
- <call function="'testGroup_Preamble'" />
- <script>
- testList = []
- testList.append('setup')
- testList.append('restart_db')
- testList.append('export-ldif')
- testList.append('import-ldif')
- testList.append('backup_db')
- testList.append('restore_db')
- testList.append('allowed-tasks')
- testList.append('cleanup')
- </script>
- <iterate var="__test" in="testList" >
- <sequence>
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/tasks/%s.xml' % (TESTS_DIR,__test)"/>
- <call function="'%s' % __test" />
- </sequence>
- </iterate>
- <call function="'testGroup_Postamble'" />
- </sequence>
- </block>
+ <try>
+ <block name="'tasks'">
+ <sequence>
+ <!--- Load the job environment for the test group execution -->
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+ <call function="'loadJobEnvironment'">
+ { 'parent' : STAXParentID }
+ </call>
+ <script>
+ CurrentTestPath['group']='tasks'
+ _group=CurrentTestPath['group']
+ </script>
+ <call function="'testGroup_Preamble'" />
+ <script>
+ suiteList = []
+ suiteList.append('restart_db')
+ suiteList.append('export-ldif')
+ suiteList.append('import-ldif')
+ suiteList.append('backup_db')
+ suiteList.append('restore_db')
+ suiteList.append('allowed-tasks')
+ </script>
+
+ <!-- Run the test suites -->
+ <iterate var="_suite" in="suiteList">
+ <sequence>
+ <try>
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/%s/%s.xml' % (TESTS_DIR,_group,_suite)"/>
+ <call function="'%s' % (_suite)" />
+ </sequence>
+ <catch exception="'STAFException.TestSuite.SetupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Setup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.MainException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Main part of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ <catch exception="'STAFException.TestSuite.CleanupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Cleanup of test suite %s failed.' % _suite</message>
+ </sequence>
+ </catch>
+ </try>
+ </sequence>
+ </iterate>
+
+ </sequence>
+ </block>
+ <catch exception="'STAXException.TestGroupException'">
+ <sequence>
+ <message log="1" level="'fatal'">'Execution of Test Group Failed'</message>
+ </sequence>
+ </catch>
+ <finally>
+ <!-- Test Group postamble -->
+ <call function="'testGroup_Postamble'"/>
+ </finally>
+ </try>
</sequence>
</function>
</stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml
index f813b1c..fe50812 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/dsadm.xml
@@ -23,7 +23,7 @@
!
! CDDL HEADER END
!
- ! Copyright 2007-2008 Sun Microsystems, Inc.
+ ! Copyright 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
@@ -52,7 +52,7 @@
</function>
<!-- This function sets up DS using the setup script -->
- <function name="SetUpDsWithScript">
+ <function name="SetUpDsWithScript" scope="local">
<function-prolog>
This function sets up a Directory Server using a script
</function-prolog>
@@ -135,6 +135,12 @@
</function-arg-description>
<function-arg-property name="help" value="option"/>
</function-arg-def>
+ <function-arg-def name="expectedRC" type="optional" default="0">
+ <function-arg-description>
+ Expected return code value. Default value is 0.
+ Wildcard 'noCheck' to not check the RC
+ </function-arg-description>
+ </function-arg-def>
<function-arg-def name="knownIssue" type="optional" default="None">
<function-arg-description>
Known issue. Corresponds to an issue number.
@@ -197,7 +203,7 @@
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'path' : dsPath,
- 'expectedRC': 'noCheck',
+ 'expectedRC': expectedRC,
'knownIssue': knownIssue
}
</call>
@@ -2893,7 +2899,9 @@
</script>
<!-- Copy the schema-task ldif to remote host -->
- <message>'Copy schema task ldif file.'</message>
+ <message>
+ 'Copy schema task ldif file %s to %s.' % (tmpTaskLdif,taskLdif)
+ </message>
<call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'srcfile' : tmpTaskLdif,
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml
index 854807f..3adbba8 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/environment.xml
@@ -147,6 +147,19 @@
pathSeparator=':'
newLine='\n'
</script>
+
+ <!-- Default LDAP Server Object -->
+ <script>
+ server=directory_server()
+ server.location = STAF_REMOTE_HOSTNAME
+ server.host = DIRECTORY_INSTANCE_HOST
+ server.port = DIRECTORY_INSTANCE_PORT
+ server.adminport = DIRECTORY_INSTANCE_ADMIN_PORT
+ server.dn = DIRECTORY_INSTANCE_DN
+ server.password = DIRECTORY_INSTANCE_PSWD
+ server.suffix = DIRECTORY_INSTANCE_SFX
+ server.backend = DIRECTORY_INSTANCE_BE
+ </script>
<!-- Default LDAP Server Object -->
<script>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/tools.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/tools.xml
index b29895b..826d226 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/tools.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/tools.xml
@@ -1693,7 +1693,7 @@
<function-arg-property name="type" value="string" />
</function-arg-def>
- <function-arg-def name="Help" type="optional">
+ <function-arg-def name="dsHelp" type="optional">
<function-arg-description>
Help option
</function-arg-description>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
index 2ca6890..cea23b4 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
+++ b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
@@ -256,6 +256,7 @@
self.port=''
self.dn=''
self.password=''
+ self.suffix=''
self.backend=''
def location(self,location):
--
Gitblit v1.10.0