summaryrefslogtreecommitdiff
path: root/qa/160
diff options
context:
space:
mode:
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