File: 525

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (101 lines) | stat: -rwxr-xr-x 2,293 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh
# PCP QA Test No. 525
# Units from summary botched after avg_host added to metric declaration.
#
# From a report by Jun Wang, junwang123@gmail.com
#
# Copyright (c) 2013 Ken McDonell.  All Rights Reserved.
# Copyright (c) 2015 Red Hat.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

[ -f $PCP_PMDAS_DIR/summary/pmdasummary ] || _notrun "summary pmda not installed"

status=1	# failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15

# check if summary PMDA already installed
#
eval `pmprobe summary 2>&1 | awk '
BEGIN	{ sts = "false" }
$2 > 0	{ sts = "true"; exit }
END	{ print "reinstall=" sts }'`

_cleanup()
{
    cd $PCP_VAR_DIR/pmdas/summary
    for file in pmns expr.pmie help
    do
	[ -f $file.$seq ] && $sudo mv $file.$seq $file
    done
    if $reinstall
    then
	$sudo ./Install </dev/null >>$seq_full 2>&1
    else
	$sudo ./Remove >>$seq_full 2>&1
    fi
    cd $here
    rm -rf $tmp.*
}

cat >$tmp.pmns <<End-of-File
/* for QA $seq */
summary {
    mem		SYSSUMMARY:0:0
    avg_mem	SYSSUMMARY:0:1
    qa
}
summary.qa {
    t01		SYSSUMMARY:1:1
    t02		SYSSUMMARY:1:2
    t03		SYSSUMMARY:1:3
    t04		SYSSUMMARY:1:4
    t05		SYSSUMMARY:1:5
    t06		SYSSUMMARY:1:6
}
End-of-File

cat >$tmp.expr.pmie <<End-of-File
summary.mem = sample.kbyte_ctr;
summary.avg_mem = avg_host sample.kbyte_ctr :'localhost' :'127.0.0.1';
// now some extra tests after pmie has been fixed
summary.qa.t01 = sample.kbyte_ctr + 1;
summary.qa.t02 = sample.kbyte_ctr + 1 Kbyte / sec;
summary.qa.t03 = some_inst sample.long.bin_ctr > 0;
summary.qa.t04 = all_inst sample.long.bin_ctr > 0;
summary.qa.t05 = min_inst sample.long.bin_ctr;
summary.qa.t06 = max_inst sample.long.bin_ctr;
End-of-File

echo >$tmp.help

cd $PCP_VAR_DIR/pmdas/summary

for file in pmns expr.pmie help
do
    $sudo mv $file $file.$seq
    $sudo mv $tmp.$file $file
done
$sudo ./Install </dev/null | _filter_pmda_install

# real QA test starts here
pminfo -d summary | tee -a $seq_full
pminfo -f summary >>$seq_full

cat $PCP_LOG_DIR/pmcd/summary.log >>$seq_full

echo >>$seq_full
echo "--- pmie directly ---" >>$seq_full
pmie -v -t 1 -T +2 -c expr.pmie >>$seq_full 2>&1

# success, all done
status=0

exit