pmrep: fix archive end time reporting
[pcp.git] / qa / 257
blob1544bbd962de223e574e58c7a1c520df1793b130
1 #! /bin/sh
2 # PCP QA Test No. 257
3 # Tests out the api (uses torture_api)
4 # when connecting to different hosts.
5 # Initial motivation was to test the distributed PMNS.
6 # This test is modelled on #112 and compares with 031.out
8 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
11 seq=`basename $0`
12 echo "QA output created by $seq"
14 # get standard filters
15 . ./common.product
16 . ./common.check
17 . ./common.filter
19 status=1 # failure is the default!
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 _filter()
24 os=$1
25 echo "--- os = $os, version = 2 ---" >>$seq.full
26 cat - > $tmp.1
28 echo "--- unfiltered output ---" >>$seq.full
29 cat $tmp.1 >> $seq.full
31 _filter_torture_api <$tmp.1
34 _cmp()
36 echo "differences relative to 031.out ..."
38 diff 031.out.${PCP_PLATFORM} $1
41 _do_tests()
43 style=$1
45 case $style
47 -s1)
48 style_str="--- style $style (local PMNS)"
50 -s2)
51 style_str="--- style $style (distributed PMNS)"
53 esac
55 echo ""
56 echo "=== pmapi 32 v2, local version $style_str ===" | tee -a $seq.full
57 torture_api="src/torture_api"
58 echo "torture_api = $torture_api" >> $seq.full
59 $torture_api -v $style 2>&1 | _filter `uname -r` >$tmp.out
60 _cmp $tmp.out
62 echo ""
63 echo "=== pmapi 32 v2, pmcd 32 v2 $style_str ===" | tee -a $seq.full
64 torture_api="src/torture_api"
65 echo "torture_api = $torture_api" >> $seq.full
66 $torture_api -v $style -h $host_32_v2 2>&1 | _filter $host_32_v2_os >$tmp.out
67 _cmp $tmp.out
69 echo ""
70 echo "=== pmapi 32 v2, pmcd 64 v2 $style_str ===" | tee -a $seq.full
71 torture_api="src/torture_api"
72 echo "torture_api = $torture_api" >> $seq.full
73 $torture_api -v $style -h $host_64_v2 2>&1 | _filter $host_64_v2_os >$tmp.out
74 _cmp $tmp.out
78 # real QA test starts here
79 rm -f $tmp.*
80 rm -f $seq.full
82 # try against variously configured hosts
84 # Need PCP_PLATFORM b/c the torture_api output is different
85 # on different platforms at the moment.
86 # => different metrics and the same metrics have different pmids
88 host_32_v2=`./getpmcdhosts -s $PCP_PLATFORM -b 32 -m "pmcd.version>2.0" -n 1 -a sample 2>&1`
89 if [ $? -eq 1 ]; then
90 echo "$host_32_v2" >$seq.notrun
91 echo "$seq: [not run] `cat $seq.notrun`"
92 exit
94 echo "host_32_v2 = $host_32_v2" >> $seq.full
95 host_32_v2_os=`ssh -q pcpqa@$host_32_v2 uname -r`
97 host_64_v2=`./getpmcdhosts -s $PCP_PLATFORM -b 64 -m "pmcd.version>2.0" -n 1 -a sample 2>&1`
98 if [ $? -eq 1 ]; then
99 echo "$host_64_v2" >$seq.notrun
100 echo "$seq: [not run] `cat $seq.notrun`"
101 exit
103 echo "host_64_v2 = $host_64_v2" >> $seq.full
104 host_64_v2_os=`ssh -q pcpqa@$host_64_v2 uname -r`
106 # make sure it's got the metrics we want for torture_api
107 _check_metric sample.seconds $hosts_32_v2
108 _check_metric sampledso.sysinfo $hosts_32_v2
109 _check_metric sample.seconds $hosts_64_v2
110 _check_metric sampledso.sysinfo $hosts_64_v2
112 # uses libpcp2 and local PMNS
113 _do_tests -s1
115 # uses libpcp2 and possibly distributed PMNS
116 _do_tests -s2
118 status=0