qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 735
blobc9f4d386de3dfbaa606f97c1d87adcb3169806d0
1 #!/bin/sh
2 # PCP QA Test No. 735
3 # Exercise the Linux kernel proc.psinfo.cgroup metric
5 # Copyright (c) 2013 Red Hat. All Rights Reserved.
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 pid=$$
18 test $PCP_VER -ge 30805 || _notrun "No support for new proc cgroup metric"
19 test $PCP_PLATFORM = linux || _notrun "Test unsupported on $PCP_PLATFORM"
20 test -f /proc/$pid/cgroup || _notrun "No per-process support for cgroups"
22 status=1 # failure is the default!
23 $sudo rm -rf $tmp.* $seq.full
24 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
26 # real QA test starts here
27 $sudo rm -f $seq.full
28 syscgroups=`cat /proc/$pid/cgroup \
29 | sed -e 's/^[0-9][0-9]*://' \
30 | tr '\n' ';' \
31 | sed -e 's/;$/\n/'`
32 echo "SYS cgroup list for process $pid is: $syscgroups" >> $seq.full
34 pminfo -f proc.psinfo.cgroups > $tmp.cgroups
35 pcpcgroups=`grep "^ inst \[$pid or " $tmp.cgroups \
36 | $PCP_AWK_PROG '{ print $NF }' \
37 | sed -e 's/^"//' -e 's/"$//'`
38 echo "PCP cgroup list for process $pid is: $pcpcgroups" >> $seq.full
39 echo "Extracted from pminfo:" >> $seq.full
40 cat $tmp.cgroups >> $seq.full
42 if [ "$pcpcgroups" = "$syscgroups" ]
43 then
44 echo "Control group list for current process checks out"
45 status=0
46 else
47 echo "Mismatch on control group list:"
48 echo "PCP cgroups: $pcpcgroups"
49 echo "SYS cgroups: $syscgroups"
50 status=1
53 exit