/var/lib/pcp/testsuite/common.avahi is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | #
# Common shell routines for testing Avahi service discovery
# Copyright (c) 2013-2014 Red Hat.
#
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
avahi_notrun_checks()
{
_get_libpcp_config
$service_discovery || _notrun "No support for service discovery"
# Is avahi-browse installed?
which avahi-browse >/dev/null 2>&1 || _notrun avahi-browse is not installed
# Is the avahi-daemon installed and running? (maybe /sbin or /usr/sbin)
avahi-daemon --check 2>/dev/null || _notrun avahi-daemon is not available
}
avahi_cleanup()
{
cd $here
$sudo $signal -a "$service" >/dev/null 2>&1
rm -f $tmp.*
}
avahi_service()
{
$sudo "$PCP_RC_DIR/$service" restart >>$here/$seq.full 2>&1
}
avahi_verify()
{
msg="$@"
[ "X$msg" = "X" ] && msg="Verify $service avahi service advertising"
echo $msg | tee -a $here/$seq.full
# strip any domain part ... e.g. if hostname is vm08.localdomain,
# avahi reports this as vm08.local
# look for a line like this ...
# = eth0 IPv4 PCP pmwebd on vm04.localdomain _pmwebd._tcp local
# + eth0 IPv6 PCP pmwebd on vm30 _pmwebd._tcp local
#
hostname=`hostname | sed -e 's/\..*//'`
echo "hostname=$hostname" >>$here/$seq.full
avahi-browse -rt -d local "_$service._tcp" 2>&1 | \
tee -a $here/$seq.full | \
sed -n \
-e '/ '"$hostname"'[ .]/{
s/ */ /g
s/'"$hostname"'[^ ]*/HOSTNAME/
s/[=+] [^ ]* /. <interface> /
s/ IPv[46] / <protocol> /
p
q
}'
}
|