3 # pmlogger silently exits when started in a directory that is
6 # Copyright (c) 2013 Ken McDonell. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 status
=1 # failure is the default!
18 $sudo rm -rf $tmp.
* $seq.full
19 trap "cd $here; chmod 755 $tmp.home; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
27 _filter_pmlogger_log
<$1
29 echo "Error: no pmlogger.log created"
32 if [ -f $2.0
-a -f $2.meta
]
34 pmdumplog
$2 sampledso.colour \
36 |
sed -e '/green/s/[0-9][0-9]*$/NUMBER/'
38 echo "Error: no TEST archive created"
47 echo "std$type contains ..."
48 _filter_pmlogger_log
<$tmp.
$type
50 echo "std$type is empty"
53 echo "Error: std$type not created!"
59 cat >$tmp.home
/config
<<End-of-File
60 log mandatory on 1 sec {
61 sampledso.colour["green"]
65 # real QA test starts here
67 echo "default case ... should work"
68 rm -f $tmp.out
$tmp.err
69 $PCP_BINADM_DIR/pmlogger
-s 2 -c .
/config
-l .
/pmlogger.log .
/TEST
>$tmp.out
2>$tmp.err
70 _check .
/pmlogger.log .
/TEST
73 echo "make current directory non-writeable and try again"
74 rm -f TEST.
* pmlogger.log
75 rm -f $tmp.out
$tmp.err
77 $PCP_BINADM_DIR/pmlogger
-s 2 -c .
/config
-l .
/pmlogger.log .
/TEST
>$tmp.out
2>$tmp.err
78 _check .
/pmlogger.log .
/TEST
81 echo "now try with log somewhere writeable"
83 rm -f $tmp.out
$tmp.err
85 $PCP_BINADM_DIR/pmlogger
-s 2 -c .
/config
-l $tmp.log .
/TEST
>$tmp.out
2>$tmp.err
86 _check
$tmp.log .
/TEST
89 echo "and finally with the archive somewhere writeable"
90 rm -f $tmp.TEST.
* pmlogger.log
91 rm -f $tmp.out
$tmp.err
93 $PCP_BINADM_DIR/pmlogger
-s 2 -c .
/config
-l .
/pmlogger.log
$tmp.TEST
>$tmp.out
2>$tmp.err
94 _check .
/pmlogger.log
$tmp.TEST