qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 160
blob9009887d99000129e78f583c93013b6cd83574d8
1 #! /bin/sh
2 # PCP QA Test No. 160
3 # Exercise __pmSetClientId()
5 # Copyright (c) 2009 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=0 # success is the default!
17 $sudo rm -rf $tmp.*
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19 rm -f $seq.full
21 _filter()
23 egrep 'QA-clientid|Error|__pmSetClientId' \
24 | sed -e 's/value ".* QA/value "<host> QA/' \
25 | sed -e 's/\[/[ /' -e 's/]/ ]/' \
26 | awk '
27 BEGIN { seq = 1 }
28 $1 == "inst" { if (seen[$3] == "") {
29 seen[$3] = "INST-" seq++
31 $5 = "\"" seen[$3] "\""
32 $3 = seen[$3]
34 { print }' \
35 | LC_COLLATE=POSIX sort -u
38 # real QA test starts here
39 src/clientid -l a bb ccc dddd eeeee ffffff ggggggg hhhhhhhh iiiiiiiii >$tmp.1.out 2>$tmp.1.err &
40 pidlist="$pidlist $!"
41 sleep 2
42 src/clientid -l foo-bar-mumble >$tmp.2.out 2>$tmp.2.err &
43 pidlist="$pidlist $!"
44 sleep 2
45 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.3.out 2>$tmp.3.err &
46 pidlist="$pidlist $!"
47 sleep 2
49 for file in $tmp.?.*
51 echo >>$seq.full
52 echo "=== $file ===" >>$seq.full
53 cat $file \
54 | tee -a $seq.full
55 done \
56 | _filter
58 exec >/dev/null 2>&1
59 kill -HUP $pidlist
60 wait
62 # success, all done
63 exit