summaryrefslogtreecommitdiff
path: root/qa/108
blob: 5c35004bbfa73ca45ed85bc52b3fd3a404a12a74 (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
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
102
103
104
105
106
107
108
109
#! /bin/sh
# PCP QA Test No. 108
# pmNameInDom and bad inst number .. core dump for pmda?
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

# get standard filters
. ./common.product
. ./common.filter

trap "rm -f $tmp.*; exit" 0 1 2 3 15
signal=$PCP_BINADM_DIR/pmsignal

_filter()
{
    cat >$tmp.in
    sed <$tmp.in \
	-e 's/value [0-9][0-9]*/value NUMBER/' >$tmp.tmp
    if [ `egrep 'red|green|blue' $tmp.tmp | wc -l | sed -e 's/  *//g'` -ge 1 ]
    then
	egrep -v 'red|green|blue' $tmp.tmp
	echo "... at least one value"
    else
	cat $tmp.in
	echo "... does not look right"
    fi
}

#
# just like the kill builtin, just do it quietly
_silent_kill()
{
    if [ $# -eq 1 ]
    then
	(( $signal $1 )&) >/dev/null 2>&1
    else
	echo "_silent_kill: needs 1 arg, not $#"
    fi
}

# real QA test starts here
cat <<End-of-File >$tmp.config
log mandatory on 1 sec {
    sample.bin [ "x555" "x666" ]
    sample.bin [ 555 666 ]
    sample.bin [ "x777" "x888" ]
    sample.bin [ 777 888 ]
}
End-of-File
rm -f $tmp.0 $tmp.meta $tmp.index
pmlogger -c $tmp.config -s 1 $tmp >$tmp.tmp 2>&1 &
killer=$!
sleep 2
_silent_kill $killer

echo "check sample pmda is still alive ..."
pminfo -f sample.bin
pminfo -v sample \
| sed \
    -e '/sample.dynamic/d' \
    -e '/sample.darkness/d' \
    -e '/sample.secret/d' \
    -e '/sample.sysinfo/d'
echo ""

cat <<End-of-File >$tmp.config
log mandatory on 1 sec {
    sample.bin [ 100 ]
    simple.color [ 0 2 ]
    sample.bin [ 200 ]
}
End-of-File
rm -f $tmp.0 $tmp.meta $tmp.index
pmlogger -c $tmp.config -s 1 $tmp >$tmp.tmp 2>&1 &
killer=$!
sleep 2
_silent_kill $killer

echo "check simple pmda is still alive ..."
pminfo -f simple.color | _filter
pminfo -v simple
echo ""

cat <<End-of-File >$tmp.config
log mandatory on 1 sec {
    sampledso.bin [ 777 888 ]
}
End-of-File
rm -f $tmp.0 $tmp.meta $tmp.index
pmlogger -c $tmp.config -s 1 $tmp >$tmp.tmp 2>&1 &
killer=$!
sleep 2
_silent_kill $killer 2>&1 >/dev/null

echo "check sampledso pmda is still alive ..."
pminfo -f sampledso.bin
pminfo -v sampledso \
| sed \
    -e '/sampledso.dynamic/d' \
    -e '/sampledso.darkness/d' \
    -e '/sampledso.secret/d' \
    -e '/sampledso.sysinfo/d'
echo ""

exit 0