???????????
????????β????У??????????50??User??????User????????????IP????????????ν????????з??????????????е??????????200?????е???????????win7 OS??
??????ü?Generator?????
???????Run-time Settings?????趨??
????Run Logic: Number of Iterations: 1 (?????????ν??)
????Log: Enable Log. Always send messages.(???????????????log??????????log??????????????????)
????Think Time: Ignore think time (?????????????????????????????????????)
????????????
????????????????????50??IP???????IP Spoofing
????????????????Loadruner????????У???????Tools???????????IP Wizard??IP?????
??????????μ?IP????????CMD??ipconfig?? ?????????IP???????IP???????????????IP???????????????磬??????????·????????????IP????
??????????IP???????
????LAN Subnet : 192.168.32.0 / 23 (????IP???Σ?192.168.32.4 ~ 192.168.33.254)
????Gateway : 192.168.32.1
??????????IP????????????????????????????????????????

??????????????????IP????????“IP Address File(*.ips)”???????????????????????????Loadrunner?????????????Load Generators?????localhost???????
???????????CMD??ipconfig /all ????????50??IP??
???????IP Wizard?????DHCP?????????????????IP?????
??????????д?????
????????????£?
1 Action()
2 {
3
4     int status;
5     int HttpRetCode;
6     char *ip;
7     ip = lr_get_vuser_ip();
8 //???Loadrunner Controller?????Enable IP Spoofing
9     if(ip)
10         lr_output_message("The IP address is %s"?? ip);
11     else
12         lr_output_message("IP spoofing disabled");
13 //???ü??????50??vuser?????????????
14     lr_rendezvous("letusgo");
15 //????????????????
16     lr_start_transaction("1stReq");
17
18     web_url("RCS_Initial_HTTP_Req"??
19 //???????????????????????δ?????ò????????msisdn??????????????Ρ?
20 //??????????????????????Select next row -> Unique
21 //                                          Update value on -> Once
22         "URL= http://xxx.yyy.com/self?x-forwarding-msisdn={NewParam}"??
23         "TargetFrame=Main"??
24         "Resource=0"??
25         "RecContentType=text/html"??
26         "Mode=http"??
27         LAST );
28 //??????????????????
29     HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
30     lr_output_message("Response code:%d"??HttpRetCode);
31 //??鷵?????????200
32       if(HttpRetCode == 200){
33         lr_end_transaction("1stReq"?? LR_PASS);
34         sleep(2000);
35 //????????????????
36         lr_start_transaction("2ndReq");
37         web_url("RCS_Initial_HTTP_Req"??
38         "URL= https://xxx.yyy.com/self?vers=1&IMSI=1&rcs_version=1&rcs_profile=1&client_vendor=1&client_version=1&terminal_vendor=1&terminal_model=1&terminal_sw_version=1&IMEI=1&mock_scheme=HTTPS"??
39         "TargetFrame=Main"??
40         "Resource=0"??
41         "RecContentType=text/html"??
42         "Mode=http"??
43         LAST );
44 //??????????????????
45          HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
46          lr_output_message("Response code:%d"??HttpRetCode);
47 //??鷵?????????200
48 //?????????????????
49         if(HttpRetCode == 200){
50             lr_end_transaction("2ndReq"?? LR_PASS);
51          }else{
52              lr_end_transaction("2ndReq"?? LR_FAIL);
53         }
54
55      return 0;  }else{
56 //?????????????????
57      lr_end_transaction("1stReq"?? LR_FAIL);
58      return 0;
59      }
60 }
61