3 # Exercise daemon local-only access in IPv6 mode.
5 # Copyright (c) 2015 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
17 $ipv6 || _notrun
"IPv6 support is not available"
19 [ -z "$host" ] && _notrun
"Cannot discover local host name"
20 addr
=`_host_to_ipv6addrs $host | head -1`
21 [ -z "$addr" ] && _notrun
"Cannot translate hostname ($host) to IPv6 address"
22 ipv6local
=`_ipv6_localhost`
24 status
=1 # failure is the default!
25 $sudo rm -rf $tmp.
* $seq.full
29 # ensure we do not leave local-only settings enabled
30 _restore_config
$PCP_SYSCONFIG_DIR/pmcd
32 $sudo $PCP_RC_DIR/pcp restart
2>&1 | _filter_pcp_stop | _filter_pcp_start
43 -e "s/$host/HOSTNAME/g" \
44 -e "s/$addr/IPV6ADDR/g" \
47 trap "_cleanup; exit \$status" 0 1 2 3 15
49 # real QA test starts here
50 echo "Using IPv6 addr=$addr" > $seq.full
52 _save_config
$PCP_SYSCONFIG_DIR/pmcd
54 echo; echo "== checking loop pmcd access, expecting success"
55 pminfo
-f -h "pcp://$ipv6local" pmcd.feature.
local 2>&1 | _filter
57 echo; echo "== checking ipv6 pmcd access, expecting success"
58 pminfo
-f -h "pcp://[$addr]" pmcd.feature.
local 2>&1 | _filter
60 echo; echo "== changing default setup to local host only"; echo
61 echo "# Dummy entry added by PCP QA test $seq" > $tmp.
local
62 echo PMCD_LOCAL
=1 >> $tmp.
local
63 $sudo cp $tmp.
local $PCP_SYSCONFIG_DIR/pmcd
65 $sudo $PCP_RC_DIR/pmcd restart
2>&1 | _filter_pcp_stop | _filter_pcp_start
68 echo; echo "== checking loop pmcd access, expecting success"
69 pminfo
-f -h "pcp://$ipv6local" pmcd.feature.
local 2>&1 | _filter
71 echo; echo "== checking bad pmcd access, expect no values"
72 pminfo
-f -h "pcp://[$addr]" pmcd.feature.
local 2>&1 | _filter