由于公司需要测试系统的最大用户承受能力,所以需要学习使用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] 即可。
5. 出现下图许可协议界面,也只需点击agree [a],当然你可以选择view agreement [v] 查看协议的详细内容
6. 出现确认安装界面,选择install [i] 即可
7. 出现安装界面如下图
8. 完成安装,选择finish [f] 即可,恭喜你安装成功
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
2. 添加一个load generator 。点击 添加--> 输入名称(名称即ip)--> 选择平台 --> 点击更多 --> 点击 unix 环境 --> 勾选“不使用rsh” --> 确定
3. 添加后测试连接,如果显示连接成功就功造成了,连接时如果有其它问题建议大家多思考,注意那些连接不成功的提前。我个人觉得loadrunner 在提示之方面做的比较好,出了问题基本上看提示就知道问题在哪里。祝大家一切顺利。
<a href="http://115.com/file/clg3cm8h">http://115.com/file/clg3cm8h</a>
本文出自seven的测试人生公众号最新内容请见作者的github页:http://qaseven.github.io/