-
Notifications
You must be signed in to change notification settings - Fork 0
/
netperf_fetch_old_result.sh
executable file
·74 lines (65 loc) · 1.93 KB
/
netperf_fetch_old_result.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
netperf_loop4_sp3_gm_tcp="https://w3.suse.de/~rd-qa/Results/ProductTests/SLES-11-SP3/GM/i586/apac2-ph026.apac.novell.com/netperf-peer-loop-2015-03-18-17-26-10"
netperf_loop4_sp3_gm_udp="https://w3.suse.de/~rd-qa/Results/ProductTests/SLES-11-SP3/GM/i586/apac2-ph026.apac.novell.com/netperf-peer-loop-2015-03-18-17-26-10"
netperf_loop6_sp3_gm_tcp=""
netperf_loop6_sp3_gm_udp=""
echo "===start==========="
OLD_DIR=../old
if ! [ -d $OLD_DIR ]; then
mkdir $OLD_DIR
fi
for file in `ls result/*`
do
string=$(basename ${file})
echo "========$string=========="
parent=$(basename $(dirname `pwd`))
echo "========$parent=========="
echo $parent | grep 'loop4$'
if [ $? -eq 0 ];then
echo $file | grep '\-tcp$'
if [ $? -eq 0 ];then
echo "==tcp==$parent=========="
curl $netperf_loop4_sp3_gm_tcp/$string > $OLD_DIR/$string
fi
echo $file | grep '\-udp$'
if [ $? -eq 0 ];then
echo "==udp===$parent=========="
curl $netperf_loop4_sp3_gm_udp/$string > $OLD_DIR/$string
fi
fi
echo $parent | grep 'loop6$'
if [ $? -eq 0 ];then
echo $file | grep '\-tcp$'
if [ $? -eq 0 ];then
echo "==tcp==$parent=========="
if [ -z $netperf_loop6_sp3_gm_tcp ];then
continue
fi
curl $netperf_loop6_sp3_gm_tcp/$string > $OLD_DIR/$string
fi
echo $file | grep '\-udp$'
if [ $? -eq 0 ];then
echo "==udp===$parent=========="
if [ -z $netperf_loop6_sp3_gm_udp ];then
continue
fi
curl $netperf_loop6_sp3_gm_udp/$string > $OLD_DIR/$string
fi
fi
done
echo "===end============="
set -x
pushd $OLD_DIR
file_list=`ls`
mkdir result
for file in ${file_list}
do
touch ${OLD_DIR}/result/${file}
if echo ${file} | grep '\-tcp$'; then
for i in $(cat ${file} | grep "^ [0-9]*" | awk '{print $5}');do echo $i >> ${OLD_DIR}/result/${file};done
fi
if echo ${file} | grep '\-udp$'; then
for i in $(cat ${file} | egrep '^[0-9]+'| head -n 2 | awk '{if(NR==1)print $6;if(NR==2) print $4;}');do echo $i >> ${OLD_DIR}/result/${file};done
fi
done
popd