summaryrefslogtreecommitdiff
path: root/qa/360
blob: c710088cc0527552b34033e204916dd69bf5d6a1 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
# PCP QA Test No. 360
# Remote host tests split off from 055
#
# 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

./getpmcdhosts -L -v 'pcp>=2' -n 2 -a sample 2>$tmp.err \
| sed >$tmp.config \
    -e 's/^/ /' \
    -e "s/ \([^ ][^ ]*\)/ :'\1'/g" \
    -e 's/^ /hosts = "/' \
    -e 's/$/";/'
[ -s $tmp.err ] && _notrun `cat $tmp.err`

# here are the exercises
cat >>$tmp.config << \EOF
delta = 2 sec;

// host domain exercises
host_fetch   = sample.long.ten $hosts;
host_neg     = -sample.long.ten $hosts;
host_sum     = sum_host sample.long.ten $hosts;
host_avg     = avg_host sample.long.ten $hosts;
host_max     = max_host sample.long.ten $hosts;
host_min     = min_host sample.long.ten $hosts;
host_count   = count_host sample.long.ten $hosts >= 10;
host_add1    = sample.long.ten $hosts + sample.long.ten $hosts;
host_add2    = sample.long.ten $hosts + 1;
host_add3    = 1 + sample.long.ten $hosts;
host_gt1     = sample.long.ten $hosts + 1 > sample.long.ten $hosts;
host_gt2     = sample.long.ten $hosts > 11;

// multiple domains
multi3       = max_sample sum_host avg_inst sample.bin $hosts @0..2;
multi4       = sum_host max_sample avg_inst sample.bin $hosts @0..2;
multi5       = avg_host min_sample count_inst sample.bin $hosts @0..2 > 400;

EOF

cat $tmp.config >>$seq.full

# real QA test starts here
pmie -T 10 -v $tmp.config >$tmp.out 2>$tmp.err
( echo; echo "=== err ==="; cat $tmp.err ) >>$seq.full
cat $tmp.err | _show_pmie_exit
( echo; echo "=== out ==="; cat $tmp.out ) >>$seq.full
cat $tmp.out | LC_COLLATE=POSIX sort

# success, all done
exit