summaryrefslogtreecommitdiff
path: root/qa/1049
blob: 41b948300c628b0e300a3f372d2bc8b770b682e3 (plain)
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
#! /bin/sh
# PCP QA Test No. 1049 (formerly 552)
# make sure that installed pmie rule files are syntactically OK.
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

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

which pmieconf >/dev/null 2>&1 || _notrun "No pmieconf binary installed"

status=1	# failure is the default!
username=`id -u -n`
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

cat >$tmp.cmd <<EOF
modify all enabled yes
modify shping enabled no
EOF

# TODO - revisit these lists periodically to see what has changed
#
if [ $PCP_PLATFORM = irix ]
then
    # Not all metrics are available in IRIX, so skip the associated
    # rules
    cat >>$tmp.cmd <<EOF
modify espping enabled no
modify environ enabled no
modify xvm enabled no
EOF
else
    # Some metrics unavailable by default, so skip the associated rules
    #
    cat >>$tmp.cmd <<EOF
modify cisco enabled no
EOF
fi

# real QA test starts here
echo "running pmieconf with default rules..."
( cat $tmp.cmd; echo quit ) | pmieconf -f $tmp.eek
echo "status=$?"

echo "running pmie..."
pmieargs="-C"
id pcp >/dev/null 2>&1 && pmieargs="$pmieargs -U $username"
pmie $pmieargs -c $tmp.eek -l $tmp.pmielog
echo "status=$?"
echo "pmie log file..."
cat $tmp.pmielog | _filter_pmie_log

echo "--- pmieconf input ---" >$seq.full
cat $tmp.cmd >>$seq.full
echo "--- pmie input ---" >>$seq.full
cat $tmp.eek >>$seq.full
echo "--- pmie output ---" >>$seq.full
cat $tmp.pmielog >>$seq.full

# success, all done
status=0
exit