3 # check pmie atexit problem
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # create our own tmpdir to ensure we can write to it
14 mkdir
-p $tmpdir/pmlogger
15 export PCP_TMP_DIR
=$tmpdir
17 # get standard environment, filters and checks
24 pmstore sample.write_me
2 >/dev
/null
# reset value
28 signal
=$PCP_BINADM_DIR/pmsignal
29 status
=1 # failure is the default!
30 trap "_cleanup; exit \$status" 0 1 2 3 15
33 pmstore sample.write_me
2 >/dev
/null
# initialise value
35 cat <<End-of-File >$tmp.conf
36 ( sample.write_me != 2 ) -> shell "echo sample.write_me changed 1>&2" " %v != 2";
39 # real QA test starts here
41 id pcp
>/dev
/null
2>&1 && pmieopts
="$pmieopts -U $username"
42 pmie
-t 0.5sec
$pmieopts -l $tmp.out
$tmp.conf
&
46 pmstore sample.write_me
5 >/dev
/null
50 echo "PMIE IS RUNNING"
51 echo "=== check data file still exists..."
52 [ ! -f $PCP_TMP_DIR/pmie
/$pid ] && echo "urk, data file has vanished!"
53 echo "=== check log file after first exit..."
54 _filter_pmie_log
< $tmp.out |
uniq
60 echo "PMIE HAS NOW EXITED"
62 echo "=== check data file has gone..."
63 [ -f $PCP_TMP_DIR/pmie
/$pid ] && echo "urk, data file is still there!"
64 echo "=== check log file after real exit..."
67 # $PCP_AWK_PROG filter filters out repeated messages from pmie - including the
68 # odd one that occurs after or between the termination messages
70 _filter_pmie_log
< $tmp.out \
72 /write_me/ { if ($0 != before) print