jdk/test/sun/security/krb5/config/KdcDefaultOptions.java
author weijun
Tue, 19 May 2015 09:09:09 +0800
changeset 30653 6ef1144fd561
parent 14328 45c5cda024f0
child 30820 0d4717a011d3
permissions -rw-r--r--
8077102: dns_lookup_realm should be false by default Reviewed-by: valeriep
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14328
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     1
/*
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     4
 *
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     7
 * published by the Free Software Foundation.
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     8
 *
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    13
 * accompanied this code).
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    14
 *
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    18
 *
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    21
 * questions.
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    22
 */
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    23
/*
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    24
 * @test
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    25
 * @bug 7195426
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    26
 * @summary kdc_default_options not supported correctly
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    27
 * @compile -XDignore.symbol.file KdcDefaultOptions.java
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    28
 * @run main/othervm KdcDefaultOptions
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    29
 */
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    30
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    31
import sun.security.krb5.Config;
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    32
import sun.security.krb5.internal.KDCOptions;
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    33
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    34
public class KdcDefaultOptions {
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    35
    public static void main(String[] args) throws Exception {
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    36
        System.setProperty("java.security.krb5.conf",
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    37
                System.getProperty("test.src", ".") + "/kdc_default_options.conf");
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    38
        Config.refresh();
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    39
        KDCOptions options = new KDCOptions();
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    40
        if (!options.get(KDCOptions.FORWARDABLE) ||
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    41
                !options.get(KDCOptions.PROXIABLE) ||
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    42
                !options.get(KDCOptions.RENEWABLE_OK)) {
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    43
            throw new Exception(options.toString());
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    44
        }
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    45
    }
45c5cda024f0 7195426: kdc_default_options not supported correctly
weijun
parents:
diff changeset
    46
}