Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 168
blob6f4d97bb5b18adc00965e152a25cb838cead4a84
1 #! /bin/sh
2 # PCP QA Test No. 168
3 # pmlogmerge shall abort if descriptors non consistent across archives
4 # pv 933456
6 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 _cleanup()
19 $sudo $PCP_RC_DIR/pcp restart >/dev/null 2>&1
20 _wait_for_pmcd
21 _wait_for_pmlogger
22 rm -f $tmp.*
25 status=0 # success is the default!
26 $sudo rm -rf $tmp.*
27 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # force sample PMDA back to a sane state
30 _reset()
32 $sudo $PCP_RC_DIR/pmcd restart >/dev/null 2>&1
33 _wait_for_pmcd
36 _filter()
38 sed -e "s;$tmp;TMP;g"
41 # create second archive and try to merge 'em
42 _doit()
44 rm -f $tmp.new.* $tmp.out
45 echo "log mandatory on 1sec { sample.dynamic.meta }" \
46 | pmlogger -l $tmp.log -s 3 $tmp.new
47 _reset
48 pmlogextract $tmp.base $tmp.new $tmp.out 2>&1 \
49 | _filter
50 if [ -f $tmp.out.0 ]
51 then
52 echo "Oops ... should not have created an output archive!"
53 echo
54 echo "=== Original metadata ==="
55 pminfo -d -a $tmp.base sample.dynamic.meta.metric
56 echo
57 echo "=== New metadata ==="
58 pminfo -d -a $tmp.new sample.dynamic.meta.metric
59 echo
60 echo "=== Merged metadata ==="
61 pminfo -d -a $tmp.out sample.dynamic.meta.metric
62 echo
63 echo "=== Dump of output archive ==="
64 pmdumplog -a $tmp.out
68 _reset
70 echo "Check initial metric set up ..."
71 pminfo -f sample.dynamic.meta
73 echo "log mandatory on 1sec { sample.dynamic.meta }" \
74 | pmlogger -l $tmp.log -s 3 $tmp.base
76 # real QA test starts here
78 echo "Change metric type ..."
79 pmstore sample.dynamic.meta.pmdesc.type 3
80 _doit
82 echo "Change metric indom ..."
83 pmstore sample.dynamic.meta.pmdesc.indom 42
84 _doit
86 echo "Change metric semantics ..."
87 pmstore sample.dynamic.meta.pmdesc.sem 0
88 _doit
90 echo "Change metric units ..."
91 pmstore sample.dynamic.meta.pmdesc.units 0
92 _doit
94 # success, all done
95 exit