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