Updated Branches: refs/heads/ldapplugin 215aa0372 -> c50d9fece
Add embedded ldap server for running integration tests against Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c50d9fec Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c50d9fec Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c50d9fec Branch: refs/heads/ldapplugin Commit: c50d9fece03c2eec1037416d5df74b2a6412b769 Parents: 215aa03 Author: Ian Duffy <[email protected]> Authored: Mon Jul 15 13:25:48 2013 +0100 Committer: Chip Childers <[email protected]> Committed: Mon Jul 15 15:34:46 2013 +0100 ---------------------------------------------------------------------- plugins/user-authenticators/ldap/pom.xml | 224 +++++++++---------- .../ldap/test/resources/cloudstack.org.ldif | 19 ++ test/integration/component/test_ldap.py | 22 +- 3 files changed, 129 insertions(+), 136 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c50d9fec/plugins/user-authenticators/ldap/pom.xml ---------------------------------------------------------------------- diff --git a/plugins/user-authenticators/ldap/pom.xml b/plugins/user-authenticators/ldap/pom.xml index 8ea67fe..a9c1e05 100644 --- a/plugins/user-authenticators/ldap/pom.xml +++ b/plugins/user-authenticators/ldap/pom.xml @@ -1,126 +1,110 @@ <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for additional - information regarding copyright ownership. The ASF licenses this file to - you under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of - the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required - by applicable law or agreed to in writing, software distributed under the - License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. --> + license agreements. See the NOTICE file distributed with this work for additional + information regarding copyright ownership. The ASF licenses this file to you under + the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <artifactId>cloud-plugin-user-authenticator-ldap</artifactId> - <name>Apache CloudStack Plugin - User Authenticator LDAP</name> - <parent> - <groupId>org.apache.cloudstack</groupId> - <artifactId>cloudstack-plugins</artifactId> - <version>4.2.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <artifactId>cloud-plugin-user-authenticator-ldap</artifactId> + <name>Apache CloudStack Plugin - User Authenticator LDAP</name> + <parent> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloudstack-plugins</artifactId> + <version>4.2.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> - <build> - <plugins> - <!-- Mandatory plugins for using Spock --> - <plugin> - <groupId>org.codehaus.gmaven</groupId> - <artifactId>gmaven-plugin</artifactId> - <version>1.3</version> - <configuration> - <providerSelection>1.7</providerSelection> - </configuration> - <executions> - <execution> - <goals> - <goal>compile</goal> - <goal>testCompile</goal> - </goals> - <configuration> - <sources> - <fileset> - <directory>test/groovy</directory> - <includes> - <include>**/*.groovy</include> - </includes> - </fileset> - </sources> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.codehaus.gmaven.runtime</groupId> - <artifactId>gmaven-runtime-1.7</artifactId> - <version>1.3</version> - <exclusions> - <exclusion> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy-all</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy-all</artifactId> - <version>2.0.5</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <includes> - <include>**/*Spec*</include> - </includes> - </configuration> - </plugin> - </plugins> - <pluginManagement> - <plugins> - <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.codehaus.gmaven</groupId> - <artifactId>gmaven-plugin</artifactId> - <versionRange>[1.3,)</versionRange> - <goals> - <goal>testCompile</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore></ignore> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.3</version> + <configuration> + <providerSelection>1.7</providerSelection> + </configuration> + <executions> + <execution> + <goals> + <goal>compile</goal> + <goal>testCompile</goal> + </goals> + <configuration> + <sources> + <fileset> + <directory>test/groovy</directory> + <includes> + <include>**/*.groovy</include> + </includes> + </fileset> + </sources> + </configuration> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.codehaus.gmaven.runtime</groupId> + <artifactId>gmaven-runtime-1.7</artifactId> + <version>1.3</version> + <exclusions> + <exclusion> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-all</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-all</artifactId> + <version>2.0.5</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/*Spec*</include> + </includes> + </configuration> + </plugin> + + <plugin> + <groupId>com.btmatthews.maven.plugins</groupId> + <artifactId>ldap-maven-plugin</artifactId> + <version>1.1.0</version> + <configuration> + <monitorPort>11389</monitorPort> + <monitorKey>ldap</monitorKey> + <daemon>false</daemon> + <rootDn>dc=cloudstack,dc=org</rootDn> + <ldapPort>10389</ldapPort> + <ldifFile>test/resources/cloudstack.org.ldif</ldifFile> + </configuration> + </plugin> + + </plugins> + </build> - <dependencies> - <!-- Mandatory dependencies for using Spock --> - <dependency> - <groupId>org.spockframework</groupId> - <artifactId>spock-core</artifactId> - <version>0.7-groovy-2.0</version> - </dependency> + <dependencies> + <!-- Mandatory dependencies for using Spock --> + <dependency> + <groupId>org.spockframework</groupId> + <artifactId>spock-core</artifactId> + <version>0.7-groovy-2.0</version> + </dependency> - <!-- Optional dependencies for using Spock --> - <dependency> <!-- enables mocking of classes (in addition to interfaces) --> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - <version>2.2</version> - </dependency> - </dependencies> + <!-- Optional dependencies for using Spock --> + <dependency> <!-- enables mocking of classes (in addition to interfaces) --> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.2</version> + </dependency> + </dependencies> </project> http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c50d9fec/plugins/user-authenticators/ldap/test/resources/cloudstack.org.ldif ---------------------------------------------------------------------- diff --git a/plugins/user-authenticators/ldap/test/resources/cloudstack.org.ldif b/plugins/user-authenticators/ldap/test/resources/cloudstack.org.ldif new file mode 100644 index 0000000..b20de81 --- /dev/null +++ b/plugins/user-authenticators/ldap/test/resources/cloudstack.org.ldif @@ -0,0 +1,19 @@ +version: 1 + +dn: dc=cloudstack,dc=org +objectClass: dcObject +objectClass: organization +dc: cloudstack +o: cloudstack + +dn: cn=Ryan Murphy,dc=cloudstack,dc=org +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +cn: Ryan Murphy +sn: Murphy +givenName: Ryan +mail: [email protected] +uid: rmurphy +userpassword:: cGFzc3dvcmQ= http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c50d9fec/test/integration/component/test_ldap.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_ldap.py b/test/integration/component/test_ldap.py index ec7987c..83f970b 100644 --- a/test/integration/component/test_ldap.py +++ b/test/integration/component/test_ldap.py @@ -44,23 +44,21 @@ class Services: def __init__(self): self.services = { "account": { - "email": "[email protected]", + "email": "[email protected]", "firstname": "Ryan", "lastname": "Murphy", "username": "rmurphy", - "password": "password", + "password": "internalcloudstackpassword", }, "ldapConfiguration_1": { "basedn": "dc=cloudstack,dc=org", - "bindPassword": "password", - "bindPrincipal": "cn=Administrator,cn=Users,dc=cloudstack,dc=org", "emailAttribute": "mail", "realnameAttribute": "cn", - "userObject": "user", - "usernameAttribute": "samAccountName", - "hostname": "192.168.56.7", - "port": "389", + "userObject": "inetOrgPerson", + "usernameAttribute": "uid", + "hostname": "localhost", + "port": "10389", "ldapUsername": "rmurphy", "ldapPassword": "password" } @@ -175,14 +173,6 @@ class TestLdap(cloudstackTestCase): updateConfigurationResponse = self.apiClient.updateConfiguration(updateConfigurationCmd) self.debug("updated the parameter %s with value %s"%(updateConfigurationResponse.name, updateConfigurationResponse.value)) - - updateConfigurationCmd = updateConfiguration.updateConfigurationCmd() - updateConfigurationCmd.name = "ldap.bind.password" - updateConfigurationCmd.value = ldapConfiguration['bindPassword'] - updateConfigurationResponse = self.apiClient.updateConfiguration(updateConfigurationCmd) - self.debug("updated the parameter %s with value %s"%(updateConfigurationResponse.name, updateConfigurationResponse.value)) - - updateConfigurationCmd = updateConfiguration.updateConfigurationCmd() updateConfigurationCmd.name = "ldap.email.attribute" updateConfigurationCmd.value = ldapConfiguration['emailAttribute']
