File: 553

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (128 lines) | stat: -rwxr-xr-x 3,760 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
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
#!/bin/sh
# PCP QA Test No. 553
# Exercise the gluster filesystem PMDA.
#
# Copyright (c) 2013 Red Hat.
#

seq=`basename $0`
echo "QA output created by $seq"

. ./common.python

python_path=`which $python`
pmda_path="$PCP_PMDAS_DIR/gluster"
pmda_script="$pmda_path/pmdagluster.python"
test -f "$pmda_script" || _notrun "pmdagluster not supported"
$python -c "from pcp import pmda" >/dev/null 2>&1
[ $? -eq 0 ] || _notrun "python pcp pmda module not installed"

status=1	# failure is the default!
trap "cd $here; rm -rf $tmp.*; $sudo rm -f gluster.log*; exit \$status" 0 1 2 3 15

_filter()
{
    tee -a $seq_full | \
    sed \
	-e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
        -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
        -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \
	-e "s;$python_path;\$PCP_PYTHON_PROG;" \
	-e "s;$python_basename;python;" \
    #end

    test -f gluster.log && cat gluster.log >> $seq_full
}

_filter_result()
{
    _filter | _filter_dumpresult
}

domain=118
test="$here/gluster"
GLUSTER_HOME="$test"; export GLUSTER_HOME
GLUSTER_VOL_INFO="$test/test.sh info info-single"; export GLUSTER_VOL_INFO
GLUSTER_VOL_STATS="$test/test.sh stats profile-%s-info"; export GLUSTER_VOL_STATS
GLUSTER_VOL_STOP="$test/test.sh stop %s $seq $tmp.stop"; export GLUSTER_VOL_STOP
GLUSTER_VOL_START="$test/test.sh start %s $seq $tmp.start"; export GLUSTER_VOL_START

# real QA test starts here
PCP_PYTHON_PMNS=root $python "$pmda_script" > $tmp.root

echo "== Testing volume instance domain" | tee -a $seq_full
$sudo TERM=ansi dbpmda -n $tmp.root -ie <<End-of-File 2>&1 | _filter
open pipe $python_path $pmda_script
instance $domain.0
End-of-File

cat gluster.log >>$seq_full

echo "== Testing volume information metrics" | tee -a $seq_full
$sudo TERM=ansi dbpmda -n $tmp.root -ie <<End-of-File 2>&1 | _filter
open pipe $python_path $pmda_script
getdesc on
desc gluster.volume.dist.count
desc gluster.volume.stripe.count
desc gluster.volume.replica.count
fetch gluster.volume.dist.count
fetch gluster.volume.stripe.count
fetch gluster.volume.replica.count
End-of-File

cat gluster.log >>$seq_full

echo "== Testing volume control metric store" | tee -a $seq_full
$sudo rm -f $tmp.start $tmp.stop
$sudo TERM=ansi dbpmda -n $tmp.root -ie <<End-of-File 2>&1 | _filter
open pipe $python_path $pmda_script
getdesc on
desc gluster.volume.profile
fetch gluster.volume.profile
store gluster.volume.profile "1"
store gluster.volume.profile "0"
End-of-File
# store should produce start/stop files via gluster/test.sh
cat $tmp.start $tmp.stop
$sudo rm -f $tmp.start $tmp.stop

cat gluster.log >>$seq_full

echo "== Testing brick instance domain" | tee -a $seq_full
$sudo TERM=ansi dbpmda -n $tmp.root -ie <<End-of-File 2>&1 | _filter
open pipe $python_path $pmda_script
instance $domain.1
End-of-File

cat gluster.log >>$seq_full

echo "== Testing brick throughput metrics" | tee -a $seq_full
$sudo TERM=ansi dbpmda -n $tmp.root -ie <<End-of-File 2>&1 | _filter
open pipe $python_path $pmda_script
getdesc on
desc gluster.brick.read_bytes
fetch gluster.brick.read_bytes
desc gluster.brick.write_bytes
fetch gluster.brick.write_bytes
End-of-File

cat gluster.log >>$seq_full

echo "== Testing brick file operation latency metrics" | tee -a $seq_full
$sudo TERM=ansi dbpmda -n $tmp.root -ie <<End-of-File 2>&1 | _filter
open pipe $python_path $pmda_script
getdesc on
desc gluster.brick.latency.getxattr.avg
desc gluster.brick.latency.getxattr.min
desc gluster.brick.latency.getxattr.max
desc gluster.brick.latency.getxattr.count
fetch gluster.brick.latency.getxattr.avg
fetch gluster.brick.latency.getxattr.min
fetch gluster.brick.latency.getxattr.max
fetch gluster.brick.latency.getxattr.count
End-of-File

cat gluster.log >>$seq_full

status=0
exit