summaryrefslogtreecommitdiff
path: root/qa/285
blob: 1e66a43d0fd7f371eecd3b54fdda269ed801ad5e (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#! /bin/sh
# PCP QA Test No. 285
#
# Plan:
# 1. to show that the indom result for instance requests for
#    pmLookupInDom and pmNameInDom calls should NOT be different 
#    for DSOs versus daemon agents. 
# 2. to verify that opening a dso and then connecting to a daemon
#    is viable.
#    Note: qa/147 tests out doing a daemon and then a dso
#
# Method:
# 1. use dbpmda with the sampledso and sample daemon with appropriate
#    instance requests
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard filters
. ./common.product
. ./common.filter
. ./common.check
. ./localconfig

if [ $PCP_PLATFORM = irix ]
then
   BINFMT=`/usr/pcp/bin/pmobjstyle`
   sampledso=/var/pcp/lib/$BINFMT.pmda_sample.so
else
   sampledso=$PCP_PMDAS_DIR/sample/pmda_sample.$DSO_SUFFIX
fi

status=1	# failure is the default!
username=`id -u -n`
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

_filter()
{
    sed \
	-e '/^dbpmda> $/d' \
	-e "s/ -U $username//g" \
        -e "s;$sampledso;SAMPLEDSO;g" \
	-e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;g"
}

pipeargs=""
id pcp >/dev/null 2>&1 && pipeargs="-U $username"

# real QA test starts here

# part 1.
#
echo "=== dso and daemon handle indom ops the same way? ==="
echo
dbpmda -ie <<EOF 2>&1 | _filter | tee $tmp.dso
open dso $sampledso sample_init 30
instance 30.1
instance 30.1 0
instance 30.1 "red"
EOF

echo
dbpmda -ie <<EOF 2>&1 | _filter | tee $tmp.daemon
open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs -d 30
instance 30.1
instance 30.1 0
instance 30.1 "red"
EOF

echo
echo "Differences ... expect none after the \"open\" processing"
diff $tmp.dso $tmp.daemon

# part 2.
#
echo
echo "=== IPC-PDU version botch for second PMDA? ==="
dbpmda -ie <<EOF 2>&1 | _filter
open dso $sampledso sample_init 30
open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs -d 29
EOF

# success, all done
status=0
exit