3 # Test using the pmfind app to find pmcd servers using the active probing
6 # Copyright (c) 2014-2015 Red Hat. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
16 $ipv6 || _notrun
"No libpcp or local host support for IPv6"
17 $service_discovery || _notrun
"No support for service discovery"
18 addr
=`_host_to_ipv6addrs local: | head -1`
19 [ ! -z "$addr" ] || _notrun
"No active IPv6 interfaces"
21 status
=1 # failure is the default!
22 $sudo rm -rf $tmp.
* $seq.full
23 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
27 # Only pmcd is guaranteed to be running, but other services may also be.
28 # Transform two cases - no servers vs found servers - into deterministic
29 # output for the --all invocations
31 -e 's/No \(pmproxy servers\) discovered/Sought \1/g' \
32 -e 's/No \(pmwebd servers\) discovered/Sought \1/g' \
33 -e 's/Discovered \(pmproxy servers\):/Sought \1/g' \
34 -e 's/Discovered \(pmwebd servers\):/Sought \1/g' \
48 # Pass unresolved urls, filter the resolved ones.
49 sed -e '/ pcp:\/\/[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/{p;b};
50 / proxy:\/\/[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/{p;b};
51 / http:\/\/[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/{p;b};
58 # real QA test starts here
59 echo "Using IPv6 addr=$addr" > $seq.full
61 _control_service_discovery
63 # Probe the obtained network.
64 # Test various combinations of service queries and subnet sizes. Keep the
65 # subnet size small -- say max 4 bits.
66 echo "-m probe=$addr/128" >> $seq.full
67 echo "-m probe=IPV6_ADDR/128"
68 pmfind
-m probe
=$addr/128 | _unresolved_filter
69 echo "Exit status: $?" |
tee -a $seq.full
71 echo "-s pmcd -m probe=$addr/127 -r" >> $seq.full
72 echo "-s pmcd -m probe=IPV6_ADDR/127 -r"
73 pmfind
-s pmcd
-m probe
=$addr/126 -r | _resolved_filter
74 echo "Exit status: $?" |
tee -a $seq.full
76 echo "-q -m probe=$addr/126" >> $seq.full
77 echo "-q -m probe=IPV6_ADDR/126"
78 pmfind
-q -m probe
=$addr/125 | _unresolved_filter
79 echo "Exit status: $?" |
tee -a $seq.full
81 echo "-q -s pmcd -m probe=$addr/125 --resolve" >> $seq.full
82 echo "-q -s pmcd -m probe=IPV6_ADDR/125 --resolve"
83 pmfind
-q -s pmcd
-m probe
=$addr/124 --resolve | _resolved_filter
84 echo "Exit status: $?" |
tee -a $seq.full
86 echo "-q -s pmcd -m probe=$addr/124,maxThreads=8" >> $seq.full
87 echo "-q -s pmcd -m probe=IPV6_ADDR/124,maxThreads=8"
88 pmfind
-q -s pmcd
-m probe
=$addr/124,maxThreads
=8 | _unresolved_filter
89 echo "Exit status: $?" |
tee -a $seq.full