summaryrefslogtreecommitdiff
path: root/qa/842
diff options
context:
space:
mode:
Diffstat (limited to 'qa/842')
-rwxr-xr-xqa/84252
1 files changed, 52 insertions, 0 deletions
diff --git a/qa/842 b/qa/842
new file mode 100755
index 0000000..5877d61
--- /dev/null
+++ b/qa/842
@@ -0,0 +1,52 @@
+#!/bin/sh
+# PCP QA Test No. 842
+# Exercise basic pmiostat(1) invocations using an archive.
+#
+# 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
+
+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
+
+# real QA test starts here
+echo 'All devices'
+pmiostat -z --samples 5 --archive archives/dm-io
+echo
+
+echo 'DM devices'
+pmiostat -z --samples 3 --archive archives/dm-io -x dm
+echo
+
+echo 'Timestamps and no headers'
+pmiostat -z --samples 10 --archive archives/dm-io -x t,h
+echo
+
+for t in $(seq 1 30)
+do
+ for metric_field in read_merge:7 write_merge:8 read:9 write:10 read_bytes:11 write_bytes:12
+ do
+ metric=$(echo $metric_field | sed -e 's/:.*$//')
+ field=$(echo $metric_field | sed -e 's/^.*://')
+
+ echo -n Checking pmiostat against pmval -t $t disk.dev.$metric ...
+ pmval -t $t -a archives/dm-io -f 1 disk.dev.$metric'[sda]' 2>/dev/null |\
+ sed -e 's/\.[0-9]*//' | awk '/^[0-9][0-9]:/ {print $1, $2}' >$tmp.pmval
+ pmiostat -t $t -a archives/dm-io -xt,h |\
+ awk '/^#/ {skip} /sda/ {print $4, $'$field'}' >$tmp.pmiostat
+ if diff -q $tmp.pmval $tmp.pmiostat; then echo OK; else echo FAILED; fi
+ done
+done
+
+
+# success, all done
+status=0
+exit