3 # error handling and basic functionality for pmevent
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
17 status
=0 # success is the default!
18 $sudo rm -rf $tmp.
* $seq.full
19 trap "$sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
26 -e '/^first=/s/=.*/=.../' \
27 -e '/^now=/s/=.*/=.../' \
28 -e '/^last=/s/=.*/=.../' \
34 -e '/invalid option/s/[^'"'"']$/'"'&'"'/'
40 -e "s/host: $host/host: localhost/g" \
41 -e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g'
47 pmevent $
* 2>&1 | _filter_usage
53 $sudo_local_ctx pmevent $
* 2>&1 | _filter_usage
59 pmstore sample.event.
reset 0 >/dev
/null
2>&1
60 pmstore sampledso.event.
reset 0 >/dev
/null
2>&1
61 pmevent $
* 2>&1 | _filter
70 # real QA test starts here
72 # command line arg syntax and semantic checks
82 _run_sudo
-K blah
,a
,/no
/such
/file,no_init
92 # metric spec syntax and semantic checks
95 echo "--- bad metric spec ---"
96 _run
/some
/path
/no
/metric
/
97 _run somehost_and_no_metric
:
100 echo "--- illegal mixed sources ---"
101 _run archives
/eventrec-old
/sample.event.records foo
/bar
102 _run
-a /some
/path foo
:bar
103 _run
-a archives
/eventrec-old archives
/eventrec-old
/sample.event.records foo
/bar
104 _run localhost
:sample.event.records foo
:bar
105 _run
-h somehost foo
/bar
106 _run
-h localhost localhost
:sample.event.records foo
:bar
107 _run_sudo @
:sampledso.event.records foo
:bar
110 echo "--- problems at source of metrics ---"
111 _run
-h no.such.
host.pcp.io sample.event.records
112 _run
-a /no
/such
/archive sample.event.records
113 _run_sudo
-L sample.event.records
114 _run
-Dappl0 "sample.event.no_indom_records[red]"
117 echo "--- should be ok ---"
118 _run_ok
-t 10msec
-s 1 sample.event.records
119 _run_ok
-t 10msec
-s 8 sample.event.records
120 _run_ok
-t 10msec
-s 3 'sample.event.records[bogus]'
123 echo "--- archive exercises ---"
124 _run_arch
-z archives
/eventrec-old
/sample.event.records
125 _run_arch
-z -S@
15:26:11.073 -s 2 -a archives
/eventrec-old sample.event.records
126 _run_arch
-z -O+2.5 -T+4.5 -a archives
/eventrec-old sample.event.records
129 echo "--- highres events ---"
130 _run_arch
-z archives
/eventrec
/sample.event.highres_records