blob: 44586905c7a5ea1b424b3a57bb37b69ad338d225 (
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
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
147
148
149
150
151
|
#! /bin/sh
# PCP QA Test No. 587
# pmcd long line handling error
# #754795 - pmcd botches handling of long lines in pmcd.conf
#
# 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
rm -f $seq.out
case $PCP_PLATFORM
in
irix|linux|darwin|solaris)
ln $seq.$PCP_PLATFORM $seq.out || exit 1
;;
*)
_notrun "Need qualified output for $PCP_PLATFORM"
;;
esac
signal=$PCP_BINADM_DIR/pmsignal
status=1 # failure is the default!
install_on_cleanup=false
pminfo trivial >/dev/null 2>&1 && install_on_cleanup=true
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
( cd $PCP_PMDAS_DIR/trivial ; $sudo make >/dev/null 2>&1 )
if $install_on_cleanup
then
( cd $PCP_PMDAS_DIR/trivial; $sudo ./Install </dev/null >/dev/null 2>&1 )
else
( cd $PCP_PMDAS_DIR/trivial; $sudo ./Remove >/dev/null 2>&1 )
fi
if [ -f $PCP_PMCDCONF_PATH.$seq ]
then
echo
$sudo rm -f $PCP_PMCDCONF_PATH
$sudo mv $PCP_PMCDCONF_PATH.$seq $PCP_PMCDCONF_PATH
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
_wait_for_pmcd
else
$sudo $signal -a -s HUP pmcd
fi
rm -f $tmp.*
if [ -d $PCP_LOG_DIR/pmcd ]
then
$sudo rm -f $PCP_LOG_DIR/pmcd/this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-*-bytes*
else
$sudo rm -f $PCP_LOG_DIR/this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-*-bytes*
fi
}
# default case
PMCDLOG=$PCP_LOG_DIR/pmcd/pmcd.log
case "$PCP_PLATFORM" in
irix)
PMCDLOG=$PCP_LOG_DIR/pmcd.log
cat <<End-of-File >$tmp.conf
# temporary pmcd.conf for qa/$seq
irix 1 dso irix_init libirixpmda.so
pmcd 2 dso pmcd_init pmda_pmcd.so
proc 3 dso proc_init pmda_proc.so
End-of-File
;;
linux)
cat >> $tmp.conf << EOF
# temporary pmcd.conf for qa/$seq
pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
linux 60 dso linux_init $PCP_PMDAS_DIR/linux/pmda_linux.so
EOF
;;
darwin)
cat >> $tmp.conf << EOF
# temporary pmcd.conf for qa/$seq
pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.dylib
darwin 78 dso darwin_init $PCP_PMDAS_DIR/darwin/pmda_darwin.dylib
EOF
;;
solaris)
cat >> $tmp.conf << EOF
# temporary pmcd.conf for qa/$seq
pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
solaris 75 dso solaris_init $PCP_PMDAS_DIR/solaris/pmda_solaris.so
EOF
;;
*)
echo "Arrgh ... need pmcd.conf for $PCP_PLATFORM"
exit 1
esac
$sudo mv $PCP_PMCDCONF_PATH $PCP_PMCDCONF_PATH.$seq
$sudo cp $tmp.conf $PCP_PMCDCONF_PATH
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
_wait_for_pmcd
unset ROOT MAKEFLAGS
cd $PCP_PMDAS_DIR/trivial
$sudo ./Install </dev/null >/dev/null
cd $here
echo 'bogus 249 pipe binary '"$PCP_PMDAS_DIR/trivial/pmdatrivial"' -d 250 -l "this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-200-bytes-------------------------------------------------------------------"' >>$tmp.conf
echo 'fungus 248 pipe binary '"$PCP_PMDAS_DIR/trivial/pmdatrivial"' -d 250 -l "this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-400-bytes-------------------------------------------------------------------fungus 248 pipe binary '"$PCP_PMDAS_DIR/trivial/pmdatrivial"' -d 250 -l this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-500-bytes-------------------------------------------------------------------0123456768901234567689012345676890123456768901234567689012345676890123456768901234567689"' >>$tmp.conf
echo 'humus 247 pipe binary '"$PCP_PMDAS_DIR/trivial/pmdatrivial"' -d 250 -l "this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-2000-bytes------------------------------------------------------------------- 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"' >>$tmp.conf
cp $tmp.conf $tmp.conf+trivial
grep '^trivial' $PCP_PMCDCONF_PATH >>$tmp.conf+trivial
# real QA test starts here
for i in 1 2 3 4 5 6
do
echo
echo "=== Cycle $i ==="
echo "add trivial PMDA ..."
$sudo cp $tmp.conf+trivial $PCP_PMCDCONF_PATH
$sudo touch $PCP_PMCDCONF_PATH
$sudo $signal -a -s HUP pmcd
sleep 1
_wait_for_pmcd
pminfo -f pmcd.agent.type
echo "cull trivial PMDA ..."
$sudo cp $tmp.conf $PCP_PMCDCONF_PATH
$sudo touch $PCP_PMCDCONF_PATH
$sudo $signal -a -s HUP pmcd
sleep 1
_wait_for_pmcd
pminfo -f pmcd.agent.type
done
grep ridiculous $PMCDLOG
# success, all done
status=0
exit
|