Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 656
blob6f7a9e8952c19947c24915b18bdb8c061a450d94
1 #! /bin/sh
2 # PCP QA Test No. 656
3 # checks functionality of pmdacifs in both DSO and daemon mode with Valgrind
4 # memory testing.
6 # Copyright (c) 2014-2015 Red Hat, Inc. All Rights Reserved.
7 seq=`basename $0`
9 # get standard environment, filters and checks
10 . ./common.product
11 . ./common.filter
12 . ./common.check
14 _check_valgrind
15 echo "QA output created by $seq"
17 [ -f $PCP_PMDAS_DIR/cifs/pmdacifs ] || _notrun "cifs pmda not installed"
18 [ $PCP_PLATFORM = linux ] || _notrun "CIFS PMDA is Linux-specific (uses procfs)"
20 root=$tmp.root
21 export CIFS_STATSPATH=$root
23 # helper functions
25 _cleanup()
27 $sudo rm -fr $root
28 $sudo rm -fr $tmp.*.dir
29 $sudo rm -f $tmp.*
30 exit $status
33 iam=cifs
34 status=1 # failure is the default!
35 trap "_cleanup $iam" 0 1 2 3 15
37 $sudo rm -fr $root
38 $sudo rm -fr $tmp.*.dir
39 $sudo rm -f $tmp.* $seq.full
40 touch $here/$seq.full
42 # real QA test starts here
43 pmda=$PCP_PMDAS_DIR/cifs/pmda_cifs.so,cifs_init
44 pmns=$PCP_PMDAS_DIR/cifs/root
45 _make_helptext cifs
47 cd $here
49 echo
50 echo "=== Unpacking fake root === " | tee -a $here/$seq.full
51 $sudo rm -fr $root
52 mkdir $root || _fail "root in use when processing $tgz"
53 cd $root
54 tar xzf $here/cifs/cifs-root*
55 cd $here
57 echo
58 echo "=== Valgrind check cifs metrics for all filesystems ===" | tee -a $here/$seq.full
59 _run_valgrind pminfo -L -K clear -K add,121,$pmda -dfmtT -n $pmns cifs
61 status=0
62 exit