3909N/A * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/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 0N/A * @summary Check that InetAddress doesn't continue to throw UHE 0N/A * after the name service has recovered and the negative ttl 0N/A * on the initial lookup has expired. 0N/A * First check the ttl on negative lookups is in the <15 second 0N/A * range. If the ttl is <=0 it means we cache forever or always 0N/A * consult the name service. For ttl > 15 the test would take 0N/A * too long so we skip it (need to coordinate jtreg timeout 0N/A * with negative ttl) 0N/A " in 1-15 second range to execute this test");
0N/A * The following outlines how the test works :- 0N/A * 1. Do a lookup via InetAddress.getByName that it guaranteed 0N/A * to succeed. This forces at least one entry into the cache 0N/A * that will not expire. 0N/A * 2. Do a lookup via InetAddress.getByName that is guarnateed 0N/A * to fail. This results in a negative lookup cached for 0N/A * for a short period to time. 0N/A * 3. Wait for the cache entry to expire. 0N/A * 4. Do a lookup (which should consult the name service) and 0N/A * the lookup should succeed. 0N/A // name service needs to resolve this. 0N/A // this lookup will succeed 0N/A // lookup "luster" - this should throw UHE as name service 0N/A // doesn't know anything about this host. 0N/A " - luster is bring resolved by name service");
0N/A // name service now needs to know about luster 0N/A // wait for the cache entry to expire and lookup should