3 # exercise the logging state compatibility matrix for pmlc ...
4 # initial: some instances for a metric
5 # request: different instances for the same metric
7 # Copyright (c) 2014 Red Hat.
8 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
12 echo "QA output created by $seq"
14 # get standard filters
19 trap "$sudo rm -f $tmp $tmp.*; exit" 0 1 2 3 15
25 s/connect [0-9][0-9]*/connect PID/
29 s/ on port [0-9][0-9]*//
31 s/ at .*/ at HOSTNAME/
35 -e 's/Version [0-9].*/Version VERSION/' \
37 /pmlc commands/ { skip = 1; print "[command summary deleted ...]" }
38 /metric-name/ { skip = 0; next }
45 _filter_pmlogger_log \
47 -e '/AF event queue/d'
55 -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
57 s/inst \[[0-9][0-9]* or "dks..."]/inst [DISK]/
58 s;inst \[[0-9][0-9]* or "/dev/[^"]*"];inst [DISK];
59 s;inst \[[0-9][0-9]* or ".*/dbs/.*\.dbf"];inst [FILE];
62 s/value [0-9][0-9]*\.[0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
63 s/value [0-9][0-9]*\.[0-9][0-9]*/value NUMBER/
64 s/value [0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
65 s/value [0-9][0-9]*/value NUMBER/
66 s/value \[.*]/value AGGREGATE/
67 s/value ".*"/value STRING/
69 -e "/pmcd\.pmlogger\./s/$logger_pid/LOGGER_PID/g" \
70 -e '/pmcd\.pmlogger\.port/s/value .*/value PORT/' \
71 -e '/pmcd\.pmlogger\.host/s/value ".*/value "HOST"/' \
72 -e '/pmcd\.pmlogger\.archive/s/value ".*/value "PATH"/' \
78 for ctl
in mandatory advisory
80 for state
in "on once" maybe off
82 [ "$ctl $state" = "advisory maybe" ] && continue
83 for req_ctl
in mandatory advisory
85 for req_state
in "on once" maybe off
87 [ "$req_ctl $req_state" = "advisory maybe" ] && continue
89 echo "log mandatory maybe sample.bin "'[ "bin-100", "bin-200", "bin-300", "bin-400", "bin-500" ]'
90 echo "# $ctl $state -> $req_ctl $req_state"; \
91 echo "log $ctl $state sample.bin "'[ "bin-100", "bin-200", "bin-300"]'
94 ( echo "log $req_ctl $req_state sample.bin "'[ "bin-400", "bin-500" ]'; \
95 echo "query sample.bin"; \
98 # need sleeps to allow pmlogger to get a look in and
99 # to allow the pmlogger socket to be closed so the
100 # next pmlc invocation can get connected
109 # real QA test starts here
110 $sudo rm -f $tmp.0 $tmp.meta
$tmp.index
112 # start pmlogger with the expected number of samples plus a few more
113 # to detect extra log output
115 _start_up_pmlogger
-t 0.5sec
-L -s 30 -c /dev
/null
-l $tmp.log
$tmp >$tmp.err
2>&1
119 _do_cmds
$logger_pid >$tmp.out
2>&1
121 # this chews up any remaining samples quickly so pmlogger terminates
123 echo "log mandatory on 25 msec sample.long.one" \
124 | pmlc
-ie $logger_pid >>$tmp.out
2>&1
126 _filter_pmlc
<$tmp.out
128 # wait for pmlogger to terminate
130 _wait_pmlogger_end
$logger_pid
131 cat $tmp.err
$tmp.log | _filter_logger
136 echo "Uniq filtered entries from pmdumplog ..."
139 |
sed -e 's/TIMESTAMP//' -e 's/^ *//' \
140 | LC_COLLATE
=POSIX
sort -u
141 pmdumplog
$tmp >$seq.full
2>&1
143 echo "Archive log is empty"