blob: 119f3c11ac1c786018a9801f5531d465413f91bf (
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
|
#! /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
|