summaryrefslogtreecommitdiff
path: root/qa/985
diff options
context:
space:
mode:
Diffstat (limited to 'qa/985')
-rwxr-xr-xqa/98592
1 files changed, 92 insertions, 0 deletions
diff --git a/qa/985 b/qa/985
new file mode 100755
index 0000000..3106a3c
--- /dev/null
+++ b/qa/985
@@ -0,0 +1,92 @@
+#!/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 <<EOF
+#!/bin/sh
+echo dmcache1: 0 52428800 cache 8 289/837632 512 71/117856 576 35 329 0 0 71 0 1 writeback 2 migration_threshold 2048 mq 10 random_threshold 4 sequential_threshold 512 discard_promote_adjustment 1 read_promote_adjustment 4 write_promote_adjustment 8
+echo dmcache2: 0 52606976 cache 8 289/837632 512 71/117856 484 32 330 0 0 71 0 1 writethrough 2 migration_threshold 2048 mq 10 random_threshold 4 sequential_threshold 512 discard_promote_adjustment 1 read_promote_adjustment 4 write_promote_adjustment 8
+EOF
+chmod 755 $tmp.dmcache.sh
+
+domain=129
+export DM_STATUS=$tmp.dmcache.sh
+
+# real QA test starts here
+echo "== Finding dmcache metrics" | tee -a $seq.full
+PCP_PYTHON_PMNS=root python "$pmda_script" 2>/dev/null > $tmp.root
+
+echo "== Testing dmcache metrics" | tee -a $seq.full
+$sudo dbpmda -n $tmp.root -ie <<End-of-File 2>&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