3 # Check recovery actions when procedures in pmdaproc.sh fail to
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
17 status
=1 # failure is the default!
18 killer
=`pwd`/src
/killparent
34 echo "Restoring real \$PCP_PMCDCONF_PATH ..."
35 _restore_config
$PCP_PMCDCONF_PATH
36 $sudo rm -f $PCP_PMCDCONF_PATH.prev
38 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
51 /Save current/ { print ""; skip = 0 }
52 /Sorry, failed/ { print ""; skip = 0 }
54 /Here is the PMCD logfile/ { print "[logfile deleted]"; skip = 1; next }' \
56 -e "s;$PCP_PMCDCONF_PATH;\$PCP_PMCDCONF_PATH;g" \
61 if [ -d $PCP_LOG_DIR/pmlogger
]
63 LOGGING_DIR
=$PCP_LOG_DIR/pmlogger
65 LOGGING_DIR
=$PCP_LOG_DIR
68 _save_config
$PCP_PMCDCONF_PATH
70 pmafm
$LOGGING_DIR/$LOCALHOST/Latest remove
>$tmp.cmd
2>&1 \
74 trap "_interrupt; _cleanup" 1 2 3 15
76 # real QA test starts here
78 # get to a known starting state, esp for pmcd.log
80 if [ $PCP_PLATFORM = irix
]
82 cat <<End-of-File >$tmp.conf
83 # temporary pmcd.conf for qa/$seq
84 irix 1 dso irix_init libirixpmda.so
85 pmcd 2 dso pmcd_init pmda_pmcd.so
86 proc 3 dso proc_init pmda_proc.so
88 elif [ $PCP_PLATFORM = linux
]
90 cat <<End-of-File >$tmp.conf
91 # temporary pmcd.conf for qa/$seq
92 linux 60 dso linux_init $PCP_PMDAS_DIR/linux/pmda_linux.so
93 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
95 elif [ $PCP_PLATFORM = darwin
]
97 cat <<End-of-File >$tmp.conf
98 # temporary pmcd.conf for qa/$seq
99 darwin 78 dso darwin_init $PCP_PMDAS_DIR/darwin/pmda_darwin.dylib
100 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.dylib
102 elif [ $PCP_PLATFORM = solaris
]
104 cat <<End-of-File >$tmp.conf
105 # temporary pmcd.conf for qa/$seq
106 solaris 75 dso solaris_init $PCP_PMDAS_DIR/solaris/pmda_solaris.so
107 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
110 echo "Arrgh ... need pmcd.conf for $PCP_PLATFORM"
113 echo "=== initial pmcd.conf ===" >>$seq.full
114 cat $tmp.conf
>>$seq.full
115 echo "=== ===" >>$seq.full
116 $sudo cp $tmp.conf
$PCP_PMCDCONF_PATH
117 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
120 cat <<End-of-File >$tmp.cmd
121 rm -f $PCP_PMCDCONF_PATH.prev
122 . $PCP_SHARE_DIR/lib/pmdaproc.sh
125 __pmda_add "bogus 111 pipe binary $killer"
129 echo "__pmda_add test: expect this to fail and revert to the status quo ..."
130 echo "__pmda_add test: expect this to fail and revert to the status quo ..." >>$seq.full
133 $sudo sh
$tmp.cmd
2>&1 \
136 cat $tmp.out
>>$seq.full
138 echo "=== pmcd.conf after bogus install ===" >>$seq.full
139 cat $PCP_PMCDCONF_PATH >>$seq.full
140 echo "=== ===" >>$seq.full
142 echo "\$PCP_PMCDCONF_PATH should be put back the way it was ... diffs ..."
143 diff $PCP_PMCDCONF_PATH $tmp.conf
146 cat <<End-of-File >$tmp.cmd
147 rm -f $PCP_PMCDCONF_PATH.prev
148 . $PCP_SHARE_DIR/lib/pmdaproc.sh
150 __pmda_cull fungus 222
153 echo "bogus 111 pipe binary $killer" >>$tmp.conf
154 echo "fungus 222 pipe binary $killer" >>$tmp.conf
155 echo "=== next pmcd.conf ===" >>$seq.full
156 cat $tmp.conf
>>$seq.full
157 echo "=== ===" >>$seq.full
158 $sudo cp $tmp.conf
$PCP_PMCDCONF_PATH
161 echo "__pmda_cull test: expect this to fail and restoration to fail ..."
162 echo "__pmda_cull test: expect this to fail and restoration to fail ..." >>$seq.full
165 $sudo sh
$tmp.cmd
2>&1 \
168 cat $tmp.out
>>$seq.full
170 echo "=== pmcd.conf after fungus remove ===" >>$seq.full
171 cat $PCP_PMCDCONF_PATH >>$seq.full
172 echo "=== ===" >>$seq.full