directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: DIRKRB-638 - Adding a test
Date Thu, 27 Jul 2017 10:07:27 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk 989fbdff4 -> f8f95ab14


DIRKRB-638 - Adding a test


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/f8f95ab1
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/f8f95ab1
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/f8f95ab1

Branch: refs/heads/trunk
Commit: f8f95ab143685339eb25be964a721fe402df988e
Parents: 989fbdf
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Jul 27 11:06:03 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Jul 27 11:06:03 2017 +0100

----------------------------------------------------------------------
 .../kerb/integration/test/GssAppTest.java       | 39 ++++++++++++++++++++
 .../kerb/integration/test/KerbyGssAppTest.java  |  7 ++++
 2 files changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f8f95ab1/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/GssAppTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/GssAppTest.java
b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/GssAppTest.java
index 162aacd..d8b891a 100644
--- a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/GssAppTest.java
+++ b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/GssAppTest.java
@@ -23,6 +23,7 @@ import java.security.PrivilegedAction;
 
 import javax.security.auth.Subject;
 
+import org.apache.kerby.kerberos.kerb.client.JaasKrbUtil;
 import org.apache.kerby.kerberos.kerb.integration.test.gss.GssAppClient;
 import org.apache.kerby.kerberos.kerb.integration.test.gss.GssAppServer;
 import org.apache.kerby.util.NetworkUtil;
@@ -36,7 +37,9 @@ public class GssAppTest extends AppTest {
     private static final Logger LOG = LoggerFactory.getLogger(GssAppTest.class);
 
     private int serverPort2;
+    private int serverPort3;
     private AppServer appServer2;
+    private AppServer appServer3;
 
     @Before
     @Override
@@ -44,8 +47,10 @@ public class GssAppTest extends AppTest {
         super.setUp();
 
         serverPort2 = NetworkUtil.getServerPort();
+        serverPort3 = NetworkUtil.getServerPort();
 
         setupAppServer2();
+        setupAppServer3();
     }
 
     @Override
@@ -80,6 +85,19 @@ public class GssAppTest extends AppTest {
         runAppClient(appClient);
     }
 
+    // Here the server is using a password to get a TGT, not a keytab
+    @Test
+    public void testServerUsingPassword() throws Exception {
+        AppClient appClient =
+            new GssAppClient(new String[] {
+                                           getHostname(),
+                                           String.valueOf(serverPort3),
+                                           getClientPrincipal(),
+                                           getServerPrincipal()
+            });
+        runAppClient(appClient);
+    }
+
     private AppClient createAppClient() throws Exception {
         return new GssAppClient(new String[] {
             getHostname(),
@@ -111,4 +129,25 @@ public class GssAppTest extends AppTest {
         });
     }
 
+    private void setupAppServer3() throws Exception {
+        Subject subject = JaasKrbUtil.loginUsingPassword(getServerPrincipal(), getServerPassword());
+        Subject.doAs(subject, new PrivilegedAction<Object>() {
+            @Override
+            public Object run() {
+                try {
+                    appServer3 =
+                        new GssAppServer(new String[] {
+                                                       String.valueOf(serverPort3),
+                                                       getServerPrincipal()
+                        });
+                    appServer3.start();
+                } catch (Exception ex) {
+                    LOG.error(ex.toString());
+                }
+
+                return null;
+            }
+        });
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f8f95ab1/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/KerbyGssAppTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/KerbyGssAppTest.java
b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/KerbyGssAppTest.java
index b6f4e43..1ae01b1 100644
--- a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/KerbyGssAppTest.java
+++ b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/KerbyGssAppTest.java
@@ -21,6 +21,7 @@ package org.apache.kerby.kerberos.kerb.integration.test;
 
 import org.apache.kerby.kerberos.kerb.gss.KerbyGssProvider;
 import org.junit.Before;
+import org.junit.Test;
 
 import java.security.Provider;
 
@@ -34,4 +35,10 @@ public class KerbyGssAppTest extends GssAppTest {
         super.setUp();
     }
 
+    // See DIRKRB-638
+    @Test
+    @org.junit.Ignore
+    public void testServerUsingPassword() throws Exception {
+
+    }
 }


Mime
View raw message