diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
commit | 47e6e7c84f008a53061e661f31ae96629bc694ef (patch) | |
tree | 648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/500 | |
download | pcp-47e6e7c84f008a53061e661f31ae96629bc694ef.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/500')
-rwxr-xr-x | qa/500 | 81 |
1 files changed, 81 insertions, 0 deletions
@@ -0,0 +1,81 @@ +#! /bin/sh +# PCP QA Test No. 500 +# #636417 - pmnewlog fails to accept all pmlogger options +# +# 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 + +signal=$PCP_BINADM_DIR/pmsignal +newlog=$PCP_BINADM_DIR/pmnewlog +status=1 # failure is the default! +trap "cd $here; $sudo rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15 + +mkdir -p -m 777 $tmp +cd $tmp +wai=`whoami` + +_filter_pmnewlog() +{ + sed \ + -e 's/process [0-9][0-9]*/process PID/' \ + -e "s/^ *$wai/ pcpqa/" \ + -e '/^ *pcp*.*pmlogger -L.*.*-c null one/ s/.*/-- ps line removed --/' \ + -e '/^ *root.*pmlogger -L.*.*-c null one/ s/.*/-- ps line removed --/' \ + -e '/^[0-9][0-9]*.* pmlogger -L.*.*-c null one/ s/.*/-- ps line removed --/' \ + -e 's/ SIG.* done/ signal stuff ... done/' \ + -e "s;$tmp;TMP;g" \ + -e 's/ -h [^ ]*/ -h HOST/g' \ + -e '/pmlogger \[[0-9][0-9]*].*/{ + s/\[.*/[PID] .../ + q + }' +} + +# real QA test starts here +touch null +_start_up_pmlogger -L -c null one +pmlogger_pid=$pid + +for arg in '-D pdu' -r '-t 5sec' '-v 100k' +do + echo + echo "pmnewlog args: -V -L -c null -p ... $arg one" + _wait_for_pmlogger $pmlogger_pid pmlogger.log + $sudo rm -f one.* + eval $sudo $newlog -V -L -c null -p $pmlogger_pid $arg one >out + _filter_pmnewlog <out + + pmlogger_pid=`sed -n <out '/^pmlogger \[/{ +s/].*// +s/.*\[// +p +}'` + if [ -z "$pmlogger_pid" ] + then + echo "Cannot extract pmlogger PID from ..." + cat out + echo + echo "... giving up!" + exit + fi + +done + +$sudo $signal -s TERM $pmlogger_pid +_wait_pmlogger_end $pmlogger_pid + +echo +echo "expect none of my pmloggers to be running ..." +ps $PCP_PS_ALL_FLAGS | grep pmlogger | grep 'null one' | grep -v grep + +# success, all done +status=0 +exit |