3 # Test using the pmfind app to find pmcd servers using the avahi discovery mechanism
5 # Copyright (c) 2014 Red Hat. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
15 $service_discovery || _notrun
"No support for service discovery"
17 # Make sure that the avahi mechanism is available.
18 discovery_available
=false
19 avahi-daemon
--check 2>/dev
/null
&& discovery_available
=true
20 $discovery_available || _notrun
"avahi discovery mechanism is not available"
22 status
=1 # failure is the default!
23 $sudo rm -rf $tmp.
* $seq.full
24 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
26 # real QA test starts here
27 _control_service_discovery
29 echo "-m avahi" |
tee -a $here/$seq.full
30 pmfind
-m avahi | _filter_discovery_unresolved
31 echo "Exit status: $?"
33 echo "-s pmcd -m avahi -r" |
tee -a $here/$seq.full
34 pmfind
-s pmcd
-m avahi
-r | _filter_discovery_resolved
35 echo "Exit status: $?"
39 echo "Exit status: $?"
41 echo "-q -s pmcd -m avahi"
42 pmfind
-q -s pmcd
-m avahi
43 echo "Exit status: $?"
45 echo "-q -s pmcd -m avahi,timeout=5.0"
46 pmfind
-q -s pmcd
-m avahi
,timeout
=5.0
47 # up to 5 seconds may elapse here
48 echo "Exit status: $?"
50 echo "-q -s pmcd -m avahi with AVAHI_DISCOVERY_TIMEOUT=5"
51 AVAHI_DISCOVERY_TIMEOUT
=5 pmfind
-q -s pmcd
-m avahi
52 # up to 5 seconds may elapse here
53 echo "Exit status: $?"
55 echo "-m all" |
tee -a $here/$seq.full
56 pmfind
-m all | _filter_discovery_unresolved
57 echo "Exit status: $?"
59 echo "-m all --resolve" |
tee -a $here/$seq.full
60 pmfind
-m all
--resolve | _filter_discovery_resolved
61 echo "Exit status: $?"