File: 341

package info (click to toggle)
pcp 7.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 253,896 kB
  • sloc: ansic: 1,488,097; sh: 185,322; xml: 160,462; cpp: 83,813; python: 25,576; perl: 18,365; yacc: 6,877; lex: 2,864; makefile: 2,759; exp: 250; awk: 165; fortran: 60; java: 22
file content (58 lines) | stat: -rwxr-xr-x 1,745 bytes parent folder | download
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
#!/bin/sh
# PCP QA Test No. 341
#
# exercise corner cases for pmdaCacheOp(...LOAD...)
#
# Copyright (c) 2010 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!
trap "$sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15

# [Tue Jan 26 09:10:16] pmdacache(22270) Warning: pmdaCacheOp: /var/lib/pcp/config/pmda/0.123: loading instance 0 ("eek") ignored, already in cache as 0 ("urk")
_filter()
{
    sed \
	-e 's/^\[[A-Z].. [A-Z]..  *[0-9][0-9]* ..:..:..]/[DATE]/' \
	-e 's/cache([0-9][0-9]*)/cache(PID)/' \
	-e 's/ 0x0 / (nil) /g' \
	-e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;"
}

# note - need to do everything as sudo because $PCP_VAR_DIR/config/pmda
# is not world writeable
#

$sudo rm -f $PCP_VAR_DIR/config/pmda/0.123

# real QA test starts here

echo "load without save, store a couple and save ..." | tee -a $seq_full
$sudo src/pmdacache -D indom -L -s eek -s urk -S 2>&1 | _filter
$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq_full

echo
echo "store one, load, store another couple and save ..." | tee -a $seq_full
$sudo src/pmdacache -D indom -s eek -L -s urk -s foo -S -d 2>&1 | _filter
$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq_full

echo
echo "store some, hide some, load ..." | tee -a $seq_full
$sudo src/pmdacache -D indom -s eek -s urk -s foo -s 'fumble mumble' -h eek -h foo -s bar -L -d 2>&1 | _filter
$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq_full

echo
echo "error case ..." | tee -a $seq_full
$sudo src/pmdacache -D indom -s 'urk a bit tricky' -s foo -L -d 2>&1 | _filter
$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq_full

# success, all done
exit