summaryrefslogtreecommitdiff
path: root/qa/072
blob: a33e74331af80318506c0fe05a94ffc07f0a64e1 (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
#! /bin/sh
# PCP QA Test No. 072
# pmlogger dumps core on this one?
#
# 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 $tmp.*; exit" 0 1 2 3 15

_filter()
{
    _filter_pmdumplog \
    | sed \
	-e 's/:.*//' \
	-e 's/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]* (/PMID (/' \
	-e 's/TIMESTAMP/            /'
}

rm -f $seq.full
echo >$seq.full

# real QA test starts here
cat >$tmp.config <<End-of-File
# verbose
log mandatory on every 24 hours {
	hinv.physmem
	hinv.ncpu
	hinv.ndisk
	hinv.nfilesys
}

mandatory on 50 msecs {
	kernel.percpu.cpu.user
	kernel.all.load
	disk.dev.total
	network.interface.in.bytes
	pmcd.pdu_in.fetch
	disk.dev.total # note repeated set of metrics
	mem.freemem
}
End-of-File

remote=`./getpmcdhosts -L -n 1 2>$tmp.out`
if [ -z "$remote" ]
then
    cat $tmp.out >$seq.notrun
    exit
fi

for host in `hostname` $remote
do
    echo
    echo "=== $host ===" >>$seq.full
    rm -f $tmp.0 $tmp.meta $tmp.index
    pmlogger -h $host -s 2 -c $tmp.config -l $tmp.out $tmp >$tmp.err 2>&1
    ( echo "pmlogger output:"; cat $tmp.err $tmp.out ) >>$seq.full
    cat $tmp.err $tmp.out | _filter_pmlogger_log

    pmdumplog -i $tmp 2>&1 >$tmp.out
    ( echo "pmdumplog -i:"; cat $tmp.out ) >>$seq.full

    numindom=`grep InDom: $tmp.out | wc -l | sed -e 's/  *//g'`
    if [ "X$numindom" != X5 ]
    then
	echo "for host $host, expected 5 InDom entries in the meta data, got ..."
	cat $tmp.out
    else
	echo "number of InDom entries is OK"
    fi

    echo "expect 2 sets of values for disks and 2 sets of values for networks ..."
    echo "pmdumplog:" >>$seq.full
    pmdumplog $tmp 2>&1 \
    | tee -a $seq.full \
    | egrep 'disk\.|network\.' \
    | _filter \
    | LC_COLLATE=POSIX sort
done