3 # Test local daemon access override settings in PCP_SYSCONFIG_DIR
5 # Copyright (c) 2015 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
17 [ -z "$host" ] && _notrun
"Cannot discover local host name"
18 interface
=`_host_to_ipaddr $host`
19 [ -z "$interface" ] && _notrun
"Cannot translate hostname ($host) to interface"
21 status
=1 # failure is the default!
22 $sudo rm -rf $tmp.
* $seq.full
26 # ensure we do not leave local-only settings enabled
27 _restore_config
$PCP_SYSCONFIG_DIR/pmcd
28 _restore_config
$PCP_SYSCONFIG_DIR/pmproxy
29 _restore_config
$PCP_SYSCONFIG_DIR/pmlogger
31 $sudo $PCP_RC_DIR/pmproxy condrestart
>/dev
/null
2>&1
32 $sudo $PCP_RC_DIR/pcp restart
2>&1 | _filter_pcp_stop | _filter_pcp_start
43 -e "s/$host/HOSTNAME/g" \
44 -e "s/$interface/INTERFACE/g" \
47 trap "_cleanup; exit \$status" 0 1 2 3 15
49 # real QA test starts here
50 _save_config
$PCP_SYSCONFIG_DIR/pmcd
51 _save_config
$PCP_SYSCONFIG_DIR/pmproxy
52 _save_config
$PCP_SYSCONFIG_DIR/pmlogger
54 echo "# Dummy entry added by PCP QA test $seq" > $tmp.
local
55 echo PMCD_LOCAL
=1 >> $tmp.
local
56 $sudo cp $tmp.
local $PCP_SYSCONFIG_DIR/pmcd
57 echo "# Dummy entry added by PCP QA test $seq" > $tmp.
local
58 echo PMPROXY_LOCAL
=1 >> $tmp.
local
59 $sudo cp $tmp.
local $PCP_SYSCONFIG_DIR/pmproxy
60 echo "# Dummy entry added by PCP QA test $seq" > $tmp.
local
61 echo PMLOGGER_LOCAL
=1 >> $tmp.
local
62 $sudo cp $tmp.
local $PCP_SYSCONFIG_DIR/pmlogger
64 $sudo $PCP_RC_DIR/pmproxy stop
>/dev
/null
2>&1
65 $sudo $PCP_RC_DIR/pmproxy start
2>&1 | _filter_pmproxy_start
66 $sudo $PCP_RC_DIR/pcp restart
2>&1 | _filter_pcp_stop | _filter_pcp_start
70 echo; echo "== checking loop pmcd access, expecting success"
71 pminfo
-f -h localhost pmcd.feature.
local 2>&1 | _filter
73 echo; echo "== checking bad pmcd access, expect no values"
74 pminfo
-f -h $interface pmcd.feature.
local 2>&1 | _filter
76 echo; echo "== checking primary pmlogger started in local-only mode"
77 pminfo
-f -h local: pmcd.pmlogger.
host 2>&1 | _filter |
grep primary
79 echo; echo "== checking loop pmlogger access, expecting success"
80 echo quit | pmlc
-h localhost
-P 2>&1 | _filter
82 echo; echo "== checking bad pmlogger access, expect no control"
83 echo quit | pmlc
-h $interface -P 2>&1 | _filter
85 echo; echo "== checking bad pmproxy access, expect no values"
86 pminfo
-f -h localhost@
$interface pmcd.feature.
local 2>&1 | _filter
88 echo; echo "== checking loop pmproxy access, expecting success"
89 pminfo
-f -h localhost@localhost pmcd.feature.
local 2>&1 | _filter