Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Dec 5, 2016
2 parents bcba2b6 + a06e329 commit 89c0598
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
Expand Up @@ -174,6 +174,11 @@ private QName getAssociationGroupQName() {
return new QName(MidPointConstants.NS_RI, ASSOCIATION_GROUP_NAME);
}

protected String getOrgGroupsLdapSuffix() {
return "ou=orggroups,"+getLdapSuffix();
}


@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
super.initSystem(initTask, initResult);
Expand All @@ -200,8 +205,8 @@ public void test000Sanity() throws Exception {
cleanupDelete(toAccountDn(USER_BARBOSSA_USERNAME));
cleanupDelete(toAccountDn(USER_CPTBARBOSSA_USERNAME));
cleanupDelete(toAccountDn(USER_GUYBRUSH_USERNAME));
cleanupDelete(toGroupDn(GROUP_MELEE_ISLAND_NAME));
cleanupDelete(toGroupDn(GROUP_MELA_NOVA_NAME));
cleanupDelete(toOrgGroupDn(GROUP_MELEE_ISLAND_NAME));
cleanupDelete(toOrgGroupDn(GROUP_MELA_NOVA_NAME));
}

@Test
Expand Down Expand Up @@ -287,7 +292,7 @@ public void test105SeachPiratesByCn() throws Exception {
display("Shadow", shadow);
groupPiratesOid = shadow.getOid();

assertConnectorOperationIncrement(1);
assertConnectorOperationIncrement(2);
assertConnectorSimulatedPagingSearchIncrement(0);

SearchResultMetadata metadata = shadows.getMetadata();
Expand Down Expand Up @@ -1114,4 +1119,8 @@ private void assertEDirNoGroupMember(Entry accountEntry, String groupName) throw
assertAttributeNotContains(accountEntry, ATTRIBUTE_GROUP_MEMBERSHIP_NAME, groupEntry.getDn().toString());
assertAttributeNotContains(accountEntry, ATTRIBUTE_SECURITY_EQUALS_NAME, groupEntry.getDn().toString());
}

protected String toOrgGroupDn(String cn) {
return "cn="+cn+","+getOrgGroupsLdapSuffix();
}
}
32 changes: 25 additions & 7 deletions testing/conntest/src/test/resources/edir/resource-deimos.xml
Expand Up @@ -212,6 +212,15 @@
<intent>ldapGroup</intent>
<displayName>LDAP Group</displayName>
<objectClass>ri:groupOfNames</objectClass>
<baseContext>
<objectClass>ri:organizationalUnit</objectClass>
<filter>
<q:equal>
<q:path>attributes/dn</q:path>
<q:value>ou=groups,o=example</q:value>
</q:equal>
</filter>
</baseContext>
<attribute>
<ref>dn</ref>
<matchingRule>mr:distinguishedName</matchingRule>
Expand All @@ -222,12 +231,7 @@
<expression>
<script>
<code>
import javax.naming.ldap.Rdn
import javax.naming.ldap.LdapName

dn = new LdapName('ou=groups,o=example')
dn.add(new Rdn('cn', name.toString()))
return dn.toString()
basic.composeDnWithSuffix('cn', name, 'ou=groups,o=example')
</code>
</script>
</expression>
Expand Down Expand Up @@ -259,6 +263,15 @@
<displayName>Organizational Group</displayName>
<objectClass>ri:groupOfNames</objectClass>
<auxiliaryObjectClass>ri:nestedGroupAux</auxiliaryObjectClass>
<baseContext>
<objectClass>ri:organizationalUnit</objectClass>
<filter>
<q:equal>
<q:path>attributes/dn</q:path>
<q:value>ou=orggroups,o=example</q:value>
</q:equal>
</filter>
</baseContext>
<attribute>
<ref>ri:member</ref>
<matchingRule>mr:distinguishedName</matchingRule>
Expand All @@ -274,7 +287,7 @@
<expression>
<script>
<code>
return 'cn=' + name + ',ou=groups,o=example'
basic.composeDnWithSuffix('cn', name, 'ou=orggroups,o=example')
</code>
</script>
</expression>
Expand Down Expand Up @@ -304,6 +317,11 @@
</source>
</outbound>
</attribute>
<attribute>
<ref>ri:member</ref>
<matchingRule>mr:distinguishedName</matchingRule>
<fetchStrategy>minimal</fetchStrategy>
</attribute>
<association>
<ref>ri:group</ref>
<tolerant>true</tolerant>
Expand Down

0 comments on commit 89c0598

Please sign in to comment.