searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

LTP-stress测试自动化实现

2023-10-27 06:54:20
226
0

 LTP是由 Linux Test Project 所开发的一套系统测试套件。它基于系统资源的利用率统计开发了一个测试的组合,为系统提供足够的压力。通过压力测试来判断系统的稳定性和可靠性。

服务器产品一般进行72h压力测试,桌面产品一般进行24小时压力测试,常用测试命令:

 ./ltpstress.sh -n -t 72 

 其中:

-n参数表示不进行网络相关测试,-t参数指定测试时长(小时为单位,最小为 1,默认24),该脚本最终调用genload程序来运行,genload根据传入的进程个数fork子进程,每个子进程的读写的内存为1GB,启动多少个进程由测试时的内存状态(含SWAP分区情况)决定。但ltpstress.sh脚本在20190115版本被删除了,如果要在高版本的ltp工具中使用ltpstress,需要做一定程度的修改,来提升工具安装及执行的效率。

1.下载ltp-20220121.zip,解压到指定目录下,并安装工具执行的依赖包

unzip ltp-20220121.zip -d /home
yum -y install gcc git make pkgconf autoconf automake bison flex m4 kernel-headers glibc-headers libtirpc libtirpc-devel

 2.进入ltp目录,将ltpstress运行所需的文件放入ltp对应目录下

cp stress.part1 /homeltp/runtest/
cp stress.part2 /homeltp/runtest/
cp stress.part3 /homeltp/runtest/
cp ltpstress.h /homeltp/testscripts/

3.对ltp进行编译

cd /home/ltp
export CFLAGS+="-fcommon"
make autotools
./configure
make -j4 && make install

4.执行压力测试

cd /opt/ltp/testscripts
./ltpstress.sh -n -t 72 

5.执行完后,需要关注系统的日志

#检查内存是否有泄漏
dmesg | grep -i \'new suspected memory leasks\'
#检查是否有僵尸进程
ps -A -ostat,ppid,pid,cmd | grep -e \'^[Zz]\'
#检查日志是否有错误
cat /var/log/messages | grep \'ltp-stress\' | grep -i \'error\'

 

0条评论
0 / 1000
w****n
2文章数
0粉丝数
w****n
2 文章 | 0 粉丝
w****n
2文章数
0粉丝数
w****n
2 文章 | 0 粉丝
原创

LTP-stress测试自动化实现

2023-10-27 06:54:20
226
0

 LTP是由 Linux Test Project 所开发的一套系统测试套件。它基于系统资源的利用率统计开发了一个测试的组合,为系统提供足够的压力。通过压力测试来判断系统的稳定性和可靠性。

服务器产品一般进行72h压力测试,桌面产品一般进行24小时压力测试,常用测试命令:

 ./ltpstress.sh -n -t 72 

 其中:

-n参数表示不进行网络相关测试,-t参数指定测试时长(小时为单位,最小为 1,默认24),该脚本最终调用genload程序来运行,genload根据传入的进程个数fork子进程,每个子进程的读写的内存为1GB,启动多少个进程由测试时的内存状态(含SWAP分区情况)决定。但ltpstress.sh脚本在20190115版本被删除了,如果要在高版本的ltp工具中使用ltpstress,需要做一定程度的修改,来提升工具安装及执行的效率。

1.下载ltp-20220121.zip,解压到指定目录下,并安装工具执行的依赖包

unzip ltp-20220121.zip -d /home
yum -y install gcc git make pkgconf autoconf automake bison flex m4 kernel-headers glibc-headers libtirpc libtirpc-devel

 2.进入ltp目录,将ltpstress运行所需的文件放入ltp对应目录下

cp stress.part1 /homeltp/runtest/
cp stress.part2 /homeltp/runtest/
cp stress.part3 /homeltp/runtest/
cp ltpstress.h /homeltp/testscripts/

3.对ltp进行编译

cd /home/ltp
export CFLAGS+="-fcommon"
make autotools
./configure
make -j4 && make install

4.执行压力测试

cd /opt/ltp/testscripts
./ltpstress.sh -n -t 72 

5.执行完后,需要关注系统的日志

#检查内存是否有泄漏
dmesg | grep -i \'new suspected memory leasks\'
#检查是否有僵尸进程
ps -A -ostat,ppid,pid,cmd | grep -e \'^[Zz]\'
#检查日志是否有错误
cat /var/log/messages | grep \'ltp-stress\' | grep -i \'error\'

 

文章来自个人专栏
Ctyunos
2 文章 | 1 订阅
0条评论
0 / 1000
请输入你的评论
0
0