qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 776
blob49fedab06082c4af87e84d5b5a1513e078bae8c5
1 #!/bin/sh
2 # PCP QA Test No. 776
3 # Test using the pmfind app to find pmcd servers using the active probing
4 # discovery mechanism
6 # Copyright (c) 2014-2015 Red Hat. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.discovery
15 _get_libpcp_config
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
25 _sought_filter()
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
30 sed \
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' \
35 # end
38 _unresolved_filter()
40 sed -e '/ pcp:/d;
41 / proxy:/d;
42 / http:/d' \
43 | _sought_filter
46 _resolved_filter()
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};
52 / pcp:/d;
53 / proxy:/d;
54 / http:/d' \
55 | _sought_filter
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
91 # success, all done
92 status=0
94 exit