3 # Exercising the Linux cgroups metrics
5 # Copyright (c) 2014 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ $PCP_PLATFORM = linux
] || _notrun
"cgroups test, only works with Linux"
18 status
=1 # failure is the default!
19 $sudo rm -rf $tmp.
* $seq.full
20 trap "cd $here; $sudo rm -rf $tmp.*; exit \$status" 0 1 2 3 15
25 grep -v 'inst \[' $tmp.out
26 sed -n -e 's/inst \[[0-9][0-9]*/inst [N/p' $tmp.out \
27 | LC_COLLATE
=POSIX
sort
30 # real QA test starts here
33 export PROC_STATSPATH
=$root
34 pmda
=$PCP_PMDAS_DIR/proc
/pmda_proc.so
,proc_init
35 trees
=`pminfo cgroup | awk -F. '{ print $2 }' | sort -u`
37 for tgz
in $here/linux
/cgroups-
*.tgz
41 mkdir
$root || _fail
"root in use when processing $tgz"
47 echo "== Checking namespace and metric numbering - $base"
48 pminfo
-L -K clear -K add
,3,$pmda cgroup \
49 | LC_COLLATE
=POSIX
sort \
51 echo "== Checking metric descriptors and values - $base"
52 for metric
in `cat $tmp.names`
54 pminfo
-L -K clear -K add
,3,$pmda -d -f $metric | _filter
56 echo "== Checking on an individual metric fetch - $base"
57 pminfo
-L -K clear -K add
,3,$pmda -f cgroup.blkio.dev.
time | _filter
59 # takes too long to verify everything, so check just first
60 echo $base |
grep -q 001 ||
continue
64 name
=`pminfo cgroup.$tree | sed 1q`
65 echo "== Checking out multi-sample monitor tool - $base"
66 pmval
-L -K clear -K add
,3,$pmda -s 2048 -t 0.00001 $name >/dev
/null
67 echo "checked cgroup tree $tree via metric $metric" >> $seq.full
70 echo && echo "== done" && echo