Drop unused condition check
[pcp.git] / qa / 749
blob9ac9ec3ed48f5c8b6669226998f503663e25387a
1 #!/bin/sh
2 # PCP QA Test No. 749
3 # Check pmcd static probes
5 # Copyright (c) 2013-2014 Red Hat.
7 seq=`basename $0`
8 echo "QA output created by $seq"
10 # get standard environment, filters and checks
11 . ./common.product
12 . ./common.filter
13 . ./common.check
15 status=0 # success is the default!
16 $sudo rm -fr $tmp.* $seq.full
17 trap "rm -fr $tmp.*; exit \$status" 0 1 2 3 15
19 # If no systemtap, we cannot run the script
20 which stap >/dev/null 2>&1 || _notrun "No systemtap stap executable found"
22 # If no PCP support for probes, also bail out
23 _get_libpcp_config
24 $static_probes || _notrun "No static probe support available in PCP build"
26 # If running in FIPS mode, we cannot run this either
27 fips_enabled=0
28 fips_stsfile="/proc/sys/crypto/fips_enabled"
29 [ -f $fips_stsfile ] && fips_enabled=`cat $fips_stsfile`
30 test $fips_enabled -eq 0 || _notrun "FIPS enabled, no kernel stap testing"
32 # real QA test starts here
33 cat <<End-of-File >$tmp.stap
34 global probe_hits
35 probe begin {
36 system("pminfo -f hinv >/dev/null")
37 system("pminfo -f kernel >/dev/null")
38 system("pminfo -d mem >/dev/null")
39 system("pminfo -f network >/dev/null")
40 system("pminfo -tT disk >/dev/null")
42 probe process("$PCP_BINADM_DIR/pmcd").mark("*") {
43 probe_hits <<< 1
45 probe timer.ms(1000) {
46 if (@count(probe_hits) > 0)
47 println("PASS")
48 else
49 println("FAIL")
50 exit()
52 End-of-File
53 echo "Using stap config:" >> $seq.full
54 cat $tmp.stap >> $seq.full
55 echo "Running pmcd process:" >> $seq.full
56 $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep pmcd >> $seq.full
58 # check for stap user probing support
59 stap -p4 $tmp.stap >$tmp.out 2>&1
60 if [ $? -ne 0 ]
61 then
62 echo "Systemtap compile check failed"
63 cat $tmp.out >> $seq.full
64 _notrun "Systemtap userspace probing unsupported here"
67 # start systemtap and count pmcd probe hits
68 echo "Fire stap probes:" >> $seq.full
69 $sudo stap $tmp.stap >$tmp.out 2>&1
70 cat $tmp.out | tee -a $seq.full
72 echo "Output from stap:" >> $seq.full
73 cat $tmp.out >> $seq.full
75 # success, all done
76 status=0
77 exit