Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-25576

Create a new LDAP test that runs with a real LDAP server

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A new LDAP plugin integration test that runs with real LDAP server is needed by us in ATH.

      There is an existing LdapPluginTest which requires Docker to run.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Bowen Cheng
          Path:
          src/main/java/org/jenkinsci/test/acceptance/plugins/active_directory/ActiveDirectorySecurity.java
          src/main/java/org/jenkinsci/test/acceptance/plugins/ldap/LdapEnv.java
          src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityConfigUtils.java
          src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityDisabler.java
          src/test/java/plugins/ActiveDirectoryTest.java
          src/test/java/plugins/no_docker/LdapPluginNoDockerTest.java
          http://jenkins-ci.org/commit/acceptance-test-harness/2c87fd8530c83bee5dc61caab1b8051d76ec9c6a
          Log:
          JENKINS-25576 A Ldap plugin test that runs with LDAP server is added.

          There was only one Ldap plugin test which requires Docker to run. The
          newly created LdapPluginNoDockerTest runs without Docker but with a
          real LDAP server. Detailed configuration information can be set through
          environment variables.

          Because LdapPluginNoDockerTest has similar test stories with
          ActiveDirectoryTest, ActiveDirectoryTest is refactored to reduce
          duplicate code.

          Change-Id: If729ceb05eb96a0b3abfc33fa141b748a0ba461a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bowen Cheng Path: src/main/java/org/jenkinsci/test/acceptance/plugins/active_directory/ActiveDirectorySecurity.java src/main/java/org/jenkinsci/test/acceptance/plugins/ldap/LdapEnv.java src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityConfigUtils.java src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityDisabler.java src/test/java/plugins/ActiveDirectoryTest.java src/test/java/plugins/no_docker/LdapPluginNoDockerTest.java http://jenkins-ci.org/commit/acceptance-test-harness/2c87fd8530c83bee5dc61caab1b8051d76ec9c6a Log: JENKINS-25576 A Ldap plugin test that runs with LDAP server is added. There was only one Ldap plugin test which requires Docker to run. The newly created LdapPluginNoDockerTest runs without Docker but with a real LDAP server. Detailed configuration information can be set through environment variables. Because LdapPluginNoDockerTest has similar test stories with ActiveDirectoryTest, ActiveDirectoryTest is refactored to reduce duplicate code. Change-Id: If729ceb05eb96a0b3abfc33fa141b748a0ba461a
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Bowen Cheng
          Path:
          src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_auth/ProjectBasedMatrixAuthorizationStrategy.java
          src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityConfigUtils.java
          src/test/java/plugins/ActiveDirectoryTest.java
          src/test/java/plugins/no_docker/LdapPluginNoDockerTest.java
          http://jenkins-ci.org/commit/acceptance-test-harness/3d8e0bda3ccbd1c1610944fdc1cb9662889f7f21
          Log:
          JENKINS-25576 SecurityConfigUtils is removed after refactoring.

          The only method that was in SecurityConfigUtils class is moved into
          ProjectBasedMatrixAuthorizationStrategy. As a result of refactoring,
          the class is removed.

          Change-Id: Id185e1d13ae6f6baa08350bafbe296810b7b6f6b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bowen Cheng Path: src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_auth/ProjectBasedMatrixAuthorizationStrategy.java src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityConfigUtils.java src/test/java/plugins/ActiveDirectoryTest.java src/test/java/plugins/no_docker/LdapPluginNoDockerTest.java http://jenkins-ci.org/commit/acceptance-test-harness/3d8e0bda3ccbd1c1610944fdc1cb9662889f7f21 Log: JENKINS-25576 SecurityConfigUtils is removed after refactoring. The only method that was in SecurityConfigUtils class is moved into ProjectBasedMatrixAuthorizationStrategy. As a result of refactoring, the class is removed. Change-Id: Id185e1d13ae6f6baa08350bafbe296810b7b6f6b
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/org/jenkinsci/test/acceptance/plugins/active_directory/ActiveDirectorySecurity.java
          src/main/java/org/jenkinsci/test/acceptance/plugins/ldap/LdapEnv.java
          src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_auth/ProjectBasedMatrixAuthorizationStrategy.java
          src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityDisabler.java
          src/test/java/plugins/ActiveDirectoryTest.java
          src/test/java/plugins/no_docker/LdapPluginNoDockerTest.java
          http://jenkins-ci.org/commit/acceptance-test-harness/a651ba84925e11f283ca8c1bf64a5b09b7cecba5
          Log:
          Merge pull request #18 from conan-z/ldapNoDockerTest

          [FIXED JENKINS-25576] A Ldap plugin test that runs with LDAP server is added.

          Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/0fb931ed5111...a651ba84925e

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/test/acceptance/plugins/active_directory/ActiveDirectorySecurity.java src/main/java/org/jenkinsci/test/acceptance/plugins/ldap/LdapEnv.java src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_auth/ProjectBasedMatrixAuthorizationStrategy.java src/main/java/org/jenkinsci/test/acceptance/utils/pluginTests/SecurityDisabler.java src/test/java/plugins/ActiveDirectoryTest.java src/test/java/plugins/no_docker/LdapPluginNoDockerTest.java http://jenkins-ci.org/commit/acceptance-test-harness/a651ba84925e11f283ca8c1bf64a5b09b7cecba5 Log: Merge pull request #18 from conan-z/ldapNoDockerTest [FIXED JENKINS-25576] A Ldap plugin test that runs with LDAP server is added. Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/0fb931ed5111...a651ba84925e
          Hide
          conan_z Bowen Cheng added a comment - - edited

          Following is a short summary of this contribution:

          A new LDAP plugin Selenium test is added (plugins/no_docker/ LdapPluginNoDockerTest.java):
          • Unlike the existing Selenium test which requires Dock act as a LDAP container, this one runs with real corporate LDAP server.
          • Necessary information required for running test (server config info, user info) can be set through command line (details is explained in Javadoc).
          • A new LdapEnv class is introduced to process environment variables passed from terminal.

          ActiveDirectryTest is refactored since the new LDAP test shares same user story.
          • A new method “authorizeUserAsAdmin” is extracted after refactoring. It is put in “/org/jenkinsci/test/acceptance/plugins/matrix_auth/ProjectBasedMatrixAuthorizationStrategy.java”.
          • This methods simply authorizes given user as admin. It is extracted as this process is common to multiple test cases and classes.
          • It will be cool if in the future we have methods similar to “authorizeUserAsAdmin” but in a higher abstract level (e.g. a method that authorize/ de-authorize user(s) one or multiple roles)

          Show
          conan_z Bowen Cheng added a comment - - edited Following is a short summary of this contribution: A new LDAP plugin Selenium test is added (plugins/no_docker/ LdapPluginNoDockerTest.java) : • Unlike the existing Selenium test which requires Dock act as a LDAP container, this one runs with real corporate LDAP server. • Necessary information required for running test (server config info, user info) can be set through command line (details is explained in Javadoc). • A new LdapEnv class is introduced to process environment variables passed from terminal. ActiveDirectryTest is refactored since the new LDAP test shares same user story. • A new method “authorizeUserAsAdmin” is extracted after refactoring. It is put in “/org/jenkinsci/test/acceptance/plugins/matrix_auth/ProjectBasedMatrixAuthorizationStrategy.java”. • This methods simply authorizes given user as admin. It is extracted as this process is common to multiple test cases and classes. • It will be cool if in the future we have methods similar to “authorizeUserAsAdmin” but in a higher abstract level (e.g. a method that authorize/ de-authorize user(s) one or multiple roles)

            People

            Assignee:
            conan_z Bowen Cheng
            Reporter:
            conan_z Bowen Cheng
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: