首页 > 系统服务 > 详细

Linux shell 批量运行jmeter脚本

时间:2019-04-22 00:32:36      阅读:572      评论:0      收藏:0      [点我收藏+]
#!/bin/bash

jmxpath=
outputpath=

function readfile ()
{
  for file in `ls $1`
  do
    if [ -d $1"/"$file ]
    then
      readfile $1"/"$file
    else
    if [ "${file##*.}" == "jmx" ];
        then
           echo $jmxpath"/"$file
           filename="${file%.*}"
           run_jmeter $jmxpath"/"$file $filename $outputpath
        fi
    echo `basename $file`
    fi
  done
}

function run_jmeter () {
  echo $1 $2 $3
  mkdir -p $3"/out/"$2"/"
  jmeter.sh -n -t $1 -l $3"/"$2".jtl" -e -o $3"/out/"$2"/"
}

if  [ ! -n "$1" ] ;then
    echo "Please input the target test case jmx path"
    read jmxpath
else
    jmxpath=$1
    
fi

if  [ ! -n "$2" ] ;then
    echo "Please input the test results out path"
    read outputpath
else
    outputpath=$2
    
fi

readfile $1 $2

 

Linux shell 批量运行jmeter脚本

原文:https://www.cnblogs.com/majestyking/p/10747888.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!