pmrep: really drop non-ascii
[pcp.git] / qa / 551
blob14a9d6b45b322e0e4e96c0683c51ceac934d92fb
1 #!/bin/sh
2 # PCP QA Test No. 551
3 # Exercise fix for hanging-pmcd-by-drip-feeding-requests
5 # Copyright (c) 2013 Red Hat. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # secure/* scripts all use python, check its installed
12 # otherwise this test fails (./secure/* not available)
13 . ./common.python
15 host=localhost
16 ppid=0
17 count=5
18 status=1 # failure is the default!
19 $sudo rm -rf $tmp.* $seq.full
20 trap "cleanup; exit \$status" 0 1 2 3 15
22 cleanup()
24 cd $here
25 rm -rf $tmp.*
26 [ $ppid -eq 0 ] || (( kill $ppid >/dev/null 2>&1 ) &)
27 ppid=0
30 cpu_count()
32 pmprobe -h $host -v hinv.ncpu | tee -a $here/$seq.full | awk '{ print $3 }'
36 # real QA test starts here
37 cd secure
38 ncpu=`cpu_count`
39 echo "Initial CPU count: $ncpu" > $here/$seq.full
40 for hang_test in hang-*
42 echo "$hang_test checking: " | tee -a $here/$seq.full
43 python $hang_test $host >$tmp.out 2>&1 &
44 ppid=$!
45 sts=0
46 n=0
47 while [ $n -lt $count ]
49 ncpunow=`cpu_count`
50 echo "Fetched CPU count: $ncpunow" >> $here/$seq.full
51 if [ $ncpunow != $ncpu ]
52 then
53 sts=1
54 break
56 echo "[$n] check data matched" | tee -a $here/$seq.full
57 n=`expr $n + 1`
58 sleep 1
59 done
60 ( kill $ppid >/dev/null 2>&1 ) &
61 wait $ppid
62 ppid=0
63 echo "$hang_test complete" | tee -a $here/$seq.full
64 echo "$hang_test output " >> $here/$seq.full
65 cat $tmp.out >> $here/$seq.full
66 [ $sts -eq 0 ] || exit
67 done
69 # success, all done
70 status=0
71 exit