blob: d3e6e659c6c02ce4334b583ebe1dabd33f85bb0d (
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
|
#!/bin/sh
# PCP QA Test No. 861
# Exercise custom pmcd hostname settings for clients needing
# accurate (and/or custom) remote host name information.
#
# Copyright (c) 2013 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
pminfo pmcd.hostname >/dev/null || _notrun "No support for pmcd.hostname metric"
signal=$PCP_BINADM_DIR/pmsignal
status=1 # failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
if [ -n "$pid" ]
then
echo "Terminating local pmcd process"
$signal -s TERM $pid
wait
pid=""
fi
cd $here; rm -rf $tmp.*
}
# real QA test starts here
export PCP_PMCDCONF_PATH=$tmp.conf
export PMCD_PORT=9876
export PMCD_SOCKET=$tmp.pmcd.socket
cat <<End-of-File >$tmp.conf
pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
End-of-File
pmcd -H nosuchhost.com -f -x $seq.full -l $tmp.log &
pid=$!
pmcd_wait
echo "Checking custom pmcd.hostname setting from client side:"
pminfo -dfm pmcd.hostname
# success, all done
status=0
exit
|