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

Reply via email to