Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 47A26200B48 for ; Tue, 7 Jun 2016 04:22:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 467FC160A5C; Tue, 7 Jun 2016 02:22:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 25ECF160A56 for ; Tue, 7 Jun 2016 04:22:49 +0200 (CEST) Received: (qmail 21637 invoked by uid 500); 7 Jun 2016 02:22:49 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 20931 invoked by uid 99); 7 Jun 2016 02:22:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2016 02:22:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D793EAD98; Tue, 7 Jun 2016 02:22:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: plusplusjiajia@apache.org To: commits@directory.apache.org Date: Tue, 07 Jun 2016 02:23:05 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [19/29] directory-kerby git commit: DIRKRB-575 SaslAppTest failure due to input having nothing to do with test. Contributed by Gerard Gagliano. archived-at: Tue, 07 Jun 2016 02:22:51 -0000 DIRKRB-575 SaslAppTest failure due to input having nothing to do with test. Contributed by Gerard Gagliano. Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/ae26c10e Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/ae26c10e Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/ae26c10e Branch: refs/heads/kadmin-remote Commit: ae26c10e52a6a92b1233f31308f848dbf53b71da Parents: 19d72eb Author: plusplusjiajia Authored: Fri May 27 09:39:50 2016 +0800 Committer: plusplusjiajia Committed: Fri May 27 09:39:50 2016 +0800 ---------------------------------------------------------------------- .../kerby/kerberos/kerb/server/KdcTestBase.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/ae26c10e/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java ---------------------------------------------------------------------- diff --git a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java index 9e8424f..c4a87be 100644 --- a/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java +++ b/kerby-kerb/kerb-kdc-test/src/test/java/org/apache/kerby/kerberos/kerb/server/KdcTestBase.java @@ -30,21 +30,32 @@ import org.junit.BeforeClass; import java.io.File; import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; public abstract class KdcTestBase { private static File testDir; private final String clientPassword = "123456"; - private final String hostname = "localhost"; + private String hostname; private final String clientPrincipalName = "drankye"; private final String clientPrincipal = clientPrincipalName + "@" + TestKdcServer.KDC_REALM; private final String serverPrincipalName = "test-service"; - private final String serverPrincipal = - serverPrincipalName + "/" + hostname + "@" + TestKdcServer.KDC_REALM; + private final String serverPrincipal; private SimpleKdcServer kdcServer; + public KdcTestBase() { + try { + hostname = InetAddress.getByName("127.0.0.1").getHostName(); + } catch (UnknownHostException e) { + hostname = "localhost"; + } + serverPrincipal = + serverPrincipalName + "/" + hostname + "@" + TestKdcServer.KDC_REALM; + } + @BeforeClass public static void createTestDir() throws IOException { String basedir = System.getProperty("basedir");