#!/bin/sh # PCP QA Test No. 985 # Exercise the dmcache PMDA using dbpmda. # # Copyright (c) 2014 Red Hat. # seq=`basename $0` echo "QA output created by $seq" # get standard environment, filters and checks . ./common.product . ./common.filter . ./common.check pmda_path="$PCP_PMDAS_DIR/dmcache" pmda_script="$pmda_path/pmdadmcache.python" test -f "$pmda_script" || _notrun "pmdadmcache not supported" python -c "from pcp import pmda" >/dev/null 2>&1 [ $? -eq 0 ] || _notrun "python pcp pmda module not installed" status=1 # failure is the default! $sudo rm -rf $tmp.* $seq.full trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15 _filter() { tee -a $seq.full | \ sed \ -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \ -e '/pmResult/s/ .* numpmid/ ... numpmid/' \ -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \ test -f dmcache.log && cat dmcache.log >> $seq.full } # create sample output for the PMDA to consume cat > $tmp.dmcache.sh </dev/null > $tmp.root echo "== Testing dmcache metrics" | tee -a $seq.full $sudo dbpmda -n $tmp.root -ie <&1 | _filter open pipe /usr/bin/python $pmda_script getdesc on desc dmcache.size desc dmcache.metadata.block_size desc dmcache.metadata.used desc dmcache.metadata.total desc dmcache.cache.block_size desc dmcache.cache.used desc dmcache.cache.total desc dmcache.read_hits desc dmcache.read_misses desc dmcache.write_hits desc dmcache.write_misses desc dmcache.demotions desc dmcache.promotions desc dmcache.dirty desc dmcache.io_mode_code desc dmcache.io_mode fetch dmcache.size fetch dmcache.metadata.block_size fetch dmcache.metadata.used fetch dmcache.metadata.total fetch dmcache.cache.block_size fetch dmcache.cache.used fetch dmcache.cache.total fetch dmcache.read_hits fetch dmcache.read_misses fetch dmcache.write_hits fetch dmcache.write_misses fetch dmcache.demotions fetch dmcache.promotions fetch dmcache.dirty fetch dmcache.io_mode_code fetch dmcache.io_mode End-of-File # success, all done status=0 exit