blob: fd05449849c60708599f65b7bdcce6aaed78e9b6 (
plain)
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
|
#! /bin/sh
# PCP QA Test No. 461
# checks pmdalogger event access functionality
#
# Copyright (c) 2011 Aconex. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
. ./localconfig
[ -d $PCP_PMDAS_DIR/logger ] || _notrun "No pmdalogger installed"
[ $PCP_VER -ge 3610 ] || _notrun "Installed pmdalogger is too old"
_cleanup()
{
_restore_pmda_install logger
if $_needclean
then
if $install_on_cleanup
then
( cd $PCP_PMDAS_DIR/logger; $sudo ./Install </dev/null >/dev/null 2>&1 )
else
( cd $PCP_PMDAS_DIR/logger; $sudo ./Remove </dev/null >/dev/null 2>&1 )
fi
_needclean=false
fi
$sudo rm -f $tmp.*
exit $status
}
_testdata()
{
# generate data in a single write, for pmda determinism
echo \
"TeSt DaTa ... TeSt DaTa ...
TeSt2 DaTa2 ... TeSt2 DaTa2"
}
_filter()
{
sed \
-e "s,$tmp,TMPFILE,g" \
-e "s,$PCP_VAR_DIR,PCP_VAR_DIR,g" \
-e "s/host: $host/host: localhost/g" \
-e 's/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g'
}
install_on_cleanup=false
pminfo logger >/dev/null 2>&1 && install_on_cleanup=true
status=1 # failure is the default!
host=`hostname`
_needclean=true
trap "_cleanup" 0 1 2 3 15
# real QA test starts here
_prepare_pmda_install logger
# prepare test case files (see below)
$sudo rm -f $tmp.*
touch $tmp.reg
echo "
reg y $tmp.reg
" > $tmp.conf
[ -d $PCP_VAR_DIR/config/logger ] || $sudo mkdir -p $PCP_VAR_DIR/config/logger
$sudo cp $tmp.conf $PCP_VAR_DIR/config/logger/logger.conf
# install PMDA accepting the defaults (esp config file)
$sudo ./Remove < /dev/null >/dev/null 2>&1
$sudo ./Install < /dev/null >$tmp.out 2>&1
cat $tmp.out | _filter_pmda_install | _filter
echo "=== 1. store access control enabled ==="
echo "Starting initial event watcher:"
pmevent -x '' -s 5 -t 1 logger.perfile.reg.records > $tmp.event &
sleep 2
_testdata >> $tmp.reg
wait
echo "done."
echo "Captured event trace was:"
cat $tmp.event | _filter
echo "=== 2. store access control disabled ==="
echo "Starting initial event watcher:"
pmevent -s 5 -t 1 logger.perfile.reg.records > $tmp.event &
sleep 2
_testdata >> $tmp.reg
wait
echo "done."
echo "Captured event trace was:"
cat $tmp.event | _filter
status=0
exit
|