3 # pmcd long line handling error
4 # #754795 - pmcd botches handling of long lines in pmcd.conf
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 [ -d $PCP_PMDAS_DIR/trivial
] || _notrun
"trivial PMDA directory is not installed"
22 linux|darwin|solaris|freebsd
)
23 ln $seq.
$PCP_PLATFORM $seq.out ||
exit 1
26 _notrun
"Need qualified output for $PCP_PLATFORM"
30 signal
=$PCP_BINADM_DIR/pmsignal
31 status
=1 # failure is the default!
33 install_on_cleanup
=false
34 pminfo trivial
>/dev
/null
2>&1 && install_on_cleanup
=true
36 trap "_cleanup; exit \$status" 0 1 2 3 15
40 ( cd $PCP_PMDAS_DIR/trivial
; $sudo $PCP_MAKE_PROG >/dev
/null
2>&1 )
41 if $install_on_cleanup
43 ( cd $PCP_PMDAS_DIR/trivial
; $sudo .
/Install
</dev
/null
>/dev
/null
2>&1 )
45 ( cd $PCP_PMDAS_DIR/trivial
; $sudo .
/Remove
>/dev
/null
2>&1 )
47 if [ -f $PCP_PMCDCONF_PATH.
$seq ]
50 _restore_config
$PCP_PMCDCONF_PATH
51 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
54 $sudo $signal -a -s HUP pmcd
57 if [ -d $PCP_LOG_DIR/pmcd
]
59 $sudo rm -f $PCP_LOG_DIR/pmcd
/this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-
*-bytes*
61 $sudo rm -f $PCP_LOG_DIR/this-is-not-a-filename-but-is-arbitrary-filler-to-make-the-lines-longer-than-
*-bytes*
66 PMCDLOG
=$PCP_LOG_DIR/pmcd
/pmcd.log
68 case "$PCP_PLATFORM" in
71 cat >> $tmp.conf
<< EOF
72 # temporary pmcd.conf for qa/$seq
73 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
74 linux 60 dso linux_init $PCP_PMDAS_DIR/linux/pmda_linux.so
79 cat >> $tmp.conf
<< EOF
80 # temporary pmcd.conf for qa/$seq
81 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.dylib
82 darwin 78 dso darwin_init $PCP_PMDAS_DIR/darwin/pmda_darwin.dylib
87 cat >> $tmp.conf
<< EOF
88 # temporary pmcd.conf for qa/$seq
89 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
90 solaris 75 dso solaris_init $PCP_PMDAS_DIR/solaris/pmda_solaris.so
95 cat >> $tmp.conf
<< EOF
96 # temporary pmcd.conf for qa/$seq
97 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
98 freebsd 85 dso freebsd_init $PCP_PMDAS_DIR/freebsd/pmda_freebsd.so
103 echo "Arrgh ... need pmcd.conf for $PCP_PLATFORM"
107 _save_config
$PCP_PMCDCONF_PATH
108 $sudo cp $tmp.conf
$PCP_PMCDCONF_PATH
109 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
113 cd $PCP_PMDAS_DIR/trivial
114 $sudo .
/Install
</dev
/null
>/dev
/null
117 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
119 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
121 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
123 cp $tmp.conf
$tmp.conf
+trivial
124 grep '^trivial' $PCP_PMCDCONF_PATH >>$tmp.conf
+trivial
126 # real QA test starts here
130 echo "=== Cycle $i ==="
131 echo "add trivial PMDA ..."
132 $sudo cp $tmp.conf
+trivial
$PCP_PMCDCONF_PATH
133 $sudo touch $PCP_PMCDCONF_PATH
134 $sudo $signal -a -s HUP pmcd
137 pminfo
-f pmcd.agent.
type
138 echo "cull trivial PMDA ..."
139 $sudo cp $tmp.conf
$PCP_PMCDCONF_PATH
140 $sudo touch $PCP_PMCDCONF_PATH
141 $sudo $signal -a -s HUP pmcd
144 pminfo
-f pmcd.agent.
type
147 grep ridiculous
$PMCDLOG