qa: revert some change to expected 244 outputs (from pmda-restart)
[pcp.git] / qa / 886
bloba962bb7e307709f66e934ed62f0a466c46a091f9
1 #!/bin/sh
2 # PCP QA Test No. 886
3 # Verify /proc/interrupts parsing for various architectures.
5 # Copyright (c) 2016 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 [ $PCP_PLATFORM = linux ] || _notrun "Linux interrupts test, only works with Linux"
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 proc_stat()
24 path=$1
25 ncpu=$2
27 echo cpu 0 0 0 0 0 0 0 0 0 > $path
28 cpu=0
29 while [ $cpu -lt $ncpu ]
31 echo cpu$cpu 0 0 0 0 0 0 0 0 0 >> $path
32 cpu=`expr $cpu + 1`
33 done
36 # real QA test starts here
37 root=$tmp.root
38 export LINUX_STATSPATH=$root
39 pmda=$PCP_PMDAS_DIR/linux/pmda_linux.so,linux_init
40 files=`echo $here/linux/interrupts-* | LC_COLLATE=POSIX sort`
42 for file in $files
44 rm -fr $root
45 mkdir -p $root/proc || _fail "root in use when processing $file"
47 cp $file $root/proc/interrupts
48 base=`basename $file`
49 ncpu=`echo $base | sed -e 's/.*-\([0-9][0-9]*\)cpu-.*/\1/'`
50 proc_stat $root/proc/stat $ncpu
51 export LINUX_NCPUS=$ncpu
53 echo "== Checking interrupts metrics from $base ($ncpu CPU)"
54 pminfo -f -L -K clear -K add,60,$pmda kernel.percpu.interrupts
55 echo && echo "== done" && echo
56 echo "== Checking interrupts helptext from $base ($ncpu CPU)"
57 pminfo -tT -L -K clear -K add,60,$pmda kernel.percpu.interrupts
58 echo && echo "== done" && echo
59 cd $here
60 done
62 # success, all done
63 status=0
64 exit