欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 5197|回复: 0
收起左侧

测试

[复制链接]
oppo 发表于 2016-2-24 13:12 | 显示全部楼层 |阅读模式
[tex=md]#轮询测试
## 功能
发送指定数量的dns查询包,并统计第一行返回值
## 使用方法
使用方法 ./polling.sh n domain   n代表总次数,domain为需要测试的域名  
注:根据实际测试环境,需对脚本中的内容进行微调   
## 脚本

```
[root@EnlinkDNS ~]# cat polling.sh
#! /bin/bash
TMP_FILE="mktemp /tmp/polling.XXXXXXXX"
polling=`$TMP_FILE`
idx=0
while [ $idx -lt $1 ]
do
dig -t A $2 @192.168.5.140  +noall +answer | awk 'NR==4{print}' |awk '{print $5}' >> $polling
idx=$(expr $idx + 1)
done
echo total: $1
sort $polling | uniq -c | awk '{print $2 " appear times: " $1}'
rm -f $polling

````
##运行结果

```
[root@EnlinkDNS ~]# ./polling.sh 100file:///C:\Users\hean\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pngwww.eee.com
total: 100
1.1.1.1 appear times: 30
2.2.2.2 appear times: 38
3.3.3.3 appear times: 32

```

[/tex]


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-5-4 08:27 , Processed in 0.038314 second(s), 9 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表