4125N/A * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. 2034N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 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 * 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 * 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. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 2034N/A // Matches the krb5 debug output: 2034N/A // >>> KDCCommunication: kdc=kdc.rabbit.hole UDP:14319, timeout=2000,... 2034N/A ">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., " +
4125N/A * There are several cases this test fails: 4125N/A * 1. The random selected port is used by another process. No good way to 4125N/A * prevent this happening, coz krb5.conf must be written before KDC starts. 4125N/A * There are two different outcomes: 4125N/A * a. Cannot start the KDC. A BindException thrown. 4125N/A * b. When trying to access a non-existing KDC, a response is received! 4125N/A * Most likely a Asn1Exception thrown 4125N/A * 2. Even if a KDC is started, and more than 20 seconds pass by, a timeout 4125N/A * can still happens for the first UDP request. In fact, the KDC did not 4125N/A * received it at all. This happens on almost all platforms, especially 4125N/A * solaris-i586 and solaris-x64. 4125N/A * 1. Catch those exceptions and ignore 4125N/A * 2. a. Make the timeout longer? useless 4125N/A * b. Read the output carefully, if there is a timeout, it's OK. 4125N/A * Just make sure the retries times and KDCs are correct. 4125N/A * c. Feed the KDC a UDP packet first. The current "solution". 2034N/A // Make sure KDCs' ports starts with 1 and 2 and 3, 2034N/A // useful for checking debug output. 4125N/A // Feed a packet to newly started KDC to warm it up 2034N/A * One round of test for max_retries and timeout. 2034N/A * @param expected the expected kdc# timeout kdc# timeout...