3 # exercise pmdaCacheStoreKey()
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 status
=0 # success is the default!
17 $sudo rm -rf $tmp.
* $seq.full
18 trap "$sudo rm -f $tmp.* $PCP_VAR_DIR/config/pmda/42.42; exit \$status" 0 1 2 3 15
20 # real QA test starts here
21 for arg
in -k '' -d '-l -Dindom' -dk '-l -Dindom'
23 echo |
tee -a $seq.full
24 echo "=== keycache $arg ===" |
tee -a $seq.full
31 $sudo rm -f $PCP_VAR_DIR/config
/pmda
/42.42
35 $sudo src
/keycache
$arg >$tmp.out
2>&1
36 cat $tmp.out
>>$seq.full
43 echo "First few lines of output ..."
46 echo "Duplicate instance ids ... expect none"
48 -e '/pmdaCacheDump:/q' \
49 -e '/active 0x0/s//active (nil)/' \
50 -e '/ -> /s/ -> .*//p' \
60 $PCP_AWK_PROG <$tmp.out
'
61 /pmdaCacheDump:/ { want = 1 }
62 want == 1 { print }' \
63 |
sed -e '/active 0x0/s//active (nil)/'
68 echo "Check distribution ..."
69 $PCP_AWK_PROG <$tmp.out
'
70 /Instances distribution across/ { want=1
73 minp = 0.95 * (1 / nb)
74 maxp = 1.05 * (1 / nb)
77 minp = 0.90 * (1 / nb)
78 maxp = 1.10 * (1 / nb)
81 minp = 0.80 * (1 / nb)
82 maxp = 1.20 * (1 / nb)
85 minp = 0.75 * (1 / nb)
86 maxp = 1.25 * (1 / nb)
91 want == 1 && NF == 0 { want = 0 }
92 want == 1 { for (i = 1; i <= NF; i++) {
93 if (minp <= $i && $i <= maxp)
96 printf "%s not in (%.4f,%.4f) ",$i,minp,maxp