Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 903
blobb03fb78e88da1a60c86ccfad4f64cd2c245f9074
1 #!/bin/sh
2 # PCP QA Test No. 903
3 # Exercise the PAPI PMDA Install/Remove process.
5 # Copyright (c) 2014 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 [ -d $PCP_PMDAS_DIR/papi ] || _notrun "PAPI PMDA is not installed"
18 status=1 # failure is the default!
19 $sudo rm -rf $tmp.* $seq.full
20 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
22 _filter_papi()
24 # cull message resulting from no papi metrics
25 grep -v 'Missing metric value(s)' | \
26 grep -v 'No value(s) available' | \
27 grep -v 'papi.control.reset: .* not yet .*'
30 pmdapapi_remove()
32 echo
33 echo "=== remove PAPI agent ==="
34 $sudo ./Remove >$tmp.out 2>&1
35 _filter_pmda_remove <$tmp.out
38 pmdapapi_install()
40 # start from known starting points
41 cd $PCP_PMDAS_DIR/papi
42 $sudo ./Remove >/dev/null 2>&1
43 $sudo $PCP_RC_DIR/pmcd stop | _filter_pcp_stop
45 echo
46 echo "=== PAPI agent installation ==="
47 $sudo ./Install </dev/null >$tmp.out 2>&1
48 # some warnings are reasonable (e.g., too many concurrent counters)
49 num_metrics=`$sudo pminfo -f papi.available.num_counters | grep value | awk '{print $2}'`
50 if [ -z "$num_metrics" ] || [ "$num_metrics" -eq "0" ]; then
51 _notrun "PAPI metrics not found on hardware"
53 # Check papi metrics have appeared ... X metrics and Y values
54 _filter_pmda_install <$tmp.out \
55 | sed \
56 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
57 -e 's/[0-9][0-9]* warnings, //' \
58 | $PCP_AWK_PROG '
59 /Check papi metrics have appeared/ { if ($7 >= 7 && $7 <= 2500) $7 = "X"
60 if ($10 >= 0 && $10 <= 2500) $10 = "Y"
62 { print }'
65 _prepare_pmda papi
66 trap "_cleanup_pmda papi; exit \$status" 0 1 2 3 15
68 # real QA test starts here
69 pmdapapi_install
71 # pmcd should have been started by the Install process - check
72 if $sudo pminfo -v papi > $tmp.info 2> $tmp.err
73 then
75 else
76 echo "... failed! ... here is the Install log ..."
77 cat $tmp.out
79 cat $tmp.info $tmp.err | _filter_papi
81 pmdapapi_remove
82 status=0
83 exit