Currently, only the HTTP Request (using HttpClient implementation 3/4) can make tcp/ip connection with a different IP source.
The other samplers don't provide this behavior (currently).

Your script below (FTP) is not the same behavior. You use a special feature from FTP protocol: the passive connection for the data transfer.

You can open a ticket on Bugzilla, and provide some patches to implement this.



On 10/08/2015 15:26, Karthick N wrote:
Hello Team,

I'm trying to achieve SMTP/POP3 session to the server using different
client IP address via JMeter. However IP source (aka IP Spoofing) option is
only available with HTTP sampler.

BTW, I don't want to use the distributed test (master/salve). I want to
simulate the same behavior whats being used by HTTP sampler.

I was successful of writing a script for FTP. But i'm seeking a
method/feature to invoke different client IP's (Like HTTP IP source) for
default samplers like FTP, Mail read, SMTP, JDBC, MongoDB etc. instead of
wrting script. Any help is highly appreciated.

Here is the sample code for FTP:

import org.apache.commons.net.ftp.FTPClient;

FTPClient client = new FTPClient();

client.setPassiveLocalIPAddress("${IP}");

client.connect("xx.xx.xx.xx",21);

client.login("administrator","dell@123");

OutputStream stream = new FileOutputStream("TempServerLog.txt");

boolean success = client.retrieveFile("test1.txt", stream);

log.info("Success: " + success);

if (!success) {

   SampleResult.setSuccessful(false);

   SampleResult.setResponseMessage("Failed to read file");

}

client.disconnect();

Thanks

Karthick



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to