diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
commit | 47e6e7c84f008a53061e661f31ae96629bc694ef (patch) | |
tree | 648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/common.avahi | |
download | pcp-debian.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/common.avahi')
-rw-r--r-- | qa/common.avahi | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/qa/common.avahi b/qa/common.avahi new file mode 100644 index 0000000..38bcc35 --- /dev/null +++ b/qa/common.avahi @@ -0,0 +1,43 @@ +# +# 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 > $seq.full 2>&1 +} + +avahi_verify() +{ + echo "Verify $service avahi service advertising" + hostname=`hostname` + avahi-browse -rt -d local "_$service._tcp" | \ + tee -a $seq.full | \ + grep -m1 "hostname = .$hostname" | \ + sed -e "s/$hostname/HOSTNAME/g" +} |