File: 842

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 (69 lines) | stat: -rwxr-xr-x 1,877 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
#!/bin/sh
# PCP QA Test No. 842
# Exercise basic pmiostat(1) invocations using an archive.
#
# Copyright (c) 2014 Red Hat.
#

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

. ./common.python

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

PMIOSTAT="$PCP_BIN_DIR/pmiostat"
test -x $PMIOSTAT || _notrun "No pmiostat(1) installed"
PMIOSTAT="$python $PMIOSTAT"

# real QA test starts here
echo 'All devices'
$PMIOSTAT -z --samples 5 --archive archives/dm-io
echo

echo 'DM devices'
$PMIOSTAT -z --samples 3 --archive archives/dm-io -x dm
echo

echo 'Timestamps and no headers'
$PMIOSTAT -z --samples 10 --archive archives/dm-io -x t,h
echo

echo 'Precision'
precision=0
while [ $precision -le 8 ]
do
    echo == Precision=$precision
    $PMIOSTAT -z -P $precision --samples 3 --archive archives/dm-io -x t,h
    echo
    precision=`expr $precision + 1`
done

echo 'Checking reported values against pmval'
t=1
while [ $t -le 30 ]
do
    for metric_field in read_merge:7 write_merge:8 read:9 write:10 read_bytes:11 write_bytes:12
    do
	metric=$(echo $metric_field | sed -e 's/:.*$//')
	field=$(echo $metric_field | sed -e 's/^.*://') 

	echo >>$seq_full
	echo "=== metric=$metric field=$field ===" >>$seq_full
	$PCP_ECHO_PROG $PCP_ECHO_N "Checking pmiostat against pmval -t $t disk.dev.$metric ...""$PCP_ECHO_C" | tee -a $seq_full
	pmval -t $t -a archives/dm-io -f 1 disk.dev.$metric'[sda]' 2>/dev/null \
	| tee -a $seq_full \
	| sed -e 's/\.[0-9]*//' \
	| $PCP_AWK_PROG '/^[0-9][0-9]:/ {print $1, $2}' >$tmp.pmval
	$PMIOSTAT -P 1 -t $t -a archives/dm-io -xt,h \
	| tee -a $seq_full \
	| $PCP_AWK_PROG '/^#/ {skip} /sda/ {print $4, $'$field'}' >$tmp.pmiostat
	if diff $tmp.pmval $tmp.pmiostat >>$seq_full; then $PCP_ECHO_PROG OK; else $PCP_ECHO_PROG FAILED; fi
    done
    t=`expr $t + 1`
done

# success, all done
status=0
exit