/* * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* * @test * @bug 8044500 8194486 * @summary Add kinit options and krb5.conf flags that allow users to * obtain renewable tickets and specify ticket lifetimes * @library /test/lib * @compile -XDignore.symbol.file Renewal.java * @run main jdk.test.lib.FileInstaller TestHosts TestHosts * @run main/othervm -Djdk.net.hosts.file=TestHosts Renewal
*/
kdc = new OneKDC(null);
kdc.writeJAASConf();
kdc.setOption(KDC.Option.PREAUTH_REQUIRED, false);
checkLogin(null, null, KDC.DEFAULT_LIFETIME, -1);
checkLogin("1h", null, 3600, -1);
checkLogin(null, "2d", KDC.DEFAULT_LIFETIME, 86400*2);
checkLogin("1h", "10h", 3600, 36000); // When rtime is before till, use till as rtime
checkLogin("10h", "1h", 36000, 36000);
staticvoid checkRough(Date t, int duration) throws Exception {
Date now = new Date(); if (t == null && duration == -1) { return;
} long change = (t.getTime() - System.currentTimeMillis()) / 1000; //accounting the delay factor in processing the instructions on host mc if (change > duration + 40 || change < duration - 40) { thrownew Exception("Timestamp is " + t + ", actual difference "
+ change + " is not " + duration);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.