docs: tweak formatting in pmrep(1) archive folio example
[pcp.git] / qa / common.avahi
blob098ecdee7a07bd741d9c13496dc3e5373485aa2e
2 # Common shell routines for testing Avahi service discovery
3 # Copyright (c) 2013-2014 Red Hat.
6 # get standard environment, filters and checks
7 . ./common.product
8 . ./common.filter
9 . ./common.check
11 avahi_notrun_checks()
13     _get_libpcp_config
14     $service_discovery || _notrun "No support for service discovery"
16     # Is avahi-browse installed?
17     which avahi-browse >/dev/null 2>&1 || _notrun avahi-browse is not installed
19     # Is the avahi-daemon installed and running?  (maybe /sbin or /usr/sbin)
20     avahi-daemon --check 2>/dev/null || _notrun avahi-daemon is not available
23 avahi_cleanup()
25     cd $here
26     $sudo $signal -a "$service" >/dev/null 2>&1
27     rm -f $tmp.*
30 avahi_service()
32     $sudo "$PCP_RC_DIR/$service" restart > $here/$seq.full 2>&1
35 avahi_verify()
37     echo "Verify $service avahi service advertising"
38     # strip any domain part ... e.g. if hostname is vm08.localdomain,
39     # avahi reports this as vm08.local
40     #
41     hostname=`hostname | sed -e 's/\..*//'`
42     avahi-browse -rt -d local "_$service._tcp" | \
43         tee -a $here/$seq.full | \
44         grep -m1 "hostname = .$hostname.local]" | \
45         sed -e "s/$hostname/HOSTNAME/g"