BadKdc2.java revision 2034
855N/A/*
1949N/A * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
855N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
855N/A *
855N/A * This code is free software; you can redistribute it and/or modify it
855N/A * under the terms of the GNU General Public License version 2 only, as
855N/A * published by the Free Software Foundation.
855N/A *
855N/A * This code is distributed in the hope that it will be useful, but WITHOUT
855N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
855N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
855N/A * version 2 for more details (a copy is included in the LICENSE file that
855N/A * accompanied this code).
855N/A *
855N/A * You should have received a copy of the GNU General Public License version
855N/A * 2 along with this work; if not, write to the Free Software Foundation,
855N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
855N/A *
1472N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
1472N/A * CA 95054 USA or visit www.sun.com if you need additional information or
1472N/A * have any questions.
855N/A */
855N/A
855N/A/*
855N/A * @test
855N/A * @bug 6843127
855N/A * @run main/timeout=300 BadKdc2
855N/A * @summary krb5 should not try to access unavailable kdc too often
855N/A */
855N/A
855N/Aimport java.io.*;
855N/Aimport java.security.Security;
855N/A
855N/Apublic class BadKdc2 {
855N/A
855N/A public static void main(String[] args)
855N/A throws Exception {
855N/A Security.setProperty("krb5.kdc.bad.policy", "tryLess:2,1000");
855N/A BadKdc.go(
855N/A new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,1,1,1,2,1,2,1,3,2}, // 1, 2
855N/A new int[]{1,1,1,1,2,1,2,1,3,2,1,1,1,1,2,1,2,1,3,2}, // 1, 2
855N/A // refresh
855N/A new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,1,1,1,2,1,2,1,3,2}, // 1, 2
855N/A // k3 off, k2 on
855N/A new int[]{1,1,1,1,2,1,1,1,1,1,2,2}, // 1
855N/A // k1 on
855N/A new int[]{1,1,1,2} // empty
855N/A );
855N/A }
855N/A}
855N/A