summaryrefslogtreecommitdiff
path: root/qa/1010
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
commit47e6e7c84f008a53061e661f31ae96629bc694ef (patch)
tree648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/1010
downloadpcp-debian.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/1010')
-rwxr-xr-xqa/101061
1 files changed, 61 insertions, 0 deletions
diff --git a/qa/1010 b/qa/1010
new file mode 100755
index 0000000..156f871
--- /dev/null
+++ b/qa/1010
@@ -0,0 +1,61 @@
+#!/bin/sh
+# PCP QA Test No. 1010
+# Test pmdumptext output formats
+#
+seq=`basename $0`
+echo "QA output created by $seq"
+. ./common.qt
+
+which pmdumptext >/dev/null 2>&1 || _notrun "pmdumptext not installed"
+
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+_filter()
+{
+ $PCP_AWK_PROG '
+BEGIN { state = 0 }
+$1 == "General" { print; print "...:"; state = 1; next }
+$1 == "Reporting" { print; print "...:"; state = 1; next }
+state == 1 && NF == 0 { state = 0 }
+state == 1 { next }
+ { print }' \
+ | sed "s/^[A-Za-z]* [A-Za-z]* [ 0-3][0-9] [ 0-2][0-9]:[0-5][0-9]:[0-5][0-9]/VERY_VERY_LONG_TIME/" \
+ | sed "s/^[ 0-2][0-9]:[0-5][0-9]:[0-5][0-9]/SHRTTIME/"
+}
+
+# real QA test starts here
+
+cat << end-of-file > $tmp.log_conf
+log mandatory on 1 second {
+ sample.hordes.one
+ sample.double
+}
+end-of-file
+pmlogger -c $tmp.log_conf -s 5s $tmp.log
+offset=`_arch_start $tmp.log 0`
+
+cat << end-of-file > $tmp.conf
+sample.hordes.one["3"]
+sample.double.ten
+sample.double.hundred
+sample.double.million
+sample.double.ten 0.5
+sample.double.hundred -0.0033
+sample.double.million 0.000056
+end-of-file
+
+for i in '' '-i' '-i -w 10'
+do
+ for f in '' '-M' '-F' '-G' '-f %H:%M:%S'
+ do
+ echo
+ echo "pmdumptext $i $f -umN"
+ pmdumptext -O $offset $i $f -d' ' -umN -t 1 -s 3 -c $tmp.conf -a $tmp.log 2>&1 \
+ | _filter
+ done
+done
+
+# success, all done
+status=0
+exit