From 9e2c4e306f3f7fafa995a2706979576e4ad75d69 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Mon, 10 Jun 2013 16:36:59 +0000
Subject: [PATCH] CR-1826 Updated global aci when running in upgrade mode
---
opends/tests/staf-tests/functional-tests/testcases/security/security.xml | 12 ++++++++++--
opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml | 11 +++++++++--
opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml | 12 ++++++++++--
opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog_tests.xml | 20 ++++++++++++++++++--
4 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml b/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml
index 0f7e87d..95b7605 100755
--- a/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/aci/aci.xml
@@ -24,7 +24,7 @@
! CDDL HEADER END
!
! Copyright 2007-2009 Sun Microsystems, Inc.
- ! Portions Copyright 2011 ForgeRock AS
+ ! Portions Copyright 2011-2013 ForgeRock AS
! -->
<stax>
<defaultcall function="main_aci"/>
@@ -48,7 +48,15 @@
<script>
CurrentTestPath['group']='aci'
- GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||changeInitiatorsName||changeLogCookie||includedAttributes\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+
+ import re
+ if UPGRADE_OPENDJNAME != '' and re.search('2.4.*',UPGRADE_OPENDJNAME) is not None:
+ # UPGRADE MODE
+ # Only for upgrade from 2.4.x
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||targetUniqueID||changeInitiatorsName||changeLogCookie\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ else:
+ # NORMAL MODE
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||changeInitiatorsName||changeLogCookie||includedAttributes\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
</script>
<call function="'testGroup_Preamble'"/>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml b/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml
index a232d0d..672e6a3 100755
--- a/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/privileges/privileges.xml
@@ -24,7 +24,7 @@
! CDDL HEADER END
!
! Copyright 2007-2009 Sun Microsystems, Inc.
- ! Portions Copyright 2011 ForgeRock AS
+ ! Portions Copyright 2011-2013 ForgeRock AS
! -->
<stax>
<defaultcall function="main_privileges" />
@@ -47,7 +47,14 @@
CurrentTestPath['group']='privileges'
_group=CurrentTestPath['group']
- GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||changeInitiatorsName||changeLogCookie||includedAttributes\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ import re
+ if UPGRADE_OPENDJNAME != '' and re.search('2.4.*',UPGRADE_OPENDJNAME) is not None:
+ # UPGRADE MODE
+ # Only for upgrade from 2.4.x
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||targetUniqueID||changeInitiatorsName||changeLogCookie\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ else:
+ # NORMAL MODE
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||changeInitiatorsName||changeLogCookie||includedAttributes\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
</script>
<call function="'testGroup_Preamble'" />
<script>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog_tests.xml b/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog_tests.xml
index 96cadc2..ce2f942 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog_tests.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog_tests.xml
@@ -111,7 +111,7 @@
<else>
<!-- Windows -->
<script>
- sleepTime = 10000
+ sleepTime = 6000
</script>
</else>
</if>
@@ -133,7 +133,23 @@
replServerPath = '%s/%s' % (replServer.getDir(), OPENDSNAME)
</script>
-
+
+ <!-- Trace for debug -->
+ <call function="'ldapSearchWithScript'">
+ { 'location' : replServer.getHostname(),
+ 'dsPath' : replServerPath,
+ 'dsInstanceHost' : replServer.getHostname(),
+ 'dsInstancePort' : replServer.getPort(),
+ 'dsInstanceDn' : replServer.getRootDn(),
+ 'dsInstancePswd' : replServer.getRootPwd(),
+ 'dsBaseDN' : 'dc=replicationChanges',
+ 'dsFilter' : 'objectclass=*'
+ }
+ </call>
+ <message>
+ STAXResult[0][1]
+ </message>
+
<!-- Search for entry add -->
<call function="'ldapSearchWithScript'">
{ 'location' : replServer.getHostname(),
diff --git a/opends/tests/staf-tests/functional-tests/testcases/security/security.xml b/opends/tests/staf-tests/functional-tests/testcases/security/security.xml
index 5e72c33..eed57b5 100755
--- a/opends/tests/staf-tests/functional-tests/testcases/security/security.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/security/security.xml
@@ -24,7 +24,7 @@
! CDDL HEADER END
!
! Copyright 2006-2009 Sun Microsystems, Inc.
- ! Portions Copyright 2011-2012 ForgeRock AS
+ ! Portions Copyright 2011-2013 ForgeRock AS
! -->
<stax>
<defaultcall function="main_security" />
@@ -47,8 +47,16 @@
CurrentTestPath['group']='security'
_group=CurrentTestPath['group']
- GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||changeInitiatorsName||changeLogCookie||includedAttributes\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ import re
+ if UPGRADE_OPENDJNAME != '' and re.search('2.4.*',UPGRADE_OPENDJNAME) is not None:
+ # UPGRADE MODE
+ # Only for upgrade from 2.4.x
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||targetUniqueID||changeInitiatorsName||changeLogCookie\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
+ else:
+ # NORMAL MODE
+ GLOBAL_ACI_SEARCH="(targetattr!=\"userPassword||authPassword||changes||changeNumber||changeType||changeTime||targetDN||newRDN||newSuperior||deleteOldRDN||targetEntryUUID||changeInitiatorsName||changeLogCookie||includedAttributes\")(version 3.0; acl \"Anonymous read access\"; allow (read,search,compare) userdn=\"ldap:///anyone\";)"
</script>
+
<call function="'testGroup_Preamble'" />
<script>
suiteList = []
--
Gitblit v1.10.0