summaryrefslogtreecommitdiff
path: root/qa/160
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/160
downloadpcp-47e6e7c84f008a53061e661f31ae96629bc694ef.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/160')
-rwxr-xr-xqa/16057
1 files changed, 57 insertions, 0 deletions
diff --git a/qa/160 b/qa/160
new file mode 100755
index 0000000..d6f6f80
--- /dev/null
+++ b/qa/160
@@ -0,0 +1,57 @@
+#! /bin/sh
+# PCP QA Test No. 160
+# Exercise __pmSetClientId()
+#
+# Copyright (c) 2009 Ken McDonell. All Rights Reserved.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+status=0 # success is the default!
+$sudo rm -rf $tmp.*
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+rm -f $seq.full
+
+_filter()
+{
+ egrep 'QA-clientid|Error|__pmSetClientId' \
+ | sed -e 's/value ".* QA/value "<host> QA/' \
+ | sed -e 's/\[/[ /' -e 's/]/ ]/' \
+ | awk '
+BEGIN { seq = 1 }
+$1 == "inst" { if (seen[$3] == "") {
+ seen[$3] = "INST-" seq++
+ }
+ $5 = "\"" seen[$3] "\""
+ $3 = seen[$3]
+ }
+ { print }' \
+ | LC_COLLATE=POSIX sort -u
+}
+
+# real QA test starts here
+src/clientid -l a bb ccc dddd eeeee ffffff ggggggg hhhhhhhh iiiiiiiii >$tmp.1 2>$tmp.2 &
+pidlist="$pidlist $!"
+sleep 2
+src/clientid -l foo-bar-mumble >$tmp.3 2>$tmp.4 &
+pidlist="$pidlist $!"
+sleep 2
+src/clientid -l "here is a longer string to go in the ident place holder to try things out that are not quite so short and boring" >$tmp.5 2>$tmp.6 &
+pidlist="$pidlist $!"
+sleep 2
+
+kill -TERM $pidlist
+wait
+
+cat $tmp.? \
+| tee $seq.full \
+| _filter
+
+# success, all done
+exit