File: 628

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (146 lines) | stat: -rwxr-xr-x 3,472 bytes parent folder | download
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#! /bin/sh
# PCP QA Test No. 628
# libpcp_pmda botch in pmdaFetch for multiple DSO PMDAs used in the
# on pmFetch ... bug #809111
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

[ -d $PCP_PMDAS_DIR/simple ] || _notrun "simple PMDA directory is not installed"

status=1	# failure is the default!

_cleanup()
{
    cd $here

    [ -f $tmp.root ] && $sudo cp $tmp.root $PCP_VAR_DIR/pmns/root
    $sudo rm -f $PCP_VAR_DIR/pmns/idiot
    [ -f $tmp.root.bin ] && $sudo cp $tmp.root.bin $PCP_VAR_DIR/pmns/root.bin
    [ -f $tmp.pmcd.conf ] && $sudo cp $tmp.pmcd.conf $PCP_PMCDCONF_PATH
    _service pmcd restart 2>&1 | _filter_pcp_restart
    _wait_for_pmcd
    _service pmlogger restart 2>&1 | _filter_pcp_restart
    _wait_for_pmlogger
    $sudo rm -rf $tmp.* $PCP_PMDAS_DIR/idiot
    exit $status
}

trap "_cleanup" 0 1 2 3 15

home=$PCP_PMDAS_DIR
cd $home/simple

# restart pmcd and copy the pmcd config file and pmns to restore state later
#
if ! _service pmcd restart 2>&1; then _exit 1; fi \
| _filter_pcp_restart
_wait_for_pmcd || _exit 1
if ! _service pmlogger restart 2>&1; then _exit 1; fi \
| _filter_pcp_restart
_wait_for_pmlogger || _exit 1
cp $PCP_PMCDCONF_PATH $tmp.pmcd.conf
cp $PCP_VAR_DIR/pmns/root $tmp.root
[ -f $PCP_VAR_DIR/pmns/root.bin ] && cp $PCP_VAR_DIR/pmns/root.bin $tmp.root.bin

if $sudo $PCP_MAKE_PROG clobber >$tmp.out 2>&1
then
    :
else
    cat $tmp.out
    echo "Arrgh, make clobber failed"
    exit
fi

$sudo rm -rf $PCP_PMDAS_DIR/idiot
$sudo mkdir $PCP_PMDAS_DIR/idiot
$sudo chmod 777 $PCP_PMDAS_DIR/idiot
cp * $PCP_PMDAS_DIR/idiot

$sudo ./Remove >/dev/null 2>&1
cat <<End-of-File | $sudo ./Install >$tmp.out 2>&1
dso
End-of-File

echo "=== simple install ===" >>$seq_full
cat $tmp.out >>$seq_full

if pminfo -v simple
then
    :
else
    echo "simple DSO install failed! ... here is the Install log ..."
    cat $tmp.out
fi

cd $PCP_PMDAS_DIR/idiot
mv simple.c idiot.c
mv simple.conf idiot.conf
for suffix in pl py perl python
do
    [ -f pmdasimple.$suffix ] && mv pmdasimple.$suffix pmdaidiot.$suffix
done

for file in *
do
    sed <$file >$tmp.tmp \
	-e '/simple/s//idiot/g' \
	-e '/SIMPLE/s//IDIOT/g' \
	-e '/253/s//177/g'
    chmod u+w $file
    cp $tmp.tmp $file
done
for file in pmns help
do
    sed <$file >$tmp.tmp -e '/IDIOT/s//177/g'
    cp $tmp.tmp $file
done

$sudo ./Remove >/dev/null 2>&1
cat <<End-of-File | $sudo ./Install >$tmp.out 2>&1
dso
End-of-File

echo "=== idiot install ===" >>$seq_full
cat $tmp.out >>$seq_full

if pminfo -v idiot
then
    :
else
    echo "idiot DSO install failed! ... here is the Install log ..."
    cat $tmp.out
fi


# real QA test starts here
pminfo -fm simple.numfetch | tee $tmp.check

if grep 'No value' $tmp.check >/dev/null 2>&1
then
    echo "Bad pminfo trap (No values for simple.numfetch)"
    # enable this trap to debug the infamous e_ext_t bug
    #
    #debug# if [ -e /dev/tty ]; then echo "Continue?"; read ans </dev/tty; fi
fi

echo "=== pmcd log after first pminfo simple ===" >>$seq_full
cat $PCP_LOG_DIR/pmcd/pmcd.log >>$seq_full
pminfo -fm idiot.numfetch
pminfo -fm idiot.numfetch
pminfo -fm idiot.numfetch
pminfo -fm simple.numfetch idiot.numfetch
echo "=== pmcd log after last pminfo simple ===" >>$seq_full
cat $PCP_LOG_DIR/pmcd/pmcd.log >>$seq_full

# success, all done
status=0
exit