You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brian Ferris (Bug 52469):
In order to better support SSH-tunneling of the RMI communication channels used in remote testing, please see the attached patch which makes the following two changes:
Just as the RMI ports used for the server component can be specified using "server.rmi.port" and "server.rmi.localport" parameters, introduce a "client.rmi.localport" parameter that can control the RMI port used by the RemoteSampleListenerImpl. Currently, the port is randomly assigned, which makes it tricky to tunnel traffic to that port over a SSH tunnel.
The current behavior of RemoteJMeterEngineImpl is to throw an exception if the remote engine attempts to listen to traffic over the loopback interface. However, we often need this behavior when tunneling RMI traffic over an SSH tunnel as the remote endpoint will actually be a port on the local machine, which is subsequently tunneled. To support this functionality, I propose allowing the localhost loopback interface to be used if it has been specified directly using the "java.rmi.server.hostname" parameter. Thus, we keep the current default behavior of warning the user if their remote endpoint is only listening on the local interface, but allowing users who know what they are doing to specify the local interface if they really want to.
Created attachment jmeter-rmi.patch: Support RMI client port configuration and using loopback interfaces.
jmeter-rmi.patch
### Eclipse Workspace Patch 1.0#P jmeter
Index: src/core/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java
===================================================================--- src/core/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java (revision 1231656)+++ src/core/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java (working copy)@@ -23,6 +23,7 @@
import org.apache.jmeter.engine.event.LoopIterationEvent;
import org.apache.jmeter.testelement.TestListener;
+import org.apache.jmeter.util.JMeterUtils;
/**
* Implementation of remote sampler listener, also supports TestListener
@@ -35,9 +36,12 @@
private final TestListener testListener;
private final SampleListener sampleListener;
++ private static final int DEFAULT_LOCAL_PORT = + JMeterUtils.getPropDefault("client.rmi.localport", 0); // $NON-NLS-1$
public RemoteSampleListenerImpl(Object listener) throws RemoteException {
- super();+ super(DEFAULT_LOCAL_PORT);
if (listener instanceof TestListener) {
testListener = (TestListener) listener;
} else {
Index: src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java
===================================================================--- src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java (revision 1231656)+++ src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java (working copy)@@ -81,9 +81,9 @@
private void init() throws RemoteException {
log.info("Starting backing engine on " + this.rmiPort);
InetAddress localHost=null;
+ // Bug 47980 - allow override of local hostname+ String host = System.getProperties().getProperty("java.rmi.server.hostname"); // $NON-NLS-1$
try {
- // Bug 47980 - allow override of local hostname- String host = System.getProperties().getProperty("java.rmi.server.hostname"); // $NON-NLS-1$
if( host==null ) {
localHost = InetAddress.getLocalHost();
} else {
@@ -94,7 +94,7 @@
}
log.info("IP address="+localHost.getHostAddress());
String hostName = localHost.getHostName();
- if (localHost.isLoopbackAddress()){+ if (localHost.isLoopbackAddress() && host == null){
throw new RemoteException("Cannot start. "+hostName+" is a loopback address.");
}
if (localHost.isSiteLocalAddress()){
Brian Ferris (Bug 52469):
In order to better support SSH-tunneling of the RMI communication channels used in remote testing, please see the attached patch which makes the following two changes:
Just as the RMI ports used for the server component can be specified using "server.rmi.port" and "server.rmi.localport" parameters, introduce a "client.rmi.localport" parameter that can control the RMI port used by the RemoteSampleListenerImpl. Currently, the port is randomly assigned, which makes it tricky to tunnel traffic to that port over a SSH tunnel.
The current behavior of RemoteJMeterEngineImpl is to throw an exception if the remote engine attempts to listen to traffic over the loopback interface. However, we often need this behavior when tunneling RMI traffic over an SSH tunnel as the remote endpoint will actually be a port on the local machine, which is subsequently tunneled. To support this functionality, I propose allowing the localhost loopback interface to be used if it has been specified directly using the "java.rmi.server.hostname" parameter. Thus, we keep the current default behavior of warning the user if their remote endpoint is only listening on the local interface, but allowing users who know what they are doing to specify the local interface if they really want to.
Created attachment jmeter-rmi.patch: Support RMI client port configuration and using loopback interfaces.
jmeter-rmi.patch
Version: Nightly
OS: All
Duplicates:
The text was updated successfully, but these errors were encountered: