I want to transfer files from Unix server 2 another unix Box by using Loadrunner
Question ID: 105592
0
0

I want to transfer files from Unix server 2 another unix Box by using Loadrunner.
Whether it is possible?
If it is possible please let me know which protocol and Sample code

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on September 17, 2014 7:33 am
168 views
Answers (2)
0
Private answer

Any protocol will work. Use the C function system();

system (''ftp '');

I think scp may work too.

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on October 9, 2014 1:46 pm
0
Private answer

The Vuser has to run on one of the 2 Unix systems to use system() correctly.

The simplest way would be to parameterize the source and destinations and files

PARAM FILES: UnixNames.dat and files.dat

UnixNames.dat

SrcSys,DestSys

UnixX1, UnixX2

files.dat

FileSrc,FileDest,flags,comment

/etc/mydir/file1.c,/etc/mydir/file1.c, -f -p , copy a file to the destination file

/etc/mydir/file1.c,/etc/mydir, -f -p , copy a file to the destination dir

/etc/mydir/,/etc/mydir/, -R -f -p , copy directory contents to the destination dir

/etc/mydir,/etc/mydir, -R -f -p , copy directory to the destination (no ''/'' at end)

end,end

create a blank script in a protocol you have, ie web http/html (uses C, not Java or VB)

char *pBuf;

while (strcmp(''end'', lr_eval_string(''{SrcFile''}) != 0)
{

// build the string for the command line

pBuf = lr_eval_string(''cp {Flags} {SrcSys}:{FileSrc} {DestSys}:{DestSys}''))

// should end up with something like:

// cp -f -p UnixX1:/etc/mydir/file1.c UnixX2:/etc/file1.c in the cmdline.

// having the SrcSys and DestSys. if you get an error, try taking off

// the one that matches where the vuser is running on.

system( pBuf );

// use lr_advance_param to get the next file.

lr_advance_param(''FileSrc'');

} // while

I am assuming you know how to associate the parameters with the param files.

if you want to do it as an iteration, replace the while with and ''if'' and remove the lr_advance_param at the bottom. You end up with a load test script that can pound a system.

Good Luck

Marked as spam
Posted by (Questions: 0, Answers: 15)
Answered on October 9, 2014 5:51 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top