软件测试怎么应⽤shell,软件测试常⽤shell脚本⼀ 循环
#!/bin/bash
mv perf.log perf.log_bak
while (( "1"=="1" ))
do
java -cp 'conf/:apps/*:lib/*' org.st.db.PerfomanceOk trans 50000 100 >> perf.log
sleep 550
done
⼆ 预期输⼊
#!/bin/bash
set -x
set -e
ethconsole ${node_path}/nodedata-1/data/geth.ipc <
Peers(console.log);Block(2,console.log)
EOF
/usr/bin/expect << EOF
set timeout 500
spawn ./install_node.sh install
expect "gavin:"
send "Aa12345!\r"
expect "Installing eth environment success"
EOF
三 函数调⽤
running(){
sleep 1
软件测试appold_count=`grep +++++ ${host_path}/build/nodedir$1/log/info*|wc -l`
sleep 7
new_count=`grep +++++ ${host_path}/build/nodedir$1/log/info*|wc -l`
if((${old_count}
then
echo "****** success, node$1 is running normally ******"
#return true
else
echo "****** fail,node$1 is not running ******"
#return false
fi
}
running 3
四 curl命令借⼝测试
curl -X POST --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":83}' 127.0.0.1:8545
curl -s -l -H "Content-type: application/json" -X POST -d
'{"seqNo":"1067","orgNo":"123","chainId":"100120043","chainName":"he43","chainContent":"test43","extId":"ex43"}'10.107.10
五 根据⽇志统计
grep '2018-09-06 19:1' appmonitor.log|grep New |awk -F '"' '{a+=$8;b+=1} END {print a,b,a/b}' 统计19:10-19:19分,所有上
链的次数和平均耗时
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论