/var/lib/pcp/testsuite/443 is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | #!/bin/sh
# PCP QA Test No. 443
# error handling and basic functionality for pmevent
#
# Copyright (c) 2011 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
status=0 # success is the default!
$sudo rm -rf $tmp.* $seq.full
trap "$sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
host=`hostname`
_filter_usage()
{
sed \
-e '/^first=/s/=.*/=.../' \
-e '/^now=/s/=.*/=.../' \
-e '/^last=/s/=.*/=.../' \
-e '/Usage/q' \
-e '/illegal option/{
s/illegal/invalid/
s/.$/'"'&'"'/
}' \
-e '/invalid option/s/[^'"'"']$/'"'&'"'/'
}
_filter()
{
sed \
-e "s/host: $host/host: localhost/g" \
-e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9]*[0-9]/TIMESTAMP/g'
}
_run()
{
echo "=== $* ==="
pmevent $* 2>&1 | _filter_usage
}
_run_sudo()
{
echo "=== $* ==="
$sudo_local_ctx pmevent $* 2>&1 | _filter_usage
}
_run_ok()
{
echo "=== $* ==="
pmstore sample.event.reset 0 >/dev/null 2>&1
pmstore sampledso.event.reset 0 >/dev/null 2>&1
pmevent $* 2>&1 | _filter
}
_run_arch()
{
echo "=== $* ==="
pmevent $* 2>&1
}
# real QA test starts here
# command line arg syntax and semantic checks
#
_run -a foo -a bar
_run -h foo -h bar
_run -a foo -h bar
_run -h foo -a bar
_run -D blah
_run -g -p 1234
_run -p 1234 -g
_run -p 123foo
_run_sudo -K blah,a,/no/such/file,no_init
_run -s 456bar
_run -t 10foobars
_run -Z GMT -z
_run -z -Z EST
_run -q
_run -a foo
# metric spec syntax and semantic checks
#
echo
echo "--- bad metric spec ---"
_run /some/path/no/metric/
_run somehost_and_no_metric:
echo
echo "--- illegal mixed sources ---"
_run archives/eventrec-old/sample.event.records foo/bar
_run -a /some/path foo:bar
_run -a archives/eventrec-old archives/eventrec-old/sample.event.records foo/bar
_run localhost:sample.event.records foo:bar
_run -h somehost foo/bar
_run -h localhost localhost:sample.event.records foo:bar
_run_sudo @:sampledso.event.records foo:bar
echo
echo "--- problems at source of metrics ---"
_run -h no.such.host.pcp.io sample.event.records
_run -a /no/such/archive sample.event.records
_run_sudo -L sample.event.records
_run -Dappl0 "sample.event.no_indom_records[red]"
echo
echo "--- should be ok ---"
_run_ok -t 10msec -s 1 sample.event.records
_run_ok -t 10msec -s 8 sample.event.records
_run_ok -t 10msec -s 3 'sample.event.records[bogus]'
echo
echo "--- archive exercises ---"
_run_arch -z archives/eventrec-old/sample.event.records
_run_arch -z -S@15:26:11.073 -s 2 -a archives/eventrec-old sample.event.records
_run_arch -z -O+2.5 -T+4.5 -a archives/eventrec-old sample.event.records
echo
echo "--- highres events ---"
_run_arch -z archives/eventrec/sample.event.highres_records
# success, all done
exit
|