天天看點

在 Linux 系統中安裝Load Generator ,并在windows 調用

由于公司需要測試系統的最大使用者承受能力,是以需要學習使用loadrunner。在安裝的時候碰到了不少問題,是以寫下此文章總結遇到的問題以及解決方案,希望能幫到大家。也希望大家轉載注明出處。

winsows 的loadrunner 安裝就不多講了,這個太容易了。

以下是linux 中安裝 load generator 說明:

linux 系統版本:centos5.4

load generator 版本 : load generator 11

安裝步驟如下:

1. 到hp官網下載下傳load generator 安裝檔案 software,_load_generator_11.00_t7330-15010.iso

2.確定系統安裝了c++ , gclib 相關工具(我的系統在安裝前已經安裝了gclib ,是以還不知道沒裝這個會發生什麼問題)

3. 在windows 系統下将software,_load_generator_11.00_t7330-15010.iso 解壓出來會有三個檔案夾(hp , linux , solaris),這三個檔案夾是相關系統的安裝包。請根據你的系統選擇對應的檔案夾copy到 要安裝的linux 系統中。為什麼要使用這種解壓後copy的原因是因為我根據網上的方法copy iso 檔案到linux 系統中并使用挂載的方式進行安裝,碰到了很多問題,是以使用這種方式,這可是我原創的哦。我是copy到/home/loadrunner/目錄下

4. 緊跟着就是安裝了,隻需要執行指令/home/loadrunner/linux/installer.sh 會出現如下圖中的安裝向導歡迎界面,選擇next [n] 即可。

在 Linux 系統中安裝Load Generator ,并在windows 調用

5. 出現下圖許可協定界面,也隻需點選agree [a],當然你可以選擇view agreement [v] 檢視協定的詳細内容

在 Linux 系統中安裝Load Generator ,并在windows 調用

6. 出現确認安裝界面,選擇install [i] 即可

在 Linux 系統中安裝Load Generator ,并在windows 調用

7. 出現安裝界面如下圖

在 Linux 系統中安裝Load Generator ,并在windows 調用

8. 完成安裝,選擇finish [f] 即可,恭喜你安裝成功

在 Linux 系統中安裝Load Generator ,并在windows 調用

9. 緊跟着就是配制環境了,網上有說要配置env.csh 的,但我安裝後env.csh 已經預設配置好了,這裡也将的預設配置檔案分享一下

setenv product_dir /opt/hp/hp_loadgenerator

setenv m_lroot $product_dir

if ( `uname` == sunos ) then

    setenv ld_library_path ${m_lroot}/bin

else if ( `uname` == linux ) then

else if ( `uname` == aix ) then

    setenv libpath ${m_lroot}/bin

else if ( `uname` == hp-ux ) then

    setenv shlib_path ${m_lroot}/bin

endif

setenv path ${m_lroot}/bin:$path

10 .除了上文中講到的還需要在/root/.bashrc檔案中添加如下配制,儲存修改後登出使用者重用登入

export product_dir=/opt/hp/hp_loadgenerator 

export m_lroot=$product_dir 

export ld_library_path=${m_lroot}/bin 

export path=${m_lroot}/bin:$path

11 . load generator會安裝到/opt/hp/hp_loadgenerator目錄下,我也是使用預設的。進行/opt/hp /hp_loadgenerator/bin 目錄執行./verify_generator (不能使用root使用者,至于為什麼還不清楚)  檢查安裝是否成功,如果成功會有以下資訊,

===================================================

              hp

     vuser environment verification utility

product: loadrunner 11.0 

version: 11.0.0.8866 

build: 8866  

localhost.localdomain: 

verify_generator...ok

verify_generator...ok 

don't forget to make sure that the name of the controller machine 

is also in .rhosts 

verify $m_lroot ...failed 

_____it was not possible to set the $m_lroot from 

_____the shell dot files. one of several things might be happening: 

_____1) $m_lroot is not set at all in the shell dot files. 

_____2) there is some error in the shell dot files which stops their execution 

_____   before it sets $m_lroot. 

_____3) there is conditional code in the shell dot files (most likely related to 

_____   interactive and non interactive shells) and $m_lroot is set 

_____   only in one of the sections. 

_____aborting virtual user tests on host localhost.localdomain 

_______________________________________________

summary:

________

vuser host localhost.localdomain: failed

這些failed 我都忽略了,因為這些failed并不影響運作。我很希望哪位大蝦看過此文章後能在此回複解釋一下這些failed可以解決嗎?

上面是正确的資訊,我剛開始的時候遇到了下面這些提示,注意其實這些提示都很直覺,缺少了 libstdc++.so.5 , 安裝就可以了。調用 yum install  libstdc++.so.5 .安裝後再調用 ./verify_generator 就可以看到上面的資訊了。

product: loadrunner 11.0

version: 11.0.0.8866

build: 8866

localhost.localdomain:

/opt/hp/hp_loadgenerator/bin/lrv/chk_thread_lmt: error while loading shared libraries: libstdc++.so.5: cannot open 

shared object file: no such file or

 directory

/opt/hp/hp_loadgenerator/bin/lrv/limithost: line 134: [: : integer expression expected

/opt/hp/hp_loadgenerator/bin/lrv/chk_sems_lmt: error while loading shared libraries: libstdc++.so.5: cannot open 

shared object file: no such file or d

irectory

/opt/hp/hp_loadgenerator/bin/lrv/limithost: line 154: [: : integer expression expected

warning: the file .rhosts does not exist in the home directory of the user.

verify $m_lroot ...failed

_____it was not possible to set the $m_lroot from

_____the shell dot files. one of several things might be happening:

_____1) $m_lroot is not set at all in the shell dot files.

_____2) there is some error in the shell dot files which stops their execution

_____   before it sets $m_lroot.

_____3) there is conditional code in the shell dot files (most likely related to

_____   interactive and non interactive shells) and $m_lroot is set

_____   only in one of the sections.

_____aborting virtual user tests on host localhost.localdomain

12 . 啟動 load generator  ,在安裝的bin目錄下輸入 ./m_daemon_setup start 即可開戶服務了 (不能使用root 使用者啟動)

13 . 修改防火牆政策,對54345端口開放,或者直接關閉防火牆(不建議直接關閉)

講到這裡安裝步驟就完,現在講如何在windows 系統下啟用 剛才安裝的load generator

1. 打開controller 的load generator 。 點選 場景--> load generator

在 Linux 系統中安裝Load Generator ,并在windows 調用

2. 添加一個load generator 。點選 添加--> 輸入名稱(名稱即ip)--> 選擇平台 --> 點選更多 --> 點選 unix 環境 --> 勾選“不使用rsh” --> 确定

在 Linux 系統中安裝Load Generator ,并在windows 調用

3. 添加後測試連接配接,如果顯示連接配接成功就功造成了,連接配接時如果有其它問題建議大家多思考,注意那些連接配接不成功的提前。我個人覺得loadrunner 在提示之方面做的比較好,出了問題基本上看提示就知道問題在哪裡。祝大家一切順利。

在 Linux 系統中安裝Load Generator ,并在windows 調用

<a href="http://115.com/file/clg3cm8h">http://115.com/file/clg3cm8h</a>

本文出自seven的測試人生公衆号最新内容請見作者的github頁:http://qaseven.github.io/

繼續閱讀