Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 844
blobd03391335e2a936ffc8785fe5e2e9a35768362cb
1 #!/bin/sh
2 # PCP QA Test No. 844
3 # Exercise fix for Fedora bugzilla #1055818 -
4 # pmdalinux segv on unexpected ICMP type field values
6 # Copyright (c) 2014 Red Hat.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 which nmap >/dev/null 2>&1 || _notrun "nmap package not installed"
18 which nping >/dev/null 2>&1 || _notrun "nping binary not installed"
20 status=1 # failure is the default!
21 $sudo rm -rf $tmp.* $seq.full
22 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
24 _filter_icmp_metrics()
26 sed \
27 -e "/network\..*\.incsumerrors: $unavailable/d" \
28 # end filter
31 # real QA test starts here
32 $sudo nping --icmp --icmp-type 142 --quiet --count 1 localhost >$tmp.out 2>$tmp.err
33 status=$?
34 echo "nping status=$status"
35 cat $tmp.out $tmp.err
37 # verify we get good data (2x fetch for segv)
38 pminfo -v network.icmp 2>&1 | _filter_icmp_metrics
39 pminfo -v network.icmp 2>&1 | _filter_icmp_metrics
41 exit