Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 1099
blobf001f37383c60acc3009909adff1eb84d396ecf8
1 #!/bin/sh
2 # PCP QA Test No. 1099
3 # Check changed semantics for interpolation in the region of <mark>
4 # records.
6 # Also tests various pcp-iostat features (see also 851)
8 # Copyright (c) 2016 Ken McDonell. All Rights Reserved.
9 # Copyright (c) 2016 Red Hat. All Rights Reserved.
12 seq=`basename $0`
13 echo "QA output created by $seq"
15 # get standard environment, filters and checks
16 . ./common.product
17 . ./common.filter
18 . ./common.check
20 which pmiostat >/dev/null 2>&1 || _notrun "pmiostat binary not installed"
22 status=1 # failure is the default!
23 $sudo rm -rf $tmp $tmp.* $seq.full
24 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
26 # real QA test starts here
27 echo == with -S @17:30 -t 15m -A 15m expect NODATA at 18:15:00
28 pmiostat -z -a archives/pmiostat_mark -S @17:30 -t 15m -A 15m -z -x t | fold -36 | grep NODATA
29 # Tue Dec 1 18:15:02 2015 NODATA
31 echo == with -t 15m expect NODATA at 18:15:02
32 pmiostat -z -a archives/pmiostat_mark -t 15m -z -x t | fold -36 | grep NODATA
33 # Tue Dec 1 18:15:02 2015 NODATA
35 echo == with -t1m expecting NODATA at 17:51:02, 17:52:02 and 17:53:02
36 pmiostat -z -a archives/pmiostat_mark -t 1m -z -x t | fold -36 | grep '17:[45].*NODATA'
37 # Tue Dec 1 17:51:02 2015 NODATA
38 # Tue Dec 1 17:52:02 2015 NODATA
39 # Tue Dec 1 17:53:02 2015 NODATA
41 echo == with -A1m -t 1m expecting NODATA at 17:52:00 and 17:53:00
42 pmiostat -z -a archives/pmiostat_mark -A1m -t 1m -z -x t | fold -36 | grep '17:[45].*NODATA'
43 # Tue Dec 1 17:52:00 2015 NODATA
44 # Tue Dec 1 17:53:00 2015 NODATA
46 echo == with -A1m -s 10s expecting NODATA from 17:50:20 to 17:52:50
47 pmiostat -z -a archives/pmiostat_mark -A1m -t 10s -z -x t | fold -36 | grep '17:[45].*NODATA'
48 # Tue Dec 1 17:50:20 2015 NODATA
49 # Tue Dec 1 17:50:30 2015 NODATA
50 # Tue Dec 1 17:50:40 2015 NODATA
51 # Tue Dec 1 17:50:50 2015 NODATA
52 # Tue Dec 1 17:51:00 2015 NODATA
53 # Tue Dec 1 17:51:10 2015 NODATA
54 # Tue Dec 1 17:51:20 2015 NODATA
55 # Tue Dec 1 17:51:30 2015 NODATA
56 # Tue Dec 1 17:51:40 2015 NODATA
57 # Tue Dec 1 17:51:50 2015 NODATA
58 # Tue Dec 1 17:52:00 2015 NODATA
59 # Tue Dec 1 17:52:10 2015 NODATA
60 # Tue Dec 1 17:52:20 2015 NODATA
61 # Tue Dec 1 17:52:30 2015 NODATA
62 # Tue Dec 1 17:52:40 2015 NODATA
63 # Tue Dec 1 17:52:50 2015 NODATA
65 echo == with -A1m -t 1s expecting last NODATA in sequence at 17:52:42
66 pmiostat -z -a archives/pmiostat_mark -A1m -t 1s -z -x t | fold -36 | grep '17:[45].*NODATA' | tail -1
67 # Tue Dec 1 17:52:42 2015 NODATA
69 echo == with -A1s -t 1s expecting last NODATA in sequence ending at 17:52:42
70 pmiostat -z -a archives/pmiostat_mark -A1s -t 1s -z -x t | fold -36 | grep '17:[45].*NODATA' | tail -1
71 # Tue Dec 1 17:52:42 2015 NODATA
73 echo
74 cat <<End-of-File | pmie -a archives/pmiostat_mark -S @17:30 -t 15m -A 15m -z -v 2>/dev/null
75 v_instant = filesys.full;
76 v_counter = network.interface.in.packets;
77 End-of-File
79 echo '== testing pmiostat -u option incompatible with -t'
80 pmiostat -z -u -xt -t 1m -a archives/pmiostat_mark 2>/dev/null
81 echo expecting exit 1, got $?
83 echo '== testing pmiostat -u option requires -a'
84 pmiostat -u -xt 2>/dev/null
85 echo expecting exit 1, got $?
87 echo '== testing pmiostat -u for native (non-interpolating) replay'
88 pmiostat -z -u -xt -a archives/pmiostat_mark | tail -5
90 echo '== testing pmiostat -u with -O offset and -s samples'
91 pmiostat -z -u -xt -O'@18:58:41' -s 2 -a archives/pmiostat_mark
93 echo '== testing pmiostat -x noidle'
94 pmiostat -z -xt,noidle -t 30m -a archives/pmiostat_mark
96 echo '== testing pmiostat -R regex for sd devices'
97 pmiostat -z -xt -t 30m -a archives/pmiostat_mark -R 'sd[a-z]'
99 echo '== testing pmiostat -R regex for dm devices'
100 pmiostat -z -xt,dm -t 30m -a archives/pmiostat_mark -R 'home|swap'
102 for method in sum avg min max; do
103 echo "== testing pmiostat -R regex -G $method for sd devices"
104 pmiostat -z -xt -t 30m -a archives/pmiostat_mark -R 'sd[a-z]' -G $method
106 echo "== testing pmiostat -R regex -G $method for dm devices"
107 pmiostat -z -xt,dm -t 30m -a archives/pmiostat_mark -R 'home|swap' -G $method
108 done
110 # success, all done
111 status=0
113 exit