/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package org.apache.jmeter.engine;

import java.net.InetAddress;

import org.junit.Test;

/**
 * Try to establish why some batchtestserver runs fail 
 */
public class LocalHostTest {

    @Test
    public void testLocalHost() throws Exception {
        final String key = "java.rmi.server.hostname";
        String host = System.getProperties().getProperty(key); // $NON-NLS-1$
        perr(key + "=" + host);
        InetAddress localHost;
        if( host==null ) {
            localHost = InetAddress.getLocalHost();
        } else {
            localHost = InetAddress.getByName(host);
        }
        showAddress(localHost);
        showAddress(InetAddress.getByName("localhost"));
        for (InetAddress a : InetAddress.getAllByName(InetAddress.getLocalHost().getHostName())) {
            perr("====================");
            showAddress(a);            
        }
    }

    private static void showAddress(InetAddress localHost) {
        perr(localHost);
        perr("isSiteLocalAddress:"+localHost.isSiteLocalAddress());
        perr("isAnyLocalAddress:"+localHost.isAnyLocalAddress());
        perr("isLinkLocalAddress:"+localHost.isLinkLocalAddress());
        perr("isLoopbackAddress:"+localHost.isLoopbackAddress());
        perr("isMulticastAddress:"+localHost.isMulticastAddress());
    }

    private static void perr(Object s) {
        System.err.println(s);
    }

}

@@ -861,16 +861,143 @@
 ddress;%0A
+import java.net.NetworkInterface;%0Aimport java.net.UnknownHostException;%0Aimport java.util.Collections;%0A%0Aimport org.junit.Assert;
 %0Aimport 
@@ -1141,27 +1141,979 @@
 test
-LocalHost() throws 
+Interfaces() throws Exception %7B%0A        InetAddress localHost = getLocalHost();%0A        boolean localHostIsBound = Collections.list(NetworkInterface.getNetworkInterfaces()).stream()%0A                .flatMap(iface -%3E Collections.list(iface.getInetAddresses())%0A                        .stream())%0A                .filter(addr -%3E addr.equals(localHost))%0A                .findFirst()%0A                .isPresent();%0A        Assert.assertTrue(%22localHost: %22 + localHost + %22 is bound to an interface%22, localHostIsBound);%0A    %7D%0A%0A    @Test%0A    public void testLocalHost() throws Exception %7B%0A        InetAddress localHost = getLocalHost();%0A        showAddress(localHost);%0A        showAddress(InetAddress.getByName(%22localhost%22));%0A        for (InetAddress a : InetAddress.getAllByName(InetAddress.getLocalHost().getHostName())) %7B%0A            perr(%22====================%22);%0A            showAddress(a);            %0A        %7D%0A    %7D%0A%0A    private InetAddress getLocalHost() throws UnknownHost
 Exce
@@ -2487,279 +2487,25 @@
     
-showAddress(localHost);%0A        showAddress(InetAddress.getByName(%22localhost%22));%0A        for (InetAddress a : InetAddress.getAllByName(InetAddress.getLocalHost().getHostName())) %7B%0A            perr(%22====================%22);%0A            showAddress(a);            %0A        %7D
+return localHost;
 %0A   

Add a test to get more info, why nightly is currently not working