#! /bin/sh # PCP QA Test No. 1045 (formerly 526) # exercise pmieconf version control (pmie config/rules) # # # 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 which pmieconf >/dev/null 2>&1 || _notrun "No pmieconf binary installed" _filter_date() { # ctime format: Thu Dec 17 15:26:15 1998 sed -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]/[DATE]/g' \ -e "s@$PCP_BINADM_DIR/pmpost@pmpost@" } _filter_pmie() { if [ $PCP_PLATFORM = darwin ] then sed \ -e '/metric swap.pagesout not in namespace/d' \ -e '/pmLookupName failed: Unknown metric name/d' elif [ $PCP_PLATFORM = solaris ] then sed \ -e '/metric swap.pagesout not in namespace/d' \ -e '/metric filesys.used not in namespace/d' \ -e '/metric filesys.capacity not in namespace/d' \ -e '/metric filesys.used not in namespace/d' \ -e '/pmLookupName failed: Unknown metric name/d' else cat fi } status=1 # failure is the default! trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 # real QA test starts here cat > $tmp.pmie <$tmp.stderr sed -e "s/$seq-$$/[SEQ-PID]/g" $tmp.stderr echo status=$? cat > $tmp.pmie </dev/null echo status=$? pmie -C $tmp.pmie1 >$tmp.out 2>&1 sts=$? _filter_pmie <$tmp.out echo status=$sts _filter_date < $tmp.pmie1 # APPEND this to the above file cat >> $tmp.pmie </dev/null echo status=$? pmie -C $tmp.pmie2 >$tmp.out 2>&1 sts=$? _filter_pmie <$tmp.out echo status=$sts _filter_date < $tmp.pmie2 cp $tmp.pmie $tmp.pmie3 $sudo mv ./pconf/cpu/load_average $tmp.load echo echo "=== check that changes for unsupported rules are moved to end" pmieconf -r ./pconf -f $tmp.pmie3 m filesys.buffer_cache holdoff 120 >/dev/null $sudo mv $tmp.load ./pconf/cpu/load_average echo status=$? pmie -C $tmp.pmie3 >$tmp.out 2>&1 sts=$? _filter_pmie <$tmp.out echo status=$sts _filter_date < $tmp.pmie3 # success, all done status=0 exit