blob: 71cf1aae54c048ec1290e7894d067f458bac445a (
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
|
#!/bin/sh
# PCP QA Test No. 1000
# pmdumptext segv
# https://bugzilla.redhat.com/show_bug.cgi?id=1131779
#
# Copyright (c) 2014 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
which pmdumptext >/dev/null 2>&1 || _notrun "pmdumptext not installed"
status=1 # failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
# filter ...
# Fri Aug 22 20:04:55 7950508.000
#
_filter1()
{
sed \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-2][0-9]:[0-5][0-9]:[0-5][0-9]/DATE/' \
-e 's/[ ][ ]*[0-9][0-9]*\.[0-9][0-9]*/ NUMBER/'
}
# hostname(1)
#
_filter2()
{
sed -e "s/`hostname`/MYHOSTNAME/g"
}
# real QA test starts here
echo "=== expect output ==="
pmdumptext -s 1 'localhost:mem.util.used' | _filter1
echo
echo "=== expect No route to host, no valid metrics ==="
pmdumptext -s 1 'nosuchhost:mem.util.used'
echo
echo "=== expect No route to host, no valid metrics [instance case] ==="
pmdumptext -s 1 'nosuchhost:proc.psinfo.utime[12345]'
echo
echo "=== expect No route to host, no valid metrics -h [instance case] ==="
pmdumptext -s 1 -h nosuchhost 'proc.psinfo.utime[12345]'
$sudo $PCP_RC_DIR/pcp stop >/dev/null
echo
echo "=== pmcd not running, default case ==="
pmdumptext -s 1 'sample.bin[bin-300]' 2>&1 | _filter2
echo
echo "=== pmcd not running, host in metricspec case ==="
pmdumptext -s 1 'localhost:proc.psinfo.utime[12345]'
echo
echo "=== pmcd not running, -h localhost case ==="
pmdumptext -s 1 -h localhost 'proc.psinfo.utime[12345]'
$sudo $PCP_RC_DIR/pcp start >/dev/null
# success, all done
status=0
exit
|