summaryrefslogtreecommitdiff
path: root/qa/358
blob: e7340eee5df42d0d0c7f060d511987e69e7f7809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# PCP QA Test No. 358
#
# pmie fails for metric with instance domain containing one instance
# ... also some string constant exercises for embedded escapes
#
# Copyright (c) 2010 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.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

cat >$tmp.pmie <<'End-of-File'
some_inst ( match_inst "d" sample.dodgey.value > 0) -> print "short match ..." " [%i] %v";
some_inst ( match_inst "^d[12345]\$" sample.dodgey.value > 0) -> print "long match ..." " [%i] %v" "\t\"\\\$\\\" A\BC\(\)[]\78\9";
End-of-File

_filter()
{
    tee -a $seq.full \
    | sed -e 's/.* Info: evaluator exiting/pmie: note - evaluator exiting/g' \
	-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z]  *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]/DATE/' \
	-e 's/ [0-9][0-9]*/ NN/g' \
    | LC_COLLATE=POSIX sort \
    | uniq
}

# real QA test starts here
# for i in 5 2 1
for i in 1 2 5
do
    echo "=== $i values for sample.dodgey.value ==="
    pmstore sample.dodgey.control $i >/dev/null
    pminfo -f sample.dodgey.value >>$seq.full
    pmie -t 0.5 -T 2.3 <$tmp.pmie 2>&1 | _filter
done

pmstore sample.dodgey.control 5 >/dev/null

# success, all done
exit