Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / qa / 285
blob194e643e6fa1a0fb197128a2b862a9b12121a457
1 #! /bin/sh
2 # PCP QA Test No. 285
4 # Plan:
5 # 1. to show that the indom result for instance requests for
6 # pmLookupInDom and pmNameInDom calls should NOT be different
7 # for DSOs versus daemon agents.
8 # 2. to verify that opening a dso and then connecting to a daemon
9 # is viable.
10 # Note: qa/147 tests out doing a daemon and then a dso
12 # Method:
13 # 1. use dbpmda with the sampledso and sample daemon with appropriate
14 # instance requests
16 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
19 seq=`basename $0`
20 echo "QA output created by $seq"
22 # get standard filters
23 . ./common.product
24 . ./common.filter
25 . ./common.check
27 sampledso=$PCP_PMDAS_DIR/sample/pmda_sample.$DSO_SUFFIX
29 status=1 # failure is the default!
30 username=`id -u -n`
31 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
33 _filter()
35 sed \
36 -e '/^dbpmda> $/d' \
37 -e "s/ -U $username//g" \
38 -e "s;$sampledso;SAMPLEDSO;g" \
39 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;g"
42 pipeargs=""
43 id pcp >/dev/null 2>&1 && pipeargs="-U $username"
45 # real QA test starts here
47 # part 1.
49 echo "=== dso and daemon handle indom ops the same way? ==="
50 echo
51 dbpmda -ie <<EOF 2>&1 | _filter | tee $tmp.dso
52 open dso $sampledso sample_init 30
53 instance 30.1
54 instance 30.1 0
55 instance 30.1 "red"
56 EOF
58 echo
59 dbpmda -ie <<EOF 2>&1 | _filter | tee $tmp.daemon
60 open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs -d 30
61 instance 30.1
62 instance 30.1 0
63 instance 30.1 "red"
64 EOF
66 echo
67 echo "Differences ... expect none after the \"open\" processing"
68 diff $tmp.dso $tmp.daemon
70 # part 2.
72 echo
73 echo "=== IPC-PDU version botch for second PMDA? ==="
74 dbpmda -ie <<EOF 2>&1 | _filter
75 open dso $sampledso sample_init 30
76 open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs -d 29
77 EOF
79 # success, all done
80 status=0
81 exit