qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 550
blob44d115655aa8fd22b5d3ab6fb54934ecedf99195
1 #!/bin/sh
2 # PCP QA Test No. 550
3 # Exercise fixes for remotely triggered memory leaks in pmcd
5 # Copyright (c) 2013 Red Hat. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 [ -n "$PCP_PYTHON_PROG" ] || _notrun "no acceptable python to run secure/leak-*"
18 host=localhost
19 iterate=1000
20 timeout=2
21 status=1 # failure is the default!
22 $sudo rm -rf $tmp.* $seq.full
23 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
25 pmcd_memory()
27 pmprobe -h $host -v pmcd.datasize \
28 | tee -a $here/$seq.full \
29 | awk '{ print $3 }'
32 # real QA test starts here
33 echo "Initial pmcd memory size:" > $seq.full
34 MEMINIT=`pmcd_memory`
35 cd secure
36 for leak_test in leak-*
38 echo "$leak_test checking: " | tee -a $here/$seq.full
39 python $leak_test $host $iterate
40 pmcd_wait -t $timeout -h $host
41 sts=$?
42 echo "$leak_test complete sts=$sts" | tee -a $here/$seq.full
43 [ $sts -ne 0 ] && exit
44 MEMUSED=`pmcd_memory`
45 # allow for max 64KB increase (several pages on 64KB systems)
46 MEMSLOP=`expr $MEMINIT + 640`
47 echo "init=$MEMINIT used=$MEMUSED slop=$MEMSLOP" >> $here/$seq.full
48 [ $MEMUSED -gt $MEMSLOP ] && exit
49 echo "$leak_test memory check=OK" | tee -a $here/$seq.full
50 done
52 # success, all done
53 status=0
54 exit