2 # Common shell routines for testing Avahi service discovery
3 # Copyright (c) 2013-2014 Red Hat.
6 # get standard environment, filters and checks
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
26 $sudo $signal -a "$service" >/dev/null 2>&1
32 $sudo "$PCP_RC_DIR/$service" restart > $here/$seq.full 2>&1
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
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"