博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
test-definitions/blob/master/auto-test/httperf-client/httperf.sh
阅读量:4214 次
发布时间:2019-05-26

本文共 1258 字,大约阅读时间需要 4 分钟。

#!/bin/sh#回显执行的命令和参数set -xcd ../../utils . ./sys_info.shcd -#检查是否是root用户if [ `whoami` != 'root' ] ; then    echo "You must be the superuser to run this script" >&2    exit 1fi#distro=`cat /etc/redhat-release | cut -b 1-6`#看起来centos 会通过源码编译httpperfcase $distro in"centos")     yum install make -y     wget ftp://ftp.hpl.hp.com/pub/httperf/httperf-0.9.0.tar.gz     tar -zxvf httperf-0.9.0.tar.gz     cd httperf-0.9.0     ./configure --build=arm-linux     make     make install     print_info $? install-package     ;; "ubuntu")     apt-get install httperf -y     print_info $? install-package     ;;esac#Test ' httperf server'#执行httperf测试,并加log输出到文件中httperf --server sina.com.cn --num-conn 300 --rate 30 2>&1 | tee httperf.logprint_info $? httper-test$TCID="httperf-test"#在文件中查找关键字符串,后面会根据这个字符串是否为null,来判断是否执行成功str=`grep -Po "total 0" httperf.log`if [ "$str" != "" ] ; then    lava-test-case $TCID --result passelse    lava-test-case $TCID --result failefi#根据进程名杀掉进程pkill httperf删除logrm httperf.log#删除包case $distro in    "centos")        yum remove make -y        rm -f httperf-0.9.0.tar.gz        rm -rf httperf-0.9.0        print_info $? remove-httperf        ;;    "ubuntu")        apt-get remove httperf -y        print_info $? remove-httperf        ;;esac

转载地址:http://gznmi.baihongyu.com/

你可能感兴趣的文章
MySQL必知必会 -- 了解SQL和MySQL
查看>>
MySQL必知必会 -- 数据检索
查看>>
MySQL必知必会 -- 排序检索数据 ORDER BY
查看>>
POJ 3087 解题报告
查看>>
POJ 2536 解题报告
查看>>
POJ 1154 解题报告
查看>>
POJ 1661 解题报告
查看>>
POJ 1101 解题报告
查看>>
ACM POJ catalogues[转载]
查看>>
ACM经历总结[转载]
查看>>
C/C++文件操作[转载]
查看>>
常见的排序算法
查看>>
hdu 3460 Ancient Printer(trie tree)
查看>>
KMP求前缀函数(next数组)
查看>>
KMP
查看>>
poj 3863Business Center
查看>>
Android编译系统简要介绍和学习计划
查看>>
Android编译系统环境初始化过程分析
查看>>
user2eng 笔记
查看>>
DRM in Android
查看>>