3 # exercise the logging state compatibility matrix for pmlc ...
4 # initial: singular metric request: different singular metric
6 # Copyright (c) 2014 Red Hat.
7 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
11 echo "QA output created by $seq"
13 # get standard filters
18 trap "$sudo rm -f $tmp $tmp.*; exit" 0 1 2 3 15
24 s/connect [0-9][0-9]*/connect PID/
28 s/ on port [0-9][0-9]*//
30 s/ at .*/ at HOSTNAME/
34 -e 's/Version [0-9].*/Version VERSION/' \
36 /pmlc commands/ { skip = 1; print "[command summary deleted ...]" }
37 /metric-name/ { skip = 0; next }
44 _filter_pmlogger_log \
46 -e '/AF event queue/d'
54 -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
56 s/inst \[[0-9][0-9]* or "dks..."]/inst [DISK]/
57 s;inst \[[0-9][0-9]* or "/dev/[^"]*"];inst [DISK];
58 s;inst \[[0-9][0-9]* or ".*/dbs/.*\.dbf"];inst [FILE];
61 s/value [0-9][0-9]*\.[0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
62 s/value [0-9][0-9]*\.[0-9][0-9]*/value NUMBER/
63 s/value [0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
64 s/value [0-9][0-9]*/value NUMBER/
65 s/value \[.*]/value AGGREGATE/
66 s/value ".*"/value STRING/
68 -e "/pmcd\.pmlogger\./s/$logger_pid/LOGGER_PID/g" \
69 -e '/pmcd\.pmlogger\.port/s/value .*/value PORT/' \
70 -e '/pmcd\.pmlogger\.host/s/value ".*/value "HOST"/' \
71 -e '/pmcd\.pmlogger\.archive/s/value ".*/value "PATH"/'
76 for ctl
in mandatory advisory
78 for state
in "on once" maybe off
80 [ "$ctl $state" = "advisory maybe" ] && continue
81 for req_ctl
in mandatory advisory
83 for req_state
in "on once" maybe off
85 [ "$req_ctl $req_state" = "advisory maybe" ] && continue
87 echo "log mandatory maybe { sample.seconds sample.drift }"; \
88 echo "# $ctl $state -> $req_ctl $req_state"; \
89 echo "log $ctl $state sample.seconds"; \
92 ( echo "log $req_ctl $req_state sample.drift"; \
93 echo "query { sample.seconds sample.drift }"; \
96 # need sleeps to allow pmlogger to get a look in and
97 # to allow the pmlogger socket to be closed so the
98 # next pmlc invocation can get connected
107 # real QA test starts here
108 $sudo rm -f $tmp.0 $tmp.meta
$tmp.index
110 # start pmlogger with the expected number of samples plus a few more
111 # to detect extra log output
113 _start_up_pmlogger
-t 0.5sec
-L -s 30 -c /dev
/null
-l $tmp.log
$tmp >$tmp.err
2>&1
117 _do_cmds
$logger_pid >$tmp.out
2>&1
119 # this chews up any remaining samples quickly so pmlogger terminates
121 echo "log mandatory on 25 msec sample.long.one" \
122 | pmlc
-ie $logger_pid >>$tmp.out
2>&1
124 _filter_pmlc
<$tmp.out
126 # wait for pmlogger to terminate
128 _wait_pmlogger_end
$logger_pid
129 cat $tmp.err
$tmp.log | _filter_logger
134 echo "Uniq filtered entries from pmdumplog ..."
137 |
sed -e 's/TIMESTAMP//' -e 's/^ *//' \
138 | LC_COLLATE
=POSIX
sort -u
139 pmdumplog
$tmp >$seq.full
2>&1
141 echo "Archive log is empty"